汇率预测模型

时间:2019-06-01 10:56:02

标签: python-3.x scikit-learn prediction decision-tree

我训练了以下模型来预测提供的月份中的汇率,但是它似乎只能根据汇率而不是月份预测汇率。

x = ['jan','feb','march','april','may']
y = [[30],[40],[50],[60],[70]]

from sklearn.tree import DecisionTreeClassifier
from sklearn import tree
from sklearn.model_selection import train_test_split

x_train,x_test,y_train,y_test = train_test_split(x,y,test_size=0.15)
c = DecisionTreeClassifier()
c.fit(y_train,x_train)
prediction = c.predict([[99]])
print(prediction)

如何更改代码以预测一个月的汇率?

0 个答案:

没有答案