Repository navigation
Conversation
|
It would be great if you update your PR to master. Is there anything more you wish to do before making it ready for review? |
|
closing due to inactivity. |
|
@adrinjalali Sorry, I just saw @haiatn message this morning asking me to update to master. I've just done that and happy to engage with the reviewers. |
|
@agramfort do you think this should still be included? |
❌ Linting issuesThis PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling You can see the details of the linting issues under the
|
|
no strong feeling but looking at the diff there is quiet some work to be done here. To me this method is referred to as KernelRegression https://en.wikipedia.org/wiki/Kernel_regression |
|
@agramfort Thanks for your feedback.
|
|
also tagging @lorentzenchr since I think he'd also know more about these methods. |
|
I also know it by Nadaraya-Watson. I think it is out of scope for 2 reasons:
|
|
I also know it by Nadaraya-Watson, cf. wikipedia
<https://en.m.wikipedia.org/wiki/Kernel_regression>. I think it is out of
scope for 2 reasons:
1. It needs to save the whole training X as it is used at prediction
time.
we have the same issue with KNN so for this I would say there is a
precedent.
1. Its use case is more for interpolation with uncertainty estimates.
IMHO, that fits better in statsmodels or scipy.
technically the estimator does not enforce that the regression function
passes exactly on the training data
so it's not fully interpolation although it's likely used for this.
honestly I have a mixed feeling here.
@niknow can you help us make a case here? Why this and not using let's say
a Gaussian Process regressor or a kernel ridge?
… Message ID: ***@***.***>
|
|
@agramfort I'll try my best. ;-) I understand you want to make a determination on whether or not local regression is in scope of scikit, but I'm not sure I fully understand the criterions. Maybe it helps to clarify a few points mentioned so far:
My case (usability): The scope of scikit (admittedly my subjective perception of it) is that it provides reference implementations of standard techniques in predictive modelling in a common interface. Whenever you are faced with a concrete problem and you want to give a practical answer to your very question, i.e. "which model should I choose" (linear regression, local regression, Gaussain regression etc.), a pragmatic strategy is to simply try it out. Having a common interface in form of this instantiate-fit-predict pattern is incredibly convenient for the user and makes it easy to do that with consistent clean code. From a user perspective it is much more important to have this common interface than what computation or memory operations go on under the hood during the Local regression is one of the few standard techniques that is not available in scikit. In particular the special case of Nadaraya-Watson is relevant to many areas of modelling though, for example in the financial domain. Having that available in the same instatiate-fit-predict interface than all the other models in scikit will make it a lot simpler for many end users to try this technique. This is by the way the origin story of this code: While writing this paper we benefitted a lot from the convenience of having every other standard technique easily available in scikit - just local regression was missing. Thus, I wrote it myself, found it very convenient to use in the scikit interface, and hence would I'd be happy to give this back to the community for others to benefit from it as well. |
|
@niknow thanks for the detailed answer. Regarding inclusion criterions you can read https://scikit-learn.org/stable/faq.html#what-are-the-inclusion-criteria-for-new-algorithms At this point I would suggest to put this code in gist at http://gist.github.com so people can easily reuse your work which I think should be the first objective. We have now many "tricks" to get non-linear regression models (Kernel Ridge, GaussianProcessed, PolynomialFeatures, pipeline of Spline or KBinsDiscretizer with Ridge etc.). To me, the case that you would need to be make would be to show at least on one convincing example (on real data) that this new estimator is better in some way (compute time, prediction accuracy, reduced variance, easy model selection etc.) my 2c |
|
@agramfort The example in the notebook referenced above that compares local regression against Could you clarify one thing for me though: According to #3075 it is regarded as an issue that this method is missing. Yet, you sound like that it is more of an issue if it were not missing. This cannot both be true. What do you suggest is needed to close this issue? |
|
@niknow Having the plots rendered and an out-of-sample score would be nice (we don’t care too much about training loss/score). |
|
@niknow Thanks for this PR. On top, this PR puts the heavy computation (what is the complexity in n_sampels and n_features?) in |
Reference Issues/PRs
Fixes #3075
What does this implement/fix? Explain your changes.
The above issue is that local regression is missing in scikit-learn. This PR addresses this issue by adding an implementation of local regression and expanding the test suite to cover this.
Any other comments?