当我尝试训练模型时,我对尝试使用 sklearn 运行线性回归的 python 真的很陌生:
regressIt.fit(X_train, Y_train)
它抛出以下异常:
ValueError: Found array with 0 sample(s) (shape=(0, 546)) while a minimum of 1 is required.
我究竟做错了什么?
提前致谢。
当我尝试训练模型时,我对尝试使用 sklearn 运行线性回归的 python 真的很陌生:
regressIt.fit(X_train, Y_train)
它抛出以下异常:
ValueError: Found array with 0 sample(s) (shape=(0, 546)) while a minimum of 1 is required.
我究竟做错了什么?
提前致谢。
好的,我想我明白了
X=np.array(X).reshape((-1,1)) Should be this instead of ((1,-1)) Not sure why yet? Y=np.array(Y).reshape((-1,1)) #Also this print(str(regr.predict(X_test)))