<div dir="ltr">Hello everyone<div><br></div><div>I have a question regarding MLPClassifier in sklearn. In the documentation in section <b>1.17. Neural network models (supervised) - 1.17.2 Classification</b><b> </b>it is stated that  "<font face="monospace"><span style="white-space:nowrap"><b>MLPClassifier</b></span></font><span style="color:rgb(29,31,34);font-family:Helvetica,Arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>supports multi-class classification by applying<span> </span></span><a class="m_-6205017368457118228gmail-reference m_-6205017368457118228external" href="https://en.wikipedia.org/wiki/Softmax_activation_function" style="color:rgb(40,120,162);text-decoration:none;word-wrap:break-word;font-family:Helvetica,Arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)" target="_blank">Softmax</a><span style="color:rgb(29,31,34);font-family:Helvetica,Arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> as the output function."</span></div><div><span style="color:rgb(29,31,34);font-family:Helvetica,Arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">However it is not clear how to apply the Softmax function.</span></div><div><span style="color:rgb(29,31,34);font-family:Helvetica,Arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(29,31,34);font-family:Helvetica,Arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The way I think (or hope) this works is that if a parameter </span><span style="color:rgb(29,31,34);font-family:Helvetica,Arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><b>activation </b></span><span style="color:rgb(29,31,34);font-family:Helvetica,Arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">is set to </span><span style="color:rgb(29,31,34);font-family:Helvetica,Arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><b>activation = 'logistic' </b>Softmax function should be automatically applied whenever there are more than two classes. Is this right or does one have to explicitly specify the use of Softmax function in some way?</span></div><div><span style="color:rgb(29,31,34);font-family:Helvetica,Arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><font color="#1d1f22" face="Helvetica, Arial, sans-serif">I am sorry if this is a nonsense question. I am new to scikit-learn and machine learning in general and I was not sure about this one. Thank you for any answers in advance.</font></div><div><font color="#1d1f22" face="Helvetica, Arial, sans-serif"><br></font></div><div><font color="#1d1f22" face="Helvetica, Arial, sans-serif">With regards,</font></div><div><font color="#1d1f22" face="Helvetica, Arial, sans-serif">D. B.</font></div></div>