[scikit-learn] MLPClassifier as a feature selector

Manoj Kumar manojkumarsivaraj334 at gmail.com
Wed Dec 6 22:25:41 EST 2017


Hi,

The weights and intercepts are available in the coefs_ and intercepts_
attribute respectively.

See
https://github.com/scikit-learn/scikit-learn/blob/a24c8b46/sklearn/neural_network/multilayer_perceptron.py#L835

On Wed, Dec 6, 2017 at 4:56 PM, Brown J.B. via scikit-learn <
scikit-learn at python.org> wrote:

> I am also very interested in knowing if there is a sklearn cookbook
> solution for getting the weights of a one-hidde-layer MLPClassifier.
> J.B.
>
> 2017-12-07 8:49 GMT+09:00 Thomas Evangelidis <tevang3 at gmail.com>:
>
>> Greetings,
>>
>> I want to train a MLPClassifier with one hidden layer and use it as a
>> feature selector for an MLPRegressor.
>> Is it possible to get the values of the neurons from the last hidden
>> layer of the MLPClassifier to pass them as input to the MLPRegressor?
>>
>> If it is not possible with scikit-learn, is anyone aware of any
>> scikit-compatible NN library that offers this functionality? For example
>> this one:
>>
>> http://scikit-neuralnetwork.readthedocs.io/en/latest/index.html
>>
>> I wouldn't like to do this in Tensorflow because the MLP there is much
>> slower than scikit-learn's implementation.
>>
>>
>> Thomas
>>
>>
>> --
>>
>> ======================================================================
>>
>> Dr Thomas Evangelidis
>>
>> Post-doctoral Researcher
>> CEITEC - Central European Institute of Technology
>> Masaryk University
>> Kamenice 5/A35/2S049,
>> 62500 Brno, Czech Republic
>>
>> email: tevang at pharm.uoa.gr
>>
>>           tevang3 at gmail.com
>>
>>
>> website: https://sites.google.com/site/thomasevangelidishomepage/
>>
>>
>> _______________________________________________
>> scikit-learn mailing list
>> scikit-learn at python.org
>> https://mail.python.org/mailman/listinfo/scikit-learn
>>
>>
>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
>


-- 
Manoj,
http://github.com/MechCoder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20171206/17603586/attachment.html>


More information about the scikit-learn mailing list