Complete the code to import the neural network model from scikit-learn.
from sklearn.neural_network import [1]
The MLPClassifier is the simple neural network model in scikit-learn used for classification tasks.
Complete the code to create a neural network model with one hidden layer of 5 neurons.
model = MLPClassifier(hidden_layer_sizes=([1],), max_iter=1000)
The hidden_layer_sizes parameter expects a tuple. A single number like 5 means one hidden layer with 5 neurons.
Fix the error in the code to train the model on data X_train and y_train.
model.[1](X_train, y_train)The fit method trains the model on the given data.
Fill both blanks to predict labels for X_test and calculate accuracy score.
predictions = model.[1](X_test) accuracy = [2](y_test, predictions)
Use predict to get predictions and accuracy_score to measure accuracy.
Fill all three blanks to import accuracy_score, create the model, and train it.
from sklearn.metrics import [1] model = MLPClassifier(hidden_layer_sizes=([2],), max_iter=1000) model.[3](X_train, y_train)
Import accuracy_score, set hidden layer size to 5, and train the model with fit.