Question regarding ordinary least squares

Ming Partner, Registered Posts: 5 Partner


I was using the auto ML features for regression with my own data, and I had a hard time understanding the model coefficients from OLS. So I tried it again with the data from tutorial 2 to predict total revenue. The model coefficients came out to have similar issues. Please see below.

The coefficients for the top influence variables look to be extremely large. I also checked that campaign, user_agent_os, and gender shouldn't have any N/A values. However, when I applied the model to an unlabeled dataset, the predictions seemed to be very reasonable. Could you please give me some insights on this?



  • nomont
    nomont Dataiker Alumni Posts: 8 ✭✭✭✭✭

    OLS works only if there are no redundant features (no multicollinearity). In this example, there seem to be one issue with gender. As there should not be any N/A for gender, try to use "drop rows" as "missing values" strategy for gender and "Drop one dummy" for "Drop dummy". There is also probably the same issue with both "campaign" and "user_agent" and the same solution may work.

    You can also use ridge or lasso regression that will handle the multicollinearity thanks to the regularization.

  • Pythonista
    Pythonista Registered Posts: 1 ✭✭✭

    We are facing the same issue: large values appear as intercept and N/A despite we don't have missing values in our categorical data entering the OLS model.

    Any explanation on why? or how to avoid it?

Setup Info
      Help me…