Skip to main content
113 votes
Accepted

scale a number between a range

Your scaling will need to take into account the possible range of the original number. There is a difference if your 200 could have been in the range [200,201] or in [0,200] or in [0,10000]. So let ...
Stephan Kolassa's user avatar
51 votes

scale a number between a range

In general, to scale your variable $x$ into a range $[a,b]$ you can use: $$ x_{normalized} = (b-a)\frac{x - min(x)}{max(x) - min(x)} + a $$
drgxfs's user avatar
  • 1,114
21 votes
Accepted

Why feature scaling only to training set?

Not quite. You learn the means and standard deviation of the training set, and then: Standardize the training set using the training set means and standard deviations. Standardize any test set using ...
Matthew Drury's user avatar
13 votes

Normalization vs. scaling

I don't know if you mean exactly this, but I see a lot of people referring to Normalization meaning data Standardization. Standardization is transforming your data so it has mean 0 and standard ...
Renata Ghisloti's user avatar
11 votes
Accepted

Why does $[0,1]$ scaling dramatically increase training time for feed forward ANN (1 hidden layer)?

We can find a reasonable explanation for this behavior in the Neural Network FAQ. TL;DR - try rescaling your data to lie in $[-1,1]$. But standardizing input variables can have far more important ...
Sycorax's user avatar
  • 92.2k
11 votes

How can I use scaling and log transforming together?

You can form a pipeline and apply standard scaling and log transformation subsequently. In this way, you can just train your pipelined regressor on the train data and then use it on the test data. For ...
Panagiotis Koromilas's user avatar
11 votes

How do I compare the results between two different Likert Scales questionnaires?

First, your dissertation committee has done you a disservice. You should have been required to figure this out before you gathered data. Second, I don't think this is possible. Your two sets of ...
Peter Flom's user avatar
  • 124k
10 votes

Normalize an array of numbers to specific range

@NickCox already provided an answer in the comments, I will only elaborate on it step-by-step and try to provide some intuition. You have a range on numbers ranging from $x$ to $y$ and you want to ...
Karolis Koncevičius's user avatar
9 votes

Are dichotomous categorical variables technically interval/continuous measures?

I disagree and yet in a limited sense also I agree with that (currently) unsourced statement. Binary (indicator, dichotomous, Boolean, logical, one-hot, quantal) variables coded as 0 and 1 are ...
Nick Cox's user avatar
  • 58k
7 votes
Accepted

Possible to correlate 7-point, 5-point, and 9-point Likert scales with Pearson correlation?

Yes, it is perfectly valid to conduct a Pearson's correlation between variables with different scales. The correlation coefficient is a standardized measure, so it is not influenced by scale. Here ...
Mark White's user avatar
  • 10.5k
7 votes
Accepted

Should I normalize all data prior feeding the neural network models?

Yes, normalisation/scaling is typically recommended and sometimes very important. Especially for neural networks, normalisation can be very crucial because when you input unnormalised inputs to ...
gunes's user avatar
  • 57.6k
7 votes

How do I compare the results between two different Likert Scales questionnaires?

While I agree with all three points Peter Flom makes, this will not help you in your thesis. What you can do is to simply run an unpaired t-test against your two sets of Likert ratings, which tests ...
Stephan Kolassa's user avatar
6 votes

how to scale the density plot for my histogram

The area under a true density function is 1. So unless the total area of the bars in the histogram is also 1, you cannot make a useful match between a true density function and the histogram. Using ...
BruceET's user avatar
  • 56.8k
6 votes

How do I compare the results between two different Likert Scales questionnaires?

I agree with Peter Flom's answer and Stephan Kolassa's answer to a substantial extent. Like Stephan, I think a highly-limited analysis could be performed, but I want to give my two cents on the ...
Galen's user avatar
  • 9,219
5 votes

Normalization vs. scaling

Centering means substacting the mean of the random variable from the variables. I.e x -xi Scalelling means dividing variable by its standard deviation. I.e xi /s Combination of the two is called ...
Frankfurt Ogunfunminiyi's user avatar
5 votes

When should I apply feature scaling for my data

This issue seems actually overlooked in many machine learning courses / resources. I ended up writing an article about scaling on my blog. In short, there are "monotonic transformation" invariant ...
RUser4512's user avatar
  • 10.4k
5 votes

Why feature scaling only to training set?

To follow up on a comment made to the answer - If you scale the data before train/test split you will get data leakage. Calculating mean/sd of the entire dataset before splitting will result in ...
CJ90's user avatar
  • 51
5 votes

Examples of variables on interval scale (besides temperature)

I will consider a variable on an interval scale to be one which has an order of their elements, with a meaningful and comparable difference, but with a zero which is not meaningful. This is in ...
5 votes

How to convert percentage values from 7 point scale to 5 point scale?

As already signalled, you can't do much -- without extra information or assumptions. Here, without any strong claims, is a method from Mosteller, F. and Tukey, J.W. 1977. Data Analysis and Regression. ...
Nick Cox's user avatar
  • 58k
5 votes
Accepted

what is the scale of TF-IDF results?

According to the definitions made in this article, the most important difference between an interval-scale variable and a ratio-scale variable is the notion of absolute zero point: Zero-point in an ...
gunes's user avatar
  • 57.6k
4 votes

How to scale new observations for making predictions when the model was fitted with scaled data?

There are now simpler ways to do this. For example, the preprocess function of the caret package ...
nigelhenry's user avatar
4 votes
Accepted

Approach to scale the size of investment with a wide extreme for visualization

First off, since you are most likely specifying the radius or diameter of the bubble, you need to take the square root of the number first. A bubble with r=2 is four times as large as one with r=1. ...
eSurfsnake's user avatar
  • 1,084
4 votes

How to best code the N/A response of the Likert-type rating scale?

Some of the answers here seem more complicated or hi-falutin' than may be needed or indeed justified. For example, in many projects short of say Ph.D. level, getting into imputation may be beyond the ...
Nick Cox's user avatar
  • 58k
4 votes

Reference thesis for outliers in Likert scale data

I agree with whuber. Instead of looking for outliers on restricted scales such as Likert, it is more convenient to identify suspicious responses. Three of the categories you should check carefully ...
Pavel Novoa's user avatar
4 votes

Should I normalize all data prior feeding the neural network models?

The mention of Tensorflow in the question is a red herring -- the reasons that scaling is beneficial are not unique to Tensorflow, but instead are common to all methods that update model parameters ...
Sycorax's user avatar
  • 92.2k
4 votes

Using OLS over Logit regression

If your outcome variable is a 4 point Likert scale you definitely can't use a binary logit model, which requires that the outcome variable has only two values: zero and one. You could, however use am ...
Graham Wright's user avatar
4 votes

How to convert percentage values from 7 point scale to 5 point scale?

To "translate" the scales, you would need to be able to make an assumption that the distributions of the underlying phenomenon did not change across time, the only difference was the ...
Tim's user avatar
  • 139k
3 votes
Accepted

Is age interval scale?

Yes it depends on measurement. A somewhat elusive answer is that it does not really matter in most cases, as for most statistical purposes the two are identical (e.g. used the same and interpreted the ...
Yuval Spiegler's user avatar
3 votes

What to do if reliability test result is not up to 0.7?

In your comment to me you noted that alpha is now 0.634, so it is at least close. First, note that any cutoff value is arbitrary. That probably won't help you in this particular case, but it's good ...
Peter Flom's user avatar
  • 124k
3 votes
Accepted

What regression model to use for judgment data?

There are several aspects to the problem, some of which you addressed explicitly in your question, some of which you didn't. What type of scale are ratings? Following Stevens (1946), ratings are ...
Livius's user avatar
  • 2,146

Only top scored, non community-wiki answers of a minimum length are eligible