Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Listing 7
- def logistic_predict(p):
- prediction = p.copy()
- prediction[p < 0.5] = 0
- prediction[p >= 0.5] = 1
- return prediction
- skl_prediction = clf.predict(x2_test)
- sigmuid_prediction = logistic_predict(sigmuid_prob)
- sigmuid_prediction = sigmuid_prediction.ravel()
- # Are sigmuid_prediction and skl_prediction arrays equal?
- np.array_equal(sigmuid_prediction, skl_prediction)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement