Comments (7)
Hi @oliver-contier : thanks for reporting. I will investigate, but it might take a little bit of time, because I have some deadlines coming up in the next couple of weeks.
Question, because I am not sure that I understand the use-case: Why would you use ridge regression with only one regressor? Are you sure that X and Y are in the right order here? I'm only asking because the shapes look the opposite of what I'd usually expect.
This should work, or at least provide a useful error.
from fracridge.
Hi @arokem,
No hurry, I switched to fracridge.fracridge
for now and it seems to work fine. I was using the FracRidgeRegressor
object for convenience; I also used its .predict()
and .score()
methods.
From the documentation and a glance at the code, I gather that the shape of x should be (nsamples, nregressors) and shape of y should be (nsamples, ntargets). And the .fit()
method should take .fit(x, y)
in that order. So I think the shapes/order should be correct, unless I'm misinterpreting something.
My use-case of only one regressor is only for comparison with a full-fletched model. If this is not how fracridge is supposed to be used, then I guess the issue can be ignored :) Though maybe a different Error/Warning could be provided.
from fracridge.
@arokem - it would be nice if the code would run for this (degenerate) case.
Statistically, ridge regularization for the case of one regressor is simply going to scale down the estimated weight for that regressor. This is still meaningful in the sense that the regularization may in fact improve generalization performance (i.e. reduce overfitting).
from fracridge.
Yep! That makes sense. I'll fix it up ASAP.
from fracridge.
Maybe to motivate my usecase a bit: I'm predicting fmri voxel time series with a parametric modulation model.
Hence the model has one general onset regressor that models the average response to all events, and then there's a bunch of parametric modulators that explain variation around that average response. As a basic sanity check, I wanted to compare the full model's generalization performance to that of a reduced model which has only the average response regressor. In order to have a "fair" comparison, I'm optimizing the regularization parameter for the reduced model as well.
I see how this is may be an edge case and potentially out of the scope of the fracridge package. So if the abovementioned behavior is intended, I understand!
I raised the issue more out of technical confusion, because I ran into the error when using FracRidgeRegressor
(and not when using fracridge.fracridge
). I think whether users should be discouraged or prevented from using (fractional) ridge regression with only one regressor in the first place might be a different discussion.
Anyway, thanks for both of your comments and creating/maintaining this tremendously useful tool.
from fracridge.
I think that this is closed through #25, but let me know if the problem still persists.
from fracridge.
Sorry for the delayed response. I gave it a try and it works like a charm. Thanks for digging into this, Cheers!
from fracridge.
Related Issues (17)
- Documentation example needs a little bit more ... documentation HOT 2
- Add a `jit` kwarg HOT 1
- interp requires sorted inputs
- potential speed gains with 'f' order for BLAS HOT 9
- better documentation HOT 1
- docs v1.3 have typo for python installation HOT 1
- _do_svd with many targets (>280) fails with ValueError: operands could not be broadcast together with shapes ... HOT 3
- *** ValueError: operands could not be broadcast together with shapes (2888,) (216,) HOT 3
- optimization in python
- python 3.9 incompatibility HOT 8
- missing imports and string error HOT 1
- Broken link HOT 1
- scikit-learn version HOT 2
- Efficient leave-one-out cross-validation? HOT 15
- np.squeeze of the regression coefficients breaks glmsingle HOT 5
- How to reverse the predicted values back to the original scale? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fracridge.