数据展示:
结果展示:
from pandas import read_csv
from pandas import datetime
from sklearn.metrics import mean_squared_error
from math import sqrt
from matplotlib import pyplot
"""https://blog.csdn.net/iyangdi/article/details/77853055
这个算法并没有什么用,只是求了两个数组之间的标准差
我们强行粗犷的把test数组中第n-1个元素变成了预测数组predictions中的第n个元素,作为测试结果来使用
最后计算了了test数组和predictions数组之间的标准差,当做预测效果的评估
所以第一节毫无意义"""
# 加载数据
def parser(x):
return datetime.strptime(x, '%Y/%m/%d')
series = read_csv('data_set/shampoo-sales.csv', header=0, parse_dates&