Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 395
Naveena Elamaran Avatar asked Oct 29 '25 05:10

Naveena Elamaran


1 Answers

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.

like image 78
user48956 Avatar answered Oct 30 '25 21:10

user48956