Neural Networks X Logistic Regression: Order important?

Hello,

On the following mission:
https://app.dataquest.io/m/243/hidden-layers/4/training-a-neural-network-using-scikit-learn

we have a warning “Make and assign predictions (for answer checking purposes the order should be respected)”
Why is the order I define the models important - should they not be independent? (I’m note re-using any variables)

If I define the NN and THEN the LR, I have following results (CORRECT)
log_accuracy = 0.88
nn_accuracy= 0.48

However, if I alter the order I get:
log_accuracy = 0.88
nn_accuracy= 0.52

Can anyone explain me why this happens?

Thank you very much
Regards
Daniel Burnier

1 Like

It is important for answer checking purposes; that’s it. Why we at Dataquest require this for answer checking, that’s a different matter and I answer it below.

It’s a bug in Scikit-learn. See this post for more details.