我有一个这样的熊猫数据框:
(index) 0 sie
0 1997-01-01 11.2
1 1997-01-03 12.3
2 1997-01-04 11.5
...
12454 2017-02-01 13.2
我想使用 SVM 来预测sie. 如何实现 python 代码来预测这些值?
我正在做这样的事情:
model = svm.SVR().fit(df[0],df['sie'])
但它给了我这个错误:
ValueError: Found input variables with inconsistent numbers of samples: [1, 12455]
虽然两者都df[0]具有df['sie']相同的形状(12455,)
注意:我没有连续数据(其中的某些日期丢失),其中的值0也是datetime.date()对象。