Feature scaling is a data pre-processing step where the range of variable values is standardized. Standardization of datasets is a common requirement for many machine learning algorithms. Popular feature scaling types include scaling the data to have zero mean and unit variance, and scaling the data between a given minimum and maximum value.
Questions tagged [feature-scaling]
259 questions
36
votes
4 answers
What is a good way to transform Cyclic Ordinal attributes?
I am having 'hour' field as my attribute, but it takes a cyclic values. How could I transform the feature to preserve the information like '23' and '0' hour are close not far.
One way I could think is to do transformation: min(h, 23-h)
Input: [0 1…
Mangat Rai Modi
- 569
- 1
- 5
- 10
33
votes
1 answer
Ways to deal with longitude/latitude feature
I am working on a fictional dataset with 25 features. Two of the features are latitude and longitude of a place and others are pH values, elevation, windSpeed etc with varying ranges. I can perform normalization on the other features but how do I…
AllThingsScience
- 443
- 1
- 4
- 5
30
votes
3 answers
Why do we convert skewed data into a normal distribution
I was going through a solution of the Housing prices competition on Kaggle (Human Analog's Kernel on House Prices: Advance Regression Techniques) and came across this part:
# Transform the skewed numeric features by taking log(feature + 1).
# This…
Abhijay Ghildyal
- 785
- 2
- 9
- 10
29
votes
1 answer
Should one hot vectors be scaled with numerical attributes
In the case of having a combination of categorical and numerical Attributes, I usually convert the categorical attributes to one hot vectors. My question is do I leave those vectors as is and scale the numerical attributes through…
Suresh Kasipandy
- 568
- 1
- 4
- 8
25
votes
2 answers
Feature Transformation on Input data
I was reading about the solution to this OTTO Kaggle challenge and the first place solution seems to use several transforms for the input data X, for example Log(X+1), sqrt( X + 3/8), etc. Is there a general guideline on when to apply which kind…
terenceflow
- 406
- 1
- 4
- 6
18
votes
3 answers
When should I use StandardScaler and when MinMaxScaler?
I have a feature vector with One-Hot-Encoded features and with continous features.
How can I decide now, which data I shall scale with StandardScaler and which data scale with MinMaxScaler? I think I do not have to scale the one-hot-encoded anyway…
jochen6677
- 561
- 2
- 4
- 9
16
votes
4 answers
How to scale an array of signed integers to range from 0 to 1?
I'm using Brain to train a neural network on a feature set that includes both positive and negative values. But Brain requires input values between 0 and 1. What's the best way to normalize my data?
Jonathan Shobrook
- 313
- 1
- 3
- 8
16
votes
3 answers
Zero Mean and Unit Variance
I'm studying Data Scaling, and in particular the Standardization method.
I've understood the math behind it, but it's not clear to me why it's important to give the features zero mean and unit variance.
Can you explain me ?
Qwerto
- 675
- 1
- 8
- 15
11
votes
6 answers
When should I NOT scale features
Feature scaling can be crucially necessary when using distance-, variance- or gradient-based methods (KNN, PCA, neural networks...), because depending on the case, it can improve the quality of results or the computational effort.
In some cases…
Romain Reboulleau
- 1,327
- 6
- 26
11
votes
2 answers
Consequence of Feature Scaling
I am currently using SVM and scaling my training features to the range of [0,1].
I first fit/transform my training set and then apply the same transformation to my testing set. For example:
### Configure transformation and apply to training set
…
mike1886
- 933
- 9
- 17
10
votes
2 answers
Linear Regression and scaling of data
The following plot shows coefficients obtained with linear regression (with mpg as the target variable and all others as predictors).
For mtcars dataset (here and here) both with and without scaling the data:
How do I interpret these results? The…
rnso
- 1,558
- 3
- 16
- 34
9
votes
3 answers
Data scaling before or after PCA
I have seen senior data scientists doing data scaling either before or after applying PCA.
What is more right to do and why?
Outcast
- 1,037
- 2
- 11
- 27
8
votes
1 answer
How to handle preprocessing (StandardScaler, LabelEncoder) when using data generator to train?
So, I have a dataset that is too big to load into memory all at once. Therefore I want to use a generator to load batches of data to train on.
In this scenario, how do I go about performing scaling of the features using LabelEncoder +…
Jim
- 181
- 3
7
votes
1 answer
Sensitivity to scaling of features in a multivariate gaussians
I'm using the HMMLearn python package for hidden markov models. That implementation is build on multivariate gaussian distributions.
So I have a string of features. How sensitive are gaussians to vastly different feature scales? Will it be really…
Clayton
- 73
- 3
7
votes
2 answers
Best way to scale across different datasets
I have come across a peculiar situation when preprocessing data.
Let's say I have a dataset A. I split the dataset into A_train and A_test. I fit the A_train using any of the given scalers (sci-kit learn) and transform A_test with that scaler. Now…
raghu
- 71
- 2