Orange Forum • View topic - Custom classifier cannot return negative value.

Custom classifier cannot return negative value.

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

Custom classifier cannot return negative value.

Postby JC » Tue Dec 08, 2009 21:49

Hey,

I am making some modifications on the SVM algorithm and when I try to return -1 to indicate a rejected value, Orange somehow corrupts it and transforms it into '@Ӧ'.

I'm not quite sure I understand what's going on here. I cannot return a value superior to the number of classes either, so this leads me to think there is some type checking done with my domain, but I really don't see where or how...

I was thinking perhaps someone here has already dealt with this or has a better way to do what I'm trying to do ?

Thanks a lot,
JC

Postby JC » Wed Dec 09, 2009 15:30

By the way the function which I modified to return -1 in case of rejection is the svm_predict_probability() function from libsvm. This function is called in TSVMClassifier::operator(const TExample & example). It is then casted in a TValue, I believe this is the part to check...

If anything else is not clear let me know!

thanks,
JC

Postby Ales » Fri Dec 11, 2009 12:39

You should not construct the TValue from the -1 int value. Instead create the TValue without any arguments and then set it to "Don't know" or Don't care" special values. Example:
Code: Select all
TValue val;
val.setDK(); // or val.setDC();
return val


Return to Questions & Support