Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- y_train2 = np.delete(y_train, np.where(y_train == [0]), axis=0)
- X_train2 = np.delete(X_train, np.where(y_train == [0]), axis=0)
- for i in range(len(y_train2)):
- y_train2[i] -= 1
- y_test2 = np.delete(y_test, np.where(y_test == [0]), axis=0)
- X_test2 = np.delete(X_test, np.where(y_test == [0]), axis=0)
- pr2 = Perceptron()
- pr2.fit(X_train2, y_train2)
- Y_train_predict=pr2.predict(X_train2)
- Y_test_predict=pr2.predict(X_test2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement