# Calculate a Rank function from Regression features

I am using 3 features (x1, x2, x3) for regression. Some of my features are continuous some are categorical.

My dependent variable are lets number of bookings. And I can predict the number of bookings. By obtaining how important each feature was in regression as follows (i.e. feature importance)

x1 --> 0.1
x2 --> 0.5
x3 --> 0.7


It is clear that feature 3 (x3) contributes the most, x2 the second and x1 the least in classification.

I also performed correlation analysis to check if my features are positively or negatively correlated with the target (y) as follows.

x1 --> positively correlated
x2 --> positively correlated
x3 --> negatively correlated


I am wondering if it is possible to convert my regression features into a ranking function using feature importance and correlation.

For instance, my suggestion looks as follows.

ranking_score = 0.1*x1 + 0.5*x2 + 0.7*(1/x3)


The reason for using (1/x3) in the above equation is because it is negatively correlated with the target (y). Please let me know if my ranking_score equation is statistically correct? If not, please let me know your suggestions.

EDIT: Why ranking is important to me?

I am happy to provide more details if needed.

• Hi, is this an R related question? if so please consider adding the appropriate tag. Dec 20, 2019 at 21:16
• No its not an R related question. Dec 20, 2019 at 21:22
• I'm a bit confused by your question: you are doing regression on these features in order to predict the target variable "number of bookings", so your model predicts a real number right? If so why don't you rank the values predicted by the model? Also your "ranking_score" is not a rank, it's actually very similar to the linear regression equation (except for the 1/x3: a negatively correlated variable would be weighted with a negative coefficient). Dec 21, 2019 at 1:38
• I am saying i get the importance of the features based on that i can give weightage to features. And combine them accordingly for a score. What u mean rank by predicted values Dec 21, 2019 at 6:50
• @user3432888 It looks like you are trying to redo manually something which already exists, but I'm not sure what: do you want to obtain a ranking, i.e. to order the instances from the first to the last, and if yes according to what? Or do you want to predict a score for each instance, so in this case you should use regression, but you have done regression already, right? Or maybe there is a confusion between the task of classification (predicting a categorical output) and the task of regression (predicting a numerical output)? Dec 22, 2019 at 22:42