【发布时间】:2020-08-26 01:02:48
【问题描述】:
from sklearn.linear_model import LinearRegression
my_y = np.array([2, 5, 6, 10]).reshape(1, -1)
my_x = np.array([19, 23, 22, 30]).reshape(1,-1)
lm = LinearRegression()
lm = lm.fit(my_x, my_y)
result = lm.score(my_x, my_y)
print(result)
Why does this give Nan as output
【问题讨论】:
标签: python pandas machine-learning scikit-learn linear-regression