# Binary Classification - Linear Regression

I am using the mushroom data from UCI. It has two classes p and e.

It binary classification problem and all the data is in text form. My data has a column called "class". I set it as a label. Then I performed a "Nominal to Numerical" all the columns since all the data is text. I applied Linear Regression as the model and added a "Performance" at the end. It gave me the error "The label Attribute (class) must be numerical for the calculation of performance for regression tasks".

The only solution I have found is to first put the "Nominal to Numerical" it will separate the class into two (class = e, class = p) but I have noticed that I can only either class = e as label or class = p label, even if I put two separate blocks of "SetRoles" for class e and p.

How can I set two labels for regression?

Also, the root means the square error is zero and the squared correlation is 1. I don't think my results are correct.

It binary classification problem and all the data is in text form. My data has a column called "class". I set it as a label. Then I performed a "Nominal to Numerical" all the columns since all the data is text. I applied Linear Regression as the model and added a "Performance" at the end. It gave me the error "The label Attribute (class) must be numerical for the calculation of performance for regression tasks".

The only solution I have found is to first put the "Nominal to Numerical" it will separate the class into two (class = e, class = p) but I have noticed that I can only either class = e as label or class = p label, even if I put two separate blocks of "SetRoles" for class e and p.

How can I set two labels for regression?

Also, the root means the square error is zero and the squared correlation is 1. I don't think my results are correct.

0

## Answers

1,207UnicornSorry, a bit confused with the question. If you have two classes in one attribute and if you are trying to classify this then it is a classification problem and not regression problem. So, linear regression in the original form doesn't work. You need to use "Generalized linear Model" operator for the classification tasks.

In order to check if your label is either "Binominal", "Polynominal" or "Numerical", you just need to set a break point on Nominal to numerical by right clicking on the operator and selecting "Breakpoint After".Run the process, then you can see data and go to statistics where you can see the type.

If your label is numerical value then you need to use either stand-alone "Performance operator" or "Performance (Regression)" operator.

Do let us know if this is what you were looking for? If you want us to check, please provide us with the process by exporting from rapid miner studio. To do this, you need to got to FILE --> Export Process then save the .rmp file and attach in this thread. Also attach your dataset for us to regenerate this error.

Varun

https://www.varunmandalapu.com/

Be Safe. Follow precautions and Maintain Social Distancing