Skip to content

Instantly share code, notes, and snippets.

@gkhayes
Last active March 3, 2019 04:33
Show Gist options
  • Save gkhayes/89ee51b1c24f518990f9cf0971620b40 to your computer and use it in GitHub Desktop.
Save gkhayes/89ee51b1c24f518990f9cf0971620b40 to your computer and use it in GitHub Desktop.
Fit neural network to the Iris dataset
# Initialize neural network object and fit object
nn_model1 = mlrose.NeuralNetwork(hidden_nodes = [2], activation = 'relu',
algorithm = 'random_hill_climb', max_iters = 1000,
bias = True, is_classifier = True, learning_rate = 0.0001,
early_stopping = True, clip_max = 5, max_attempts = 100,
random_state = 3)
nn_model1.fit(X_train_scaled, y_train_hot)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment