绘制没有Seaborn的logistic回归曲线

时间:2020-10-05 12:45:46

标签: python logistic-regression curve sigmoid

我试图在没有seaborn的帮助下将逻辑回归曲线拟合到数据上。我尝试了以下代码,但是输出有很多曲线(如下图)。如何绘制曲线?

代码

plt.scatter(x, y)
plt.plot(x,log_reg.predict_proba(x)[:,1],color='red',label='reg line')
plt.show()

输出

current output expected output

0 个答案:

没有答案