ML之xgboost:基于xgboost(5f-CrVa)算法对HiggsBoson数据集(Kaggle竞赛)训练实现二分类预测(基于训练好的模型进行新数据预测)
生活随笔
收集整理的這篇文章主要介紹了
ML之xgboost:基于xgboost(5f-CrVa)算法对HiggsBoson数据集(Kaggle竞赛)训练实现二分类预测(基于训练好的模型进行新数据预测)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
ML之xgboost:基于xgboost(5f-CrVa)算法對HiggsBoson數據集(Kaggle競賽)訓練實現二分類預測(基于訓練好的模型進行新數據預測)
?
?
目錄
輸出結果
設計思路
核心代碼
?
?
?
輸出結果
更新中……
相關文章
ML之xgboost:基于xgboost(5f-CrVa)算法對HiggsBoson數據集(Kaggle競賽)訓練(模型保存+可視化)實現二分類預測
Dataset之HiggsBoson:Higgs Boson(Kaggle競賽)數據集的簡介、下載、案例應用之詳細攻略
?
?
設計思路
更新中……
?
?
核心代碼
更新中……
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()?
?
?
?
?
?
總結
以上是生活随笔為你收集整理的ML之xgboost:基于xgboost(5f-CrVa)算法对HiggsBoson数据集(Kaggle竞赛)训练实现二分类预测(基于训练好的模型进行新数据预测)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ML之xgboost:基于xgboost
- 下一篇: 成功解决TypeError: unsup