Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. # Listing 7
  2. def logistic_predict(p):
  3. prediction = p.copy()
  4. prediction[p < 0.5] = 0
  5. prediction[p >= 0.5] = 1
  6. return prediction
  7.  
  8. skl_prediction = clf.predict(x2_test)
  9.  
  10. sigmuid_prediction = logistic_predict(sigmuid_prob)
  11. sigmuid_prediction = sigmuid_prediction.ravel()
  12.  
  13. # Are sigmuid_prediction and skl_prediction arrays equal?
  14. np.array_equal(sigmuid_prediction, skl_prediction)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement