Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Listing 15
- x5=np.arange(1,101)
- y5=np.zeros(100)
- y5[1:100:2]= 1
- x5 = x5.reshape(-1, 1)
- clf = linear_model.LogisticRegression(C=1e5, solver='lbfgs')
- clf.fit(x5, y5)
- x_test = np.linspace(0, 100, 500).reshape(-1,1)
- probs = clf.predict_proba(x_test)
- prob=probs[:,1]
- plt.scatter(x5, y5, color='black', zorder=20)
- plt.plot(x_test, prob, color='red', linewidth=5)
- plt.xlabel("x" , fontsize=14)
- plt.ylabel("p" , fontsize=14)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement