Linked Questions

18
votes
1answer
15k views

Are categorical variables standardized differently in penalized regression? [duplicate]

In penalized/regularized regression (lasso, ridge, etc.) the predictors are typically standardized to be centered at 0 and often to have variance 1. Are categorical predictors treated differently. If ...
1
vote
0answers
409 views

Standardize binary variables in cluster analysis? [duplicate]

I'm performing a cluster analysis on a health insurance dataset containing 4,343 observations with mixed continuous and binary variables. I understand the importance of standardizing continuous ...
27
votes
3answers
17k views

Feature importance with dummy variables

I am trying to understand how I can get the feature importance of a categorical variable that has been broken down into dummy variables. I am using scikit-learn which doesn't handle categorical ...
5
votes
3answers
10k views

What to do with categorical data when calculating standardized z-scores?

I have numerous environmental variables I'd like to correlate to some tree species data. The environmental variables vary greatly in scale, so I'd like to standardize each by calculating standard z-...
4
votes
1answer
6k views

Scaling categorical data in regression

It seems odd to scale a categorical variable, but I need to get the correct coefficients for each of my variables in linear regression. Is it correct to scale the same way you would with continuous ...
1
vote
1answer
1k views

Do I need to rescale dummy variables for PCA?

I am wondering if for a PCA for which I rescale my numeric variables, I need to rescale my dummy variables as well ? I have read on the internet that I should not but I do not see why. I guess the ...
6
votes
0answers
760 views

In penalized regression models, should binary predictors be standardized?

It is generally agreed that in penalized regression models, such as ridge regression, the lasso, and the elastic net, one should standardize the predictors (such as dividing each by its SD) so that ...
0
votes
1answer
463 views

Should I standardize mixed variables before lasso or pca?

I have a large data of both binary, categorical and continuous variables. I would like to do the lasso to select the variables for regression. Besides, i also want to do pca to reduce the dimension. ...
1
vote
0answers
73 views

Should categorical data be normalised in linear regression? [closed]

I have data similar to the following: [ [0, 4, 15] [0, 3, 7] [1, 5, 9] [2, 4, 15] ] I used One Hot Encoder to preprocess this data so it is suitable ...
0
votes
1answer
48 views

How to choose the correct dataset transformation

I'm doing a project using the California Housing Price dataset from Kaggle. The objectetive of the project is to implement from scratch the Ridge Regression algorithm, apply it the to the prediction ...