0

I am implementing MLPClassifier to try a neural network now, but I am not sure if I can put multiple classes as an output. Here is my output, as follows:

y = array([1, 1, 2, 2, 1, 1, 2, 2, 2, 3, 3, 1, 1, 1], dtype=int64)

What I am trying to do is that I create multiple classes (1,2,3) and want to check if I can predict by using a neural network.

I am not sure if I am on the right path.

Can I only put a single binary output, such [0,1] or can I put multiple outputs that neural network can predict?

X_train, X_test, y_train, y_test = train_test_split(X, y,test_size=0.70, random_state=0)
mlp = MLPClassifier(solver='lbfgs',random_state=0, hidden_layer_sizes[1],alpha=0.001,max_iter=100)
mlp.fit(X_train, y_train)
y_pred=mlp.predict(X_test)

1 Answer 1

0

Why don't you try printing out y_pred to show if the classifier is performing a multi-class classification or binary classification? I think it will perform a multi-class classification.

Sign up to request clarification or add additional context in comments.

1 Comment

y_pred array([1, 2, 1, 1, 2, 1, 1, 1, 2, 1], dtype=int64) It does predict! but I am not sure if it is a right way to do it...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.