I have a dataset with 8 features (columns). Each row is a customer, for which I want to give a score from 1-5 using the 8 features for each customer. The range of values are as follows:

Feature 1: 0-19

Feature 2: 0 - 4651107

Feature 3: 0 - 3525

Feature 4: binary (0 or 1)

Feature 5: binary (0 or 1)

Feature 6: binary (0 or 1)

Feature 7: binary (0 or 1)

Feature 8: 0 - 25857

I tried giving each feature a weight (from 0 to 1). So, the most important feature will have a weight of 0.9, then 0.85, then 0.8, etc... Then the score is given by:

Score = $\lambda_1x_1$+$\lambda_2x_2$+...+$\lambda_8x_8$ where $\lambda$ are the weights for each feature $x$

I need to somehow scale the final scores from 1-5, which I failed on doing. I'd appreciate an opinion on either of the below:

1) If you think my method is flawed due to the ranges of each features, or something else, please suggest a way from scratch to get the scores :)

2) If you think my method of linear combinations works, then please suggest how to scale the scores from 1-5 :)

3) Anything else! Maybe KNN or something? I don't really know haha

Thank you all very much.

  • $\begingroup$ Don't you think that we can get the coefficients of each col after applying LR and yes the scales will fool the LR, su rescale properly $\endgroup$
    – Aditya
    Jul 6, 2018 at 2:37
  • $\begingroup$ @Aditya Thanks Aditya! How would the LR work here? To get the coefficients :) $\endgroup$
    – Programmer
    Jul 6, 2018 at 3:38

1 Answer 1


If I understand the question correctly, this 0-5 weighting is quite arbitrary and is based on your criteria, right? e.g. how loyal some customer is. In this case, a practical way of doing it could be the following:

  1. Transform values of all features to be on the range (0,5). In order to achieve this normalize them to take values into (0, 1) and then multiply with 5 (see here for normalization with pandas)
  2. Apply weights on the features: each weight should be in the range (0,1).
  3. For each customer, multiply weights with transformed feature values (in a similar way as you showed) and calculate the average. This should be in (0,5).

In case that weights represent something that you can get past information on E.g. weights might mean how likely it is that the certain customer would be interested in some product and you can have access on historical information about whether customers with those characteristics (features) have bought it in the past, you can then train a probabilistic classification model and then rescale this probability into (0, 5) in order to turn it into weights. It this context, you might find useful this and this discussions.

  • $\begingroup$ thanks very much! By the way, should I also normalize the binary columns? Or just leave them as 0 and 1? $\endgroup$
    – Programmer
    Jul 8, 2018 at 23:51
  • $\begingroup$ Glad that I helped :) Not exactly normalize, but you need to make them to (0,5) range, so when you have 1 make it 5 (or multiply everything with 5) $\endgroup$
    – missrg
    Jul 9, 2018 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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