def do_run(self, train, predict, window):
LabelColumnName = 'label'
data_file = "data_file_xgboost_" + str(window) + ".pkl"
if os.path.exists(data_file):
input = open(data_file, 'rb')
data_feature = pickle.load(input)
input.close()
else:
data_feature = get_all_stocks_feature_data(self.paras, window, LabelColumnName)
output = open(data_file, 'wb')
pickle.dump(data_feature, output)
output.close()
model = None
train_feature = {}
if train: model = self.train_data(data_feature, window, LabelColumnName)
if predict: self.predict_data(model, data_feature, window, LabelColumnName)
Stock_Prediction_Model_XgBoost.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录