I need some help from anyone who are familiar with machine learning area.

ID        | Mach_1  | Mach_2 | Mach_3  | Mach_4 | Mach_5 | Rejected Unit (%)
127189.11     1         0        1         1        1           0.23
178390.11     0         0        0         1        0           0.10
902817.11     1         0        1         0        1           0.60

Above is the example of my data, for each ID there are several mach that are available and if that particular mach is used for that ID , the value will be 1 and if the mach is not used it is 0. And the rejected unit is the percentage value of rejected unit for that ID.

What I want to know is which mach is the most affected to the rejected unit. And what is the percentage for each mach that is affected to rejected unit.

Can anyone help me to advise on what machine learning algorithm/model that I can use to analyse this case study ?


I have done the linear regression and below is my code, however the output has show two warnings as shown in the screenshot below.

import statsmodels.api as sm
#create model
mod = sm.OLS(y_train,X_train)
res = mod.fit()

enter image description here


1 Answer 1


Fit a linear model. Using rejected unit % as target. Then see the coefficients of the linear regression to see how much contributes each to the result.

You can adapt your code to this example of sklearn:


If you are feeling confortable with this, you can move to higher performance/non parametric algorithms as decission trees. Or just use a LASSO regression.

  • $\begingroup$ if the value of the target has too many, is that mean I have to encode the value using one hot encode ? Eg: 0.23 = 1, 0.10 = 2, 0.60 = 3,0.5 = 4 and so on ? Or just use the raw value ? $\endgroup$ Jan 9, 2020 at 9:16
  • $\begingroup$ Just build a regression model. In a regression model you predict a continuous variable $\endgroup$ Jan 9, 2020 at 9:36
  • $\begingroup$ Is my data is suitable for linear regression or logistic regression ? I am a bit confuse on this. $\endgroup$ Jan 16, 2020 at 3:50
  • $\begingroup$ It is suitable for linear regression. Dont forget to upvote. $\endgroup$ Jan 16, 2020 at 7:52
  • $\begingroup$ I have done the linear regression. However, there is a warning shows at the output as shown in the image from my question that I have edit. Do you know why and how to solve it ? $\endgroup$ Jan 16, 2020 at 8:21

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.