Ridge regression without the intercept

5 views (last 30 days)
Hung
Hung on 9 Mar 2020
Edited: Hung on 9 Mar 2020
I'm trying to fit a redge regression model to the training set data for predicting the data in the test set. I know that in the ridge function, there is a scaling flag (scaled) to determine whether the predictors are scaled and whether an intercept is fitted. However, what I want is a model that does not contain an intercept, and I don't want to scale the predicting variables in the trianing set. If I set scaled=0, the regression does not scale the predicting variables, but the model includes an intercept. However, if I set scaled=1, the model does not include an intercept but it scales the predicting variables.
Is there a way that I can fit the ridge regression without the intercept and without scaling the variables?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!