def getDataSet(self, max_value_threshold = 1000, train_length_threshold = 30):
try:
return self.data_set
except:
self.__gen_data_set(max_value_threshold = max_value_threshold,
train_length_threshold = train_length_threshold)
return self.data_set
# def __gen_model(self, model = LinearRegression()):
# X_train, y_train, _ = self.getDataSet(10000, 60)
# model.fit(X_train, y_train)
# if self.ifPlotTrain:
# y_pred = model.predict(X_train)
# df = pd.DataFrame(np.hstack((y_train.reshape(-1,1), y_pred.reshape(-1,1))))
# df.columns = ['Train', 'Predict']
# df[:60].plot()
# plt.title('train_all')
# fig = plt.gcf()
# fig.savefig('./img/train_all.png')
# plt.close(fig)
# self.model = model
评论列表
文章目录