當(dāng)前位置:
首頁(yè) >
ML之xgboost:基于xgboost(5f-CrVa)算法对HiggsBoson数据集(Kaggle竞赛)训练实现二分类预测(基于训练好的模型进行新数据预测)
發(fā)布時(shí)間:2025/3/21
34
豆豆
生活随笔
收集整理的這篇文章主要介紹了
ML之xgboost:基于xgboost(5f-CrVa)算法对HiggsBoson数据集(Kaggle竞赛)训练实现二分类预测(基于训练好的模型进行新数据预测)
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
ML之xgboost:基于xgboost(5f-CrVa)算法對(duì)HiggsBoson數(shù)據(jù)集(Kaggle競(jìng)賽)訓(xùn)練實(shí)現(xiàn)二分類預(yù)測(cè)(基于訓(xùn)練好的模型進(jìn)行新數(shù)據(jù)預(yù)測(cè))
?
?
目錄
輸出結(jié)果
設(shè)計(jì)思路
核心代碼
?
?
?
輸出結(jié)果
更新中……
相關(guān)文章
ML之xgboost:基于xgboost(5f-CrVa)算法對(duì)HiggsBoson數(shù)據(jù)集(Kaggle競(jìng)賽)訓(xùn)練(模型保存+可視化)實(shí)現(xiàn)二分類預(yù)測(cè)
Dataset之HiggsBoson:Higgs Boson(Kaggle競(jìng)賽)數(shù)據(jù)集的簡(jiǎn)介、下載、案例應(yīng)用之詳細(xì)攻略
?
?
設(shè)計(jì)思路
更新中……
?
?
核心代碼
更新中……
xgmat = xgb.DMatrix( data, missing = -999.0 ) bst = xgb.Booster({'nthread':8}, model_file = modelfile)res = [ ( int(idx[i]), ypred[i] ) for i in range(len(ypred)) ] rorder = {} for k, v in sorted( res, key = lambda x:-x[1] ): rorder[ k ] = len(rorder) + 1# write out predictions ntop = int( threshold_ratio * len(rorder ) ) fo = open(outfile, 'w') nhit = 0 ntot = 0 fo.write('EventId,RankOrder,Class\n') for k, v in res: if rorder[k] <= ntop:lb = 's'nhit += 1else:lb = 'b'# change output rank order to follow Kaggle conventionfo.write('%s,%d,%s\n' % ( k, len(rorder)+1-rorder[k], lb ) )ntot += 1 fo.close()?
?
?
?
?
?
總結(jié)
以上是生活随笔為你收集整理的ML之xgboost:基于xgboost(5f-CrVa)算法对HiggsBoson数据集(Kaggle竞赛)训练实现二分类预测(基于训练好的模型进行新数据预测)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ML之xgboost:基于xgboost
- 下一篇: 成功解决TypeError: unsup