您当前的位置: 首页 >  回归
  • 0浏览

    0关注

    2393博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

EL之RF(RFR):利用RandomForestRegressor对回归问题(实数值评分预测)建模(调2参)

一个处女座的程序猿 发布时间:2019-01-08 20:16:11 ,浏览量:0

EL之RF(RFR):利用RandomForestRegressor对回归问题(实数值评分预测)建模(调2参)

 

目录

输出结果

设计思路

核心代码

 

 

 

输出结果

 

设计思路

 

核心代码
mseOos = []
nTreeList = range(100, 1000, 100)    #----▲☆▲☆▲
for iTrees in nTreeList:
#     depth = None
#     depth=6      #----▲▲▲▲▲
    depth=10     #----☆☆☆☆
    
    maxFeat  = 4 #try tweaking

    wineRFModel = ensemble.RandomForestRegressor(n_estimators=iTrees, max_depth=depth, max_features=maxFeat,
                                                 oob_score=False, random_state=531)
    
    wineRFModel.fit(xTrain,yTrain)
    prediction = wineRFModel.predict(xTest)
    mseOos.append(mean_squared_error(yTest, prediction))

 

 

 

关注
打赏
1664196048
查看更多评论
立即登录/注册

微信扫码登录

0.1537s