M.stock_ranker_train中的例子运行不通过啊


(realyfc) #1

在函数M.stock_ranker_train的示例中, 这里的代码

m5 = M.stock_ranker_train.v3(training_ds=m4.data, features=conf.features)

如果把v3改为v5为出现问题

KeyError: "['avg_amount_0/avg_amount_5' 'avg_amount_5/avg_amount_20'\n 'rank_avg_amount_0/rank_avg_amount_5'\n 'rank_avg_amount_5/rank_avg_amount_10' 'rank_return_0/rank_return_5'\n 'rank_return_5/rank_return_10'] not in index"

是不是我的使用或理解上有问题?


(达达) #2

v5的模块参数变了,参见可视化开发的代码模式

m6 = M.stock_ranker_train.v5(
    training_ds=m13.data,
    features=m3.data,
    learning_algorithm='排序',
    number_of_leaves=30,
    minimum_docs_per_leaf=1000,
    number_of_trees=20,
    learning_rate=0.1,
    max_bins=1023,
    feature_fraction=1,
    m_lazy_run=False
)