blarredflunky
blarredflunky

Reputation: 43

sklean MLPClassifier: how to find relation/equation between output and input features

I am still in learning phase of sklearn and need some help in understanding how to come with a relation between output and input. Using data I was able to train sklearn MLPClassifier.

clf = MLPClassifier(solver='lbfgs', alpha=1e-5, hidden_layer_sizes = (7,), random_state = 1)
#Print Coef
print clf.coefs_.shape
print clf.coefs_

The output looks like this: Output print

Any help will be useful. Thanks!!

Upvotes: 2

Views: 1296

Answers (1)

seralouk
seralouk

Reputation: 33137

First of all, clf.coefs_ is a list with length n_layers - 1.

In your case, the length is 7-1 = 6.

The ith element in the list represents the weight matrix corresponding to layer i.

So if you type: clf.coefs_[0] this will return the weight matrix of the first layer.

More details here.


EDIT

The clf.coefs_ contains the weights that you need. Make sure that you understand how MLP works (see HERE ! )

A MLP looks like this:


enter image description here


Upvotes: 1

Related Questions