Why does the correlation matrix show the minority class when the majority class was selected

GeezerDoc
GeezerDoc New Altair Community Member
edited November 5 in Community Q&A
I'm running a simple classification model to predict the presence or absence of heart disease based on multiple risk factors. When I run Automodel I specify the class of interest being the "presence of heart disease". After the algorithms have run I took a look at the correlation matrix and the obvious risk factors showed a negative correlation with heart disease. When I expanded the attribute column I now realize that the correlation matrix is based on the "absence of heart disease". That is why the results are counter-intuitive. Any idea why this might be? Thanka

Best Answers

  • DocMusher
    DocMusher New Altair Community Member
    Answer ✓

    @GeezerDoc

    If you don't mind could you send me the data you are mentioning or is the data available somewhere. From my perspective I am also interested to see what happens and how the correlation matrix looks like. It is important to be able to explain the step or how you should make any interpretation if you want to demonstrate your results to your colleagues.

    Sven Van Poucke, MD, PhD

  • GeezerDoc
    GeezerDoc New Altair Community Member
    Answer ✓
    I will attach the Heart Prediction File and you can run it to predict "Heart Disease Present" and see what happens. I have also run it with the class as 0,1 but RapidMiner interpreted that as regression so had to tell it to do classification
  • GeezerDoc
    GeezerDoc New Altair Community Member
    Answer ✓
    @varunm1
    While I don't think your response answered my initial question it may have answered another question that I had and that was related to "one hot encoding". Are you saying that AutoModel automatically uses this technique when it sees categorical data? If that is so, there is not need to convert categorical data using a visual operator before uploading the data to AutoModel. Please elaborate and thanks
  • DocMusher
    DocMusher New Altair Community Member
    Answer ✓
    Hi @GeezerDoc
    I used your data with the following process:
    Any feedback is welcome!
    Sven

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓
    @GeezerDoc,

    yes. AM is doing this if the model cannot handle this and the model cannot handle nominal data. This is a very good go-to method to do - thats why AM is doing it.

    Cheers,
    Martin

Answers

  • varunm1
    varunm1 New Altair Community Member
    edited February 2020
    Hello @GeezerDoc

    All columns are set as regular attributes and then the nominal columns are one-hot encoded in automodel. So in the case of binary classification, all the values in target column related to one category is coded as 0 and the other category is coded as 1. So the output column has both classes represented either as 1 or 0. The category name you see in the attribute name is coded as 1 and another category is zero.

    @IngoRM might provide more info if needed.
  • DocMusher
    DocMusher New Altair Community Member
    Answer ✓

    @GeezerDoc

    If you don't mind could you send me the data you are mentioning or is the data available somewhere. From my perspective I am also interested to see what happens and how the correlation matrix looks like. It is important to be able to explain the step or how you should make any interpretation if you want to demonstrate your results to your colleagues.

    Sven Van Poucke, MD, PhD

  • GeezerDoc
    GeezerDoc New Altair Community Member
    Answer ✓
    I will attach the Heart Prediction File and you can run it to predict "Heart Disease Present" and see what happens. I have also run it with the class as 0,1 but RapidMiner interpreted that as regression so had to tell it to do classification
  • GeezerDoc
    GeezerDoc New Altair Community Member
    Answer ✓
    @varunm1
    While I don't think your response answered my initial question it may have answered another question that I had and that was related to "one hot encoding". Are you saying that AutoModel automatically uses this technique when it sees categorical data? If that is so, there is not need to convert categorical data using a visual operator before uploading the data to AutoModel. Please elaborate and thanks
  • DocMusher
    DocMusher New Altair Community Member
    Answer ✓
    Hi @GeezerDoc
    I used your data with the following process:
    Any feedback is welcome!
    Sven

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓
    @GeezerDoc,

    yes. AM is doing this if the model cannot handle this and the model cannot handle nominal data. This is a very good go-to method to do - thats why AM is doing it.

    Cheers,
    Martin