243-x Hidden layers mission


This step requires building a logistic regression model, and a single neuron hidden layer neural network on some training data. For some reason the predictions for the neural network change depending on whether it is run before the logistic regression, or after it. Is there any reason for this?

lr = LogisticRegression()
lr.fit(train_features, train_labels)
log_predictions = lr.predict(test_features)

mlp = MLPClassifier(hidden_layer_sizes=(1,), activation='logistic')
mlp.fit(train_features, train_labels)
nn_predictions = mlp.predict(test_features)

I also notice on screen 6, that using different variable names to the solution gives different results. This indicates these may be platform issues?


Hey, shreegovind.

Regarding the order, I believe this is a scikit-learn bug and I’ve opened an issue in the relevant repository. Feel free to track it here.

About screen 6, it’s hard tell what is going on without more detail. Do note, however, that in the instructions we ask for specific variable names. If you change those, you’re not following the instructions. Feel free to add more detail if this isn’t helpful enough.