You can indeed derive from BaseEstimator and implement fit, predict
and optionally score.

Here is the documentation for the expected estimator API:

http://scikit-learn.org/stable/developers/contributing.html#apis-of-scikit-learn-objects

As this is a linear regression model, you can also want to have a look
at the LinearModel and RegressionMixin base classes for inspiration:

https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/linear_model/base.py#L401

Note that the score function should always be "higher is better". The
explained variance ratio and negative mean squared error are valid
scoring functions for model selection in scikit-learn while raw MSE is
not not.

-- 
Olivier
_______________________________________________
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn

Reply via email to