# Questions tagged [feature-scaling]

The tag has no usage guidance.

148 questions
Filter by
Sorted by
Tagged with
38 views

### Dealing with 0's in loglog regression by using indicator functions I(x > 0)?

Assume we want to estimate the following model $y = e^{\beta_0} * x_1^{\beta_1} * x_2{\beta_3}$ which we can linearize into $\log(y) = \beta_0 + \beta_1 * \log x_1 + \beta_2 * \log x_2$ Assume that ...
29 views

### loglog regression with 0's in IV's

Assume we have 2 predictors $X_1$ and $X_2$ and an outcome $Y$ that we wish to model with the following function $y = e^{\beta_0} * X_1 ^{\beta_1} * X_2^{\beta_2}$ Also assume that we have some priors ...
37 views

### Interpretation of parameters in loglog-regression with scaled variables

Consider e.g the model $y = e^{\text{trend} + \text{seasonality}} \cdot \prod_{k \in \text{channels}} x_k^{b_k}$ where $i$ constrained $0 < b_k < 1$ (to capture diminishing marginal returns) ...
56 views

### Do we need to scale our features before applying ICA, like in PCA?

I am reasonably certain that we don't need to scale data before applying ICA, like we do for the PCA. In PCA we do this because it assumes normal distribution of the features, and in ICA we don't ...
13 views

### Is the StandardScaler important when using the logistic regression as a classifier? [duplicate]

I'm training my LR right now and using Brier Score and ROC AUC as my evaluation. In my x_train are binary variables, ordinal variables and numerical variables with a wide range (e.g. 20000 - 160000). ...
560 views

### Why feature scaling does not affect prediction output in regression?

I was modelling a linear regression (OLS) and tried using scaling techniques on the predictor variables. I could see the range of the variables change, however the prediction results remain the same. ...
18 views

### How to transform one distribution into another using a linear transform of Mean and linear transform of Std?

I'm trying to account for a time correction between two streams of data, let's say Stream A and Stream B. Stream A and Stream B each have different message arrival/latency characteristics. Each ...
1 vote
86 views

### Do you lose information when you encode numerical columns with two values?

Sometimes I have numerical columns that are composed of two unique values. For example, a value from the set $\{0.1, 5.4\}$ in every cell, or $\{-1, 0\}$ in every cell. I typically scale these columns ...
23 views

### Scaling by percentage - is this appropriate given this situation?

Let's say I have a range of formulations, and each formulation contains a different starting rate of water "x", and I want to test how fast the formula dries out over time (ie. loss of water ...
316 views

### Do we lose information when we normalize an image? [closed]

Before training a machine learning algorithms, it is advisable to perform feature scaling. Suppose we have a "toy" dataset where each image is composed of two pixels $x_0$ and $x_1$. Lets ...
243 views

### Is standardization still needed after a LASSO model is fitted?

We know that it's better to standardization the training data (i.e. X_train) before fitting a LASSO model, especially when features are not in the same scale (Ref. Is standardisation before Lasso ...
1 vote
327 views

### Is there any downside to scaling a dataset?

I've read that some models, such as decision trees, don't require scaling to work effectively. However, the author of the linked article states there's no downside to scaling data for a decision tree ...
201 views

### Can I scale a dataset using different methods on different columns and why?

relatively new to this and this question has been plaguing me. Say I have a dataset with feature A, feature B, and feature C. I need to scale for my model. Based on their distributions, feature A is ...
1 vote
688 views

### ARIMA or SARIMA scale and normalize data

Good evening everyone, I am here to ask a question regarding the statistical models ARIMA & SARIMA use to build predictive models based on past values and with the intent of predicting future ...
1 vote
56 views

### PCA - Feature Scaling [closed]

I have been reading that the features should be standardized before performing PCA but I couldn't relate to my understanding of the same. PCA try to project the dataset in the direction of maximum ...
1 vote
119 views

### How do you get StandardScaler to work if X_test and X_train have different sizes?

For reference, the dataset I'm using is the Kaggle Housing prices dataset. The train data is (1460 x 80). I split it into a train and test dataset, with 1168 rows in the train set and 292 rows in the ...
1 vote
410 views

### Why data-scaling in range (0,1) is important? [duplicate]

Often a preprocessing technique to do is to normalize our data in a range (0,1) before we tow our model (example neural network) on them. I understand why in a practical way (for example if we have ...
506 views

### Transformation of predictors for generalized additive model

I have a gam model with automatic predictor selection based on cubic splines (bs = cr) and SELECT == T or shrinkage cubic ...
43 views

### Standard score applied to data that is not normally distributed

If I scale data from an arbitrary distribution using the standard score, will the property of the normal distribution that 75% of data lies between +/- 2 standard deviations from the mean, still hold?
33 views

### Why not scale before PCA as a default step? [duplicate]

In ISLR 2nd edition, it says that you may not want to scale before PCA if the features are all in the same units (below). However, I don't see the nuance. Why not just have the "default" ...
94 views

### Is it better to use StandardScaler before using MinMaxScaler? [duplicate]

in sklearn, if I want to transform the data to range(-1, 1), do you think it is better to use StandardScaler before using ...
1 vote
26 views

### How do I interpret a multidimensional scaling with a linear curve?

For context, I have a input dataset of 156 images and I'm extracting the feature maps for each image at the last fully connected layer of the AlexNet model. I get 156 feature maps, each of size [1, ...
38 views

### How to model categorical variables with word frequency vectors in a decision tree?

I have a dataset that describes car failures and the action made by the mechanic to fix them. It is composed by 5 columns: Fault Code, depending on car model and car year, categorical variable that ...
22 views

### Reasons why we need to scale our variables (eg. with StandardScaler)

Trying to collect all the top reasons why we need to scale our independent variables in a ML model. I have 3 reasons that I've collected so far. Please lmk if I am missing any here. Correct for large ...
1 vote
353 views

### Regression model has very high const VIF value where as the other features have value between less than 4. Should I drop const?

I am a beginner in modelling. I have created a linear regression model using statsmodel and I see the const has VIF value around 124 where as the other features have value around 4. I already referred ...
81 views

### Preprocessing on training set only or both training & test set? Seems like there would be errors for both answers

Let's say I have a dataset that hasn't been split into train/test yet. Upon loading it, I discover that there are columns where there are nulls that need to be filled in, some quadratic relationships ...
479 views

### Need for scaling continuous variables (e.g., standardization or normalization) for causal inference

I am currently trying to run a linear regression model to identify the effect of several explanatory variables X on a response variable Y. My advisor asks me to scale the continuous explanatory & ...
20 views

### How would you scale binary variables? [duplicate]

Would it be unwise to scale the Sex variable? I'm teaching myself Clustering and will probably attempt UMAP, T-SNE, and K-means soon. I saw someone else scale this ...
248 views

### Can I use normalization and standardization on the same dataset?

I'm working on an ML project to predict wine quality from a wine's physical characteristics. The features of my data are on vastly different scales so I've been experimenting with different ...
38 views

### Feature Scaling in Hierarchal Clustering

I know that feature scaling is always a requirement for clustering algorithms. Currently I am implementing hierarchal clustering on this dataset, I will use only the annual income and the spending ...
1k views

### How to return feature_names_out with sklearn.preprocessing.FunctionTransformer? [closed]

My goal is to impute not with sklearn.impute.SimpleImputer. My goal is to impute with sklearn.preprocessing.FunctionTransformer. ...
160 views

### Scaling the same continuous feature both in train and test

I'm building a classification model to predict some target variable. I have only one continuous feature (age) that I am interested in scaling. I split my data into train and test sets, I scale this ...
30 views

### Why do we scale features in PCA? Wouldn't that mean the variance in all dimensions is just $1$? [duplicate]

According to https://scikit-learn.org/stable/auto_examples/preprocessing/plot_scaling_importance.html, Feature scaling through standardization (or Z-score normalization) can be an important ...
157 views

### Should interactions also be scaled in LASSO/Ridge, or just constituent covariates?

I understand that in LASSO/Ridge it is best practice to scale covariates so that no single covariate dominates the penalized norm. However, when entering interaction terms, it is unclear whether only ...
29 views

### Dealing with interaction effects between fractional variables ... Does it matter that they're fractional?

I have a number of variables, $X_1, X_2, ...$ which vary between 0 and 1. These are measures representing metrics in a large organization -- e.g: LeadershipScore on a scale of 0 to 1, ...
1 vote
86 views

### Lowering the weight of particular features in a neural network?

Given sample data $x$, we hypothesize that some features (i.e. dimensions) of $x$ will generalize well, while others will generalize poorly. For example, when predicting medical diagnosis, age and ...
81 views

### scaling features for LASSO variable selection

I am interested in performing LASSO regression for the purpose of variable selection. The response variable is categorical (3 classes) and most of the predictor variables are categorical. Most ...
1 vote
178 views

### Feature scaling with categorical variables

I've a dataset with numeric features and categorical features. For the latter I created dummy variables. I've to implement a KNN model so I've to scale my variables. My doubt is: how to handle these ...
874 views

### Best formula to normalize non linear scores to scale of 1-100

I have lists of scores, which can be very non linear. For example: 20332 18000 599 39 19 2 I need to normalize these scores to a 1-100 scale so I can do some ...
97 views

### what if range of normalized of data in machine learning goes beyond?

Normalization in machine learning is the process of translating data into the range 0 -> 1 or -1 -> 1. What if the values goes above 1 or below -1. What does that mean? Is it again an outlier? ...
95 views

### normalize data with KPI value

I have this sample of a dataset that show for each number of ads showed to the user, the number of click and the KPI value (CTR): ...
307 views

### Min-max scaling vs standardizing in LASSO

I know that it is recommended to have features on the same scale for LASSO, such that the scale does not affect the penalty. However, does it matter whether or not features are scaled using \$\frac{x-\...
1 vote
995 views

### Feature scaling of categorical and ordinal variables in Cox regression

I have a dataset with nominal (unorderable categories), ordinal (orderable categories), and continuous/numerical variables. I am performing Cox Proportional Hazard Regression using the scikit-survival ...
1 vote
363 views

### Non-linear scaling of data

I have a set of numbers in a range between 1 to 5, heavily skewed towards 3. How can I (preferably in python) non-linearly scale the numbers so the difference between the numbers is more pronounced? I ...
1 vote
27 views

### Correct Way to analize the time series data where we cant calculate the central tendency

If we are given a dataset of real-time sensors, we need to normalize the features. We might not be calculating the central tendency of the whole data coz it's been updating every 5 secs. So if we ...
1 vote
105 views

### How to scale data for model retraining on production?

Let's say I have a basic regression model being used in production and now I want to implement periodical model retraining (i.e. once a month) where I take a batch of new data from last month and fit ...
1 vote
98 views

### Scaling autocorrelated features

If I have a bunch of autocorrelated features (for example, temperature, rainfall) that I want to use to predict a dependent variable, how should I scale these autocorrelated features before passing ...
569 views

### Scaling a power law distribution for k-means clustering

For my project I want to group some products by using a few variables. For grouping, I am using k-means clustering. One of my variables is a metric called CR (conversion rate) which takes values ...