[scikit-learn] Porting old MLPY KRR model to scikit-learn

Michael Eickenberg michael.eickenberg at gmail.com
Thu Sep 19 15:51:23 EDT 2019


What exactly do you mean by "port"? Put already fitted models into a
sklearn estimator object? You can do this as follows:

You should be able to create a `estimator =
sklearn.kernel_ridge.KernelRidge(...)` object, call `fit` to some random
data of the appropriate shape, and then set `estimator.dual_coef_` to the
ones from your MLPY model (the sklearn version sets them here:
https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/kernel_ridge.py#L165
).


If this is not what you mean, then maybe you just want to refit them using
the appropriate KernelRidge kernel?

Hope this helps!

Michael



On Thu, Sep 19, 2019 at 12:43 PM Chapman, James E <jchapman48 at gatech.edu>
wrote:

> Hello,
>
> I have some old KRR models from MLPY and I need to port those models over
> to a new code written with scikit-learn (transfer MLPY KRR data to a
> scikit-learn KernelRidge instance). Does anyone know if this is even
> possible, and if so, could you give me some suggestions as to how to
> accomplish it?
>
>
>
> Thanks and regards,
>
> James
> _______________________________________________
> 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/20190919/2cb4a494/attachment.html>


More information about the scikit-learn mailing list