当前位置:网站首页>最新數據挖掘賽事方案梳理!
最新數據挖掘賽事方案梳理!
2022-06-25 18:44:00 【Datawhale】
Datawhale賽事
作者:牧小熊,華中農業大學,Datawhale成員

賽題介紹
科大訊飛:糖尿病遺傳風險檢測挑戰賽。背景:截至2022年,中國糖尿病患者近1.3億。中國糖尿病患病原因受生活方式、老齡化、城市化、家族遺傳等多種因素影響。同時,糖尿病患者趨向年輕化。
糖尿病可導致心血管、腎髒、腦血管並發症的發生。因此,准確診斷出患有糖尿病個體具有非常重要的臨床意義。糖尿病早期遺傳風險預測將有助於預防糖尿病的發生。
賽事地址:http://challenge.xfyun.cn/topic/info?type=diabetes&ch=ds22-dw-gzh01
源代碼:https://github.com/datawhalechina/competition-baseline
賽題任務
在這次比賽中,您需要通過訓練數據集構建糖尿病遺傳風險預測模型,然後預測出測試數據集中個體是否患有糖尿病,和我們一起幫助糖尿病患者解决這“甜蜜的煩惱”。
賽題數據
賽題數據由訓練集和測試集組成,具體情况如下:
訓練集:共有5070條數據,用於構建您的預測模型
測試集:共有1000條數據,用於驗證預測模型的性能。
其中訓練集數據包含有9個字段:性別、出生年份、體重指數、糖尿病家族史、舒張壓、口服耐糖量測試、胰島素釋放實驗、肱三頭肌皮褶厚度、患有糖尿病標識(數據標簽)。
評分標准
采用二分類任務中的F1-score指標進行評價,F1-score越大說明預測模型性能越好,F1-score的定義如下:

其中:


賽題Baseline
導入數據
import pandas as pd
import lightgbm數據預處理
data1=pd.read_csv('比賽訓練集.csv',encoding='gbk')
data2=pd.read_csv('比賽測試集.csv',encoding='gbk')
#label標記為-1
data2['患有糖尿病標識']=-1
#訓練集和測試機合並
data=pd.concat([data1,data2],axis=0,ignore_index=True)
#特征工程
"""
人體的成人體重指數正常值是在18.5-24之間
低於18.5是體重指數過輕
在24-27之間是體重超重
27以上考慮是肥胖
高於32了就是非常的肥胖。
"""
def BMI(a):
if a<18.5:
return 0
elif 18.5<=a<=24:
return 1
elif 24<a<=27:
return 2
elif 27<a<=32:
return 3
else:
return 4
data['BMI']=data['體重指數'].apply(BMI)
data['出生年份']=2022-data['出生年份'] #換成年齡
#糖尿病家族史
"""
無記錄
叔叔或者姑姑有一方患有糖尿病/叔叔或姑姑有一方患有糖尿病
父母有一方患有糖尿病
"""
def FHOD(a):
if a=='無記錄':
return 0
elif a=='叔叔或者姑姑有一方患有糖尿病' or a=='叔叔或姑姑有一方患有糖尿病':
return 1
else:
return 2
data['糖尿病家族史']=data['糖尿病家族史'].apply(FHOD)
data['舒張壓']=data['舒張壓'].fillna(-1)
"""
舒張壓範圍為60-90
"""
def DBP(a):
if a<60:
return 0
elif 60<=a<=90:
return 1
elif a>90:
return 2
else:
return a
data['DBP']=data['舒張壓'].apply(DBP)
data訓練數據/測試數據准備
train=data[data['患有糖尿病標識'] !=-1]
test=data[data['患有糖尿病標識'] ==-1]
train_label=train['患有糖尿病標識']
train=train.drop(['編號','患有糖尿病標識'],axis=1)
test=test.drop(['編號','患有糖尿病標識'],axis=1)構建模型
def select_by_lgb(train_data,train_label,test_data,random_state=2022,metric='auc',num_round=300):
clf=lightgbm
train_matrix=clf.Dataset(train_data,label=train_label)
params={
'boosting_type': 'gbdt',
'objective': 'binary',
'learning_rate': 0.1,
'metric': metric,
'seed': 2020,
'nthread':-1 }
model=clf.train(params,train_matrix,num_round)
pre_y=model.predict(test_data)
return pre_y模型驗證
test_data=select_by_lgb(train,train_label,test)
pre_y=pd.DataFrame(test_data)
pre_y['label']=pre_y[0].apply(lambda x:1 if x>0.5 else 0)
result=pd.read_csv('提交示例.csv')
result['label']=pre_y['label']
result.to_csv('baseline.csv',index=False)上分建議
本題中的模型部分用了相當簡單的方法,lightgbm算法中沒有進行交叉數據驗證,同時也僅僅使用了默認參數,因此選手可以在這個Baseline的基礎上進行進一步的參數優化於模型融合,同時注意到本公開的算法中特征工程構建進行了一部分的演示,選手可以根據糖尿病的相關醫學特點進行對特征進一步挖掘,從而提昇比賽的成績~
關注Datawhale公眾號,回複“數據挖掘”可邀請進數據挖掘賽事交流群,已在的不用再加入。

整理不易,點贊三連↓
边栏推荐
- Analysis of global tea production, consumption and import and export trade: China's tea production ranks first in the world [figure]
- RMAN backup database_ Manage backup window
- Anaconda download Tsinghua source
- [elt.zip] openharmony paper Club - memory compression for data intensive applications
- Training of long and difficult sentences in postgraduate entrance examination day89
- Current situation and trend analysis of China's glass packaging containers in 2021: the revenue of glass packaging containers increases year by year [figure]
- [in depth understanding of tcapulusdb technology] tcapulusdb regular documents
- C#泛型类案例
- TCP/IP 测试题(三)
- Addition, deletion, modification and query of mysql~ tables (detailed and easy to understand)
猜你喜欢

利尔达蓝牙空调接收器方案助力打造更舒适的公路生活

【ELT.ZIP】OpenHarmony啃论文俱乐部—数据密集型应用内存压缩
![[in depth understanding of tcapulusdb technology] form creation and approval of document acceptance](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[in depth understanding of tcapulusdb technology] form creation and approval of document acceptance

Use pagoda to set up mqtt server
![Analysis on development scale and development trend of China's night economy industry in 2021 [figure]](/img/57/d6821fca9a608bf33e78287cf26bae.jpg)
Analysis on development scale and development trend of China's night economy industry in 2021 [figure]

【历史上的今天】6 月 25 日:笔记本之父诞生;Windows 98 发布;通用产品代码首次商用
![Analysis on development status and development suggestions of e-commerce industry in Xinjiang in 2020 [figure]](/img/d1/8ed2958ef365e17494bade6e29ee04.jpg)
Analysis on development status and development suggestions of e-commerce industry in Xinjiang in 2020 [figure]

Web development solution to cross domain problems

Redis6

华为发布两大昇腾计划 推动AI人才发展和科研创新
随机推荐
Training of long and difficult sentences in postgraduate entrance examination English Day82
[elt.zip] openharmony paper Club - memory compression for data intensive applications
Idea annotation color modification method (clear)
LeetCode 3. Longest substring without repeated characters & sliding window
El table highly adaptive
GNU nano
一晚上做了一个xpath终结者:xpath-helper-plus
mysql事务讲解
RMAN backup database_ Duplexing backup sets
[deeply understand tcapulusdb technology] table management of document acceptance
想知道新股民怎样炒股票开户?在线开户安全么?
华为发布两大昇腾计划 推动AI人才发展和科研创新
焕新出发,利尔智达天下
Oriental Wealth function (the most complete edition of Childe Yong)
TCP/IP 测试题(二)
Training of long and difficult sentences in postgraduate entrance examination day84
Analysis on development scale and development trend of China's night economy industry in 2021 [figure]
LeetCode 198. Looting & dynamic planning
Regular expression summary
Tiger DAO VC产品正式上线,Seektiger生态的有力补充