I'm wondering if there is a non-linear regression routine with scikit-learn which allows for incremental learning, ie though the partial_fit call. I see that SGDRegressor and PassiveAggressiveRegressor both allow partial_fit, but are linear, and my data is decidedly non-linear so fits are nowhere close.
-
I think the answer is no. One way you could get around this is by transforming your features into nonlinear features and then running a linear partial fit on those. If this doesn't work, you can always use a library like tensorflow or pytorch to do a partial fit.bar9833625– bar98336252024-10-07 21:25:52 +00:00Commented Oct 7, 2024 at 21:25
1 Answer
The MLPRegressor class is capable of modeling non-linear relationships using a multi-layer perceptron. It supports partial_fit(). Note that partial_fit() only works if solver is not set to 'lbfgs.'
Based on a search through the docs, I could not find any other examples that fulfill all of 1) being a regressor, 2) having support for partial_fit(), and 3) being nonlinear.
Alternatively, you might consider kernel methods. For example, you could pick a subset of your data, perform RBF between that subset and all other points, and you would be able to model non-linear relationships using a linear regressor on the transformed RBF space. The RBF kernel would not learn incrementally, but the linear component would. This would give you more options, such as SGDRegressor or PassiveAgressiveRegressor.