rice_run.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Black-Swan 作者: 12190143 项目源码 文件源码
def rf(train_sample, validation_sample, features, seed):
    log_base = np.e
    rf_est = RandomForestRegressor(n_estimators=500,
                                   criterion='mse',
                                   max_features=4,
                                   max_depth=None,
                                   bootstrap=True,
                                   min_samples_split=4,
                                   min_samples_leaf=1,
                                   min_weight_fraction_leaf=0,
                                   max_leaf_nodes=None,
                                   random_state=seed
                                   ).fit(
        train_sample[features], np.log1p(train_sample['volume']) / np.log(log_base))
    rf_prob = np.power(log_base, rf_est.predict(validation_sample[features])) - 1
    print_mape(validation_sample['volume'], rf_prob, 'RF')
    return rf_prob
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号