1
$\begingroup$

Building my machine learning model, I have a target variable that consists of dollar values ranging from $0.01$ to $1000000$+. I want to transform these dollar values in to a scale of 1 to 10 and then try and predict that level of 1 through 10.

What is the best approach to normalize my dollar values in to a scale of 1 to 10?

$\endgroup$
2
  • $\begingroup$ I am not sure if this needs normalization. You can just use quartile cuts and create 10 separate bins in another column and use that column as target. $\endgroup$
    – cap
    Nov 22 '19 at 20:20
  • $\begingroup$ if you are doing this in Python, use this link to know more - pandas.pydata.org/pandas-docs/version/0.23.4/generated/… $\endgroup$
    – cap
    Nov 22 '19 at 20:20
2
$\begingroup$

The answer depends on how your data is distributed, and what kind of error you can accept. If the distribution is close to uniform, and you care about having an absolute error of, say, $1000, data does not necessarily need scaling, or you could use standard scaling (min to max).

In any other case, you may want to apply a non linear transformation to your target variable. For instance, if the observations are evenly distributed among 0.01, 0.1, 1, 10, 100, etc., or most specifically when you care about relative error (a certain percentage of the target value) I would recommend to use a log transformation. This is because an error of 10% will always represent 0.1 unit after being log-transformed, whatever the target variable value is.

Most cases, if not all, will lie in the second case.

$\endgroup$
0
$\begingroup$

There are several scaling strategies you can use. If you know what is your top value, the easiest way to do it is with a min-max standardization. Depending on the programming language you're using, you'll find tools to help on that. In python, you have the MinMaxScaler, and the sklearn documentation describes lots of scale/normalize strategies.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.