当前位置:网站首页>最新數據挖掘賽事方案梳理!
最新數據挖掘賽事方案梳理!
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公眾號,回複“數據挖掘”可邀請進數據挖掘賽事交流群,已在的不用再加入。

整理不易,點贊三連↓
边栏推荐
- solidity获取季度时间
- Comparison rules of strings in JS
- Analysis on development scale and development trend of China's night economy industry in 2021 [figure]
- Apifox简单了解——WEB端测试的集大成者
- solidity日期工具
- 如何快速关闭8080端口
- [in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance doc
- Analysis of global tea production, consumption and import and export trade: China's tea production ranks first in the world [figure]
- Overview and trend analysis of China's CT examination equipment industry in 2021 [figure]
- electron 基础项目搭建 &&主线程和渲染线程的通信
猜你喜欢

Use pagoda to set up mqtt server

Redis configuration (Internet access, password)

158_模型_Power BI 使用 DAX + SVG 打通制作商業圖錶幾乎所有可能

Detailed explanation of oauth2 - Introduction (I)

Analysis on employment compensation of 2021 college graduates: the average monthly starting salary of doctors, masters, undergraduates and junior colleges is 14823 yuan, 10113 yuan, 5825 yuan and 3910
![[deeply understand tcapulusdb technology] transaction execution of document acceptance](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[deeply understand tcapulusdb technology] transaction execution of document acceptance

Class 02 loader subsystem
![Analysis on the development trend of China's intense pulsed light equipment industry in 2021: the market scale is growing, and the proportion of imported brands is large [figure]](/img/15/4477a850044136bb4b1ee92ab6df45.jpg)
Analysis on the development trend of China's intense pulsed light equipment industry in 2021: the market scale is growing, and the proportion of imported brands is large [figure]
![[deeply understand tcapulusdb technology] tmonitor background one click installation](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[deeply understand tcapulusdb technology] tmonitor background one click installation

Pycharm 使用过程中碰到问题
随机推荐
RMAN备份数据库_双重备份备份集(Duplexing Backup Sets)
Idea annotation color modification method (clear)
Redis configuration (Internet access, password)
初探Oracle全栈虚拟机---GraalVM
Training of long and difficult sentences in postgraduate entrance examination day84
SVN介绍及使用总结
Favorite PHP debugging methods
GNU nano
solidity获取季度时间
[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance
[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance doc
03 runtime data area overview and threads
RMAN backup database_ catalogue
Basic operation details of binary search tree (BST) (complete code, including test cases)
Move graph explorer to jupyterab: use ges4jupyter to connect ges and explore graphs
Regular expression summary
IDEA常用插件
[deeply understand tcapulusdb technology] create a game zone
QQ机器人:群成员自我禁言管理【最新beta2版本】
How to sort massive data? How to process data between memory and hard disk?