[scikit-learn] custom loss function

Thomas Evangelidis tevang3 at gmail.com
Wed Sep 13 17:31:04 EDT 2017


What about the SVM? I use an SVR at the end to combine multiple
MLPRegressor predictions using the rbf kernel (linear kernel is not good
for this problem). Can I also implement an SVR with rbf kernel in
Tensorflow using my own loss function? So far I found an example of an SVC
with linear kernel in Tensorflow and nothing in Keras. My alternative
option would be to train multiple SVRs and find through cross validation
the one that minimizes my custom loss function, but as I said in a previous
message, that would be a suboptimal solution because in scikit-learn the
SVR minimizes the default loss function.

Dne 13. 9. 2017 20:48 napsal uživatel "Andreas Mueller" <t3kcit at gmail.com>:

>
>
> On 09/13/2017 01:18 PM, Thomas Evangelidis wrote:
>
> ​​
> Thanks again for the clarifications Sebastian!
>
> Keras has a Scikit-learn API with the KeraRegressor which implements the
> Scikit-Learn MLPRegressor interface:
>
> https://keras.io/scikit-learn-api/
>
> Is it possible to change the loss function in KerasRegressor? I don't have
> time right now to experiment with hyperparameters of new ANN architectures.
> I am in urgent need to reproduce in Keras the results obtained with
> MLPRegressor and the set of hyperparameters that I have optimized for my
> problem and later change the loss function.
>
> I think using keras is probably the way to go for you.
>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20170913/516a2725/attachment.html>


More information about the scikit-learn mailing list