如何在python中减少模型中的“噪音”?

2024-04-27 22:18:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我希望减少股票预测模型的波动性。这样做的目的是能够专注于趋势而不是精确的猜测

Example Output Here

from matplotlib import pyplot as plt
plt.figure()
plt.plot(y_pred_org)     # real price over time
plt.plot(y_test_t_org)   # predicted price over time
plt.title('Prediction vs Real Stock Price')
plt.ylabel('Price')
plt.xlabel('Days')
plt.legend(['Prediction', 'Real'], loc='upper left')
plt.show()

Tags: org模型目的timeplotexamplepltreal
2条回答

您有多种选择:

使用standardscaler或minmaxscaler规范化数据。此外,如果有nan值,请使用插值平滑数据。研究预处理你的数据。如果你需要帮助,请告诉我

请参见(https://github.com/dnishimoto/python-deep-learning/blob/master/College%20Graduate%20Admission%20SVC.ipynb)我使用scaler规范化管道中的数据

相关问题 更多 >