Orange Forum • View topic - Error message running Logistic Regression with Scripting

Error message running Logistic Regression with Scripting

A place to ask questions about methods in Orange and how they are used and other general support.

Error message running Logistic Regression with Scripting

Postby garyspatterson » Mon Mar 05, 2012 8:56

Is there a maximum number of values that a discrete attribute can take? I am trying to run a logistic regression using just three attributes: 'AttAlign' which takes values 0 or 1; 'CurrClass' with takes 8 possible values (such as 'CONT'), and an interaction term 'CurrClass x AttAlign' which has 16 possible values (such as 'CONTx1' for example). I am working with a large data set, with some 22,000 instances.

When I try to run the regression using the script provided on the tutorial page, I get the following error message:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "logreg_pdtb.py", line 6, in <module>
lr = Orange.classification.logreg.LogRegLearner(train_data)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/orange/Orange/classification/logreg.py", line 344, in __new__
return self.__call__(instances, weightID)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/orange/Orange/classification/logreg.py", line 379, in __call__
lr = learner(examples, weight)
orange.KernelException: 'orange.LogRegLearner': singularity in CurrClassXAttAlign=CONTx1

Please explain what this singularity means, and how I can overcome it. There is no missing data.

I can run the model fine using just the two attributes 'AttAlign' and 'CurrClass'. It is only when I try to include the interaction term do I get this error. Any guidance appreciated.

Thanks

Re: Error message running Logistic Regression with Scripting

Postby Ales » Tue Mar 06, 2012 10:17

Use the remove_singular parameter to the learner (i.e. learner = LogRegLearner(remove_singular=True)). That should help.


Return to Questions & Support



cron