參賽鏈接:零基礎入門 Ai 數據挖掘競賽-速通 Baseline - 飛槳AI Studio星河社區
一、賽事背景
在當今科技日新月異的時代,人工智能(AI)技術正以前所未有的深度和廣度滲透到科研領域,特別是在化學及藥物研發中展現出了巨大潛力。精準預測分子性質有助于高效篩選出具有優異性能的候選藥物。以PROTACs為例,它是一種三元復合物由目標蛋白配體、linker、E3連接酶配體組成,靶向降解目標蛋白質。本次大賽聚焦于運用先進的人工智能算法預測其降解效能,旨在激發參賽者創新思維,推動AI技術與化學生物學的深度融合,進一步提升藥物研發效率與成功率,為人類健康事業貢獻智慧力量。通過此次大賽,我們期待見證并孵化出更多精準、高效的分子性質預測模型,共同開啟藥物發現的新紀元。
二、賽事任務
-
選手根據提供的demo數據集,可以基于demo數據集進行數據增強、自行搜集數據等方式擴充數據集,并自行劃分數據。運用深度學習、強化學習或更加優秀人工智能的方法預測PROTACs的降解能力,若DC50>100nM且Dmax<80% ,則視為降解能力較差(demo數據集中Label=0);若DC50<=100nM或Dmax>=80%,則視為降解能力好(demo數據集中Label=1)。
三、跑通baseline
1.安裝庫
pip install lightgbm openpyxl
2.跑baseline
# 1. 導入需要用到的相關庫
# 導入 pandas 庫,用于數據處理和分析
import pandas as pd
# 導入 numpy 庫,用于科學計算和多維數組操作
import numpy as np
# 從 lightgbm 模塊中導入 LGBMClassifier 類
from lightgbm import LGBMClassifier# 2. 讀取訓練集和測試集
# 使用 read_excel() 函數從文件中讀取訓練集數據,文件名為 'traindata-new.xlsx'
train = pd.read_excel('./data/data280993/traindata-new.xlsx')
# 使用 read_excel() 函數從文件中讀取測試集數據,文件名為 'testdata-new.xlsx'
test = pd.read_excel('./data/data280993/testdata-new.xlsx')# 3 特征工程
# 3.1 test數據不包含 DC50 (nM) 和 Dmax (%),將train數據中的DC50 (nM) 和 Dmax (%)刪除
train = train.drop(['DC50 (nM)', 'Dmax (%)'], axis=1)# 3.2 將object類型的數據進行目標編碼處理
for col in train.columns[2:]:if train[col].dtype == object or test[col].dtype == object:train[col] = train[col].isnull()test[col] = test[col].isnull()# 4. 加載決策樹模型進行訓練
model = LGBMClassifier(verbosity=-1)
model.fit(train.iloc[:, 2:].values, train['Label'])
pred = model.predict(test.iloc[:, 1:].values, )# 5. 保存結果文件到本地
pd.DataFrame({'uuid': test['uuid'],'Label': pred}
).to_csv('submit.csv', index=None)
3.提交submit.csv
四、進階代碼
CatBoost學習
CatBoost是一個開源的梯度提升庫,由俄羅斯的搜索引擎公司Yandex開發。它專為處理分類和回歸任務而設計,尤其擅長處理具有大量類別特征(categorical features)的數據集。CatBoost的名稱來源于“Categorical Boosting”,即對類別特征進行增強的算法。
為了提升catboost的效果,嘗試了多種參數組合,以獲得最優的參數效果。
# 5. 定義模型并進行參數優化
param_grid = {'iterations': [100, 500],'depth': [6, 8],'learning_rate': [0.01, 0.05],
}model = CatBoostClassifier(loss_function='Logloss', verbose=0)
提交submit.csv
提高了不少。