Model with dummy variables has 100% accuracy?

happy_neid
happy_neid New Altair Community Member
edited November 2024 in Community Q&A

I made a classification model using logistic regression. At first, i used data set that has some nominal variables. Since my task says that i should convert nominal to numeric variables, i used  dummy coding in Nominal to Numeric operator, to do that.. Then i saved that file and make a model just like in the pics, but all the time i get accuracy 100%, so something is not ok. Before i did dummy coding, accuracy was 82% with the same model.

Model.PNGProcesscross validation.PNGCross Validation

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee

    Hi,

     

    you most likely overtrained. Try to put nominal to numerical into X-val and use group models to get it over. Keep in mind that X-val is only validating what's inside her.

     

    Every time you extract something from the whole data set and get a transformation from it you technically need to do it INSIDE of x-val. This includes replacing of missing values with averages, normalization but also dummy coding. But it's rare that the effect is that extreme.

     

    Best,

    Martin