Naveena Elamaran
Naveena Elamaran

Reputation: 43

Weights given by MLPClassifier in sklearn.neural_network (Python)

I am currently working on the MLPClassifier of the neural_network package in sklearn.

I have fit the model; I want to access the weights given by the classifier to the input features. How do I access them?

Thanks in advance!

Upvotes: 4

Views: 9601

Answers (1)

user48956
user48956

Reputation: 15788

Check out the documentation. See the field coefs_.

Try:

print model.coefs_

Generally, I recommend:

  • checking the documentation
  • if that fails, then

    print dir(model)
    

    or

    help(model)
    

    will tell you what's available for in most cases.

Upvotes: 10

Related Questions