我将databunch定义为:
data = (TabularList.from_df(train_df, path='./', cont_names=cont_names, procs=procs)
.split_by_idx(list(range(500,3000)))
.label_from_df(cols=dep_var)
.add_test(test, label=0)
.databunch())
培训后,我已经变得......
p = learn3.get_preds()
len(p[1])
输出值为2500,这是正确的
.split_by_idx(list(range(500,3000)))
这是2500个数字
for index in range(len(test_df)):
predictions = learn3.predict(test_df.iloc[index])
predictions = predictions[1].tolist()
print(index)
这将需要大量的时间。我希望通过 test_df 并获得与预测一样的结果。
p = learn3.get_preds()
我该怎么做?
.split_by_idx(list(range(500,3000)))
我们有办法替换它并从其他文件传递数据吗?