这就是问题所在: 它需要 2 个变量输入,并预测一个结果。
例如:作为输入和购买/出售的price
决定。volume
result
我尝试使用K-Neighbors
没有成功实现这个。你会怎么做?
X = cleanedData['ES1 End Price'] #only accounts for 1 variable, don't know how to use input another.
y = cleanedData["Result"]
print(X.shape, y.shape)
kmm = KNeighborsClassifier(n_neighbors = 5)
kmm.fit(X,y) #ValueError for size inconsistency, but both are same size.
谢谢!