Linear regression cannot handle polynomial label
zain
New Altair Community Member
I am new to rapid miner studio and trying to understand the telco customer churn process which is available in the community real-world use cases. But there seems to be an error in the process model I have attached the snapshot of error. Any idea how I can solve this, please?
0
Best Answer
-
Hi @zain, and a warm welcome to the community!
A Logistic Regression is, like many (but not all) machine learning models, a mathematical formula. A polynominal field is text, hence not suitable for calculations.
How to solve it? Super easy: there is an operator named Nominal to Numerical. It does something weird with your data (not that weird, but you might want to see it for yourself by adding a breakpoint), transforming it into 0's and 1's, the kind of entry that suits your algorithm. Just put that before your Logistic Regression operator and let's see if it works.
(Notice that linear and logistic regressions, while similar, are not the same. Your model is using logistic regression).
All the best,
Rodrigo.
1
Answers
-
Hi @zain, and a warm welcome to the community!
A Logistic Regression is, like many (but not all) machine learning models, a mathematical formula. A polynominal field is text, hence not suitable for calculations.
How to solve it? Super easy: there is an operator named Nominal to Numerical. It does something weird with your data (not that weird, but you might want to see it for yourself by adding a breakpoint), transforming it into 0's and 1's, the kind of entry that suits your algorithm. Just put that before your Logistic Regression operator and let's see if it works.
(Notice that linear and logistic regressions, while similar, are not the same. Your model is using logistic regression).
All the best,
Rodrigo.
1 -
Thank you for the help0
-
Nominal to Numerical is usually suitable for input attributes but not necessarily for the label. If you have 4 possible nominal values, you cannot use Nominal to Numerical to reformulate them in a way that would make it a problem suitably solved by the Linear Regression learner. Fundamentally, linear regression is about predicting a continuous numerical outcome, like "Sales" or "Height" or something similar. If you have a nominal label, you should look at other learners that are better suited to classification outcomes.
Note: it is true, if you have two nominal classes, you can "fool" a linear regression into working by recoding it as a dummy (0/1) outcome, but even then you would be better off using logistic regression than pure linear regression.-1