Advertisement
ProgNeo

Untitled

Sep 20th, 2022 (edited)
945
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. y_train2 = np.delete(y_train, np.where(y_train == [0]), axis=0)
  2. X_train2 = np.delete(X_train, np.where(y_train == [0]), axis=0)
  3.  
  4. for i in range(len(y_train2)):
  5.     y_train2[i] -= 1
  6.  
  7. y_test2 = np.delete(y_test, np.where(y_test == [0]), axis=0)
  8. X_test2 = np.delete(X_test, np.where(y_test == [0]), axis=0)
  9.  
  10.  
  11. pr2 = Perceptron()
  12. pr2.fit(X_train2, y_train2)
  13. Y_train_predict=pr2.predict(X_train2)
  14. Y_test_predict=pr2.predict(X_test2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement