AttributeError:未知属性颜色:Python

我正在使用下面的代码来可视化我的算法。但我遇到以下错误的问题。

AttributeError:属性颜色未知

from matplotlib import pyplot as plt 
regression = LinearRegression()
model = regression.fit(X_train,Y_train)
preds = model.predict(X_test)

plt.scatter(X_train,Y_train, colour = 'red')
plt.plot(X_train, preds, colour = 'blue')
plt.title('salary vs experiance')
plt.xlabel("years")
plt.ylabel("salary")
plt.show()
文卡塔恰兰

你应该给它color而不是colour

plt.scatter(X_train,Y_train, color = 'red')

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章