Orange Forum • View topic - KernelException: 'orange.Classifier_Python': invalid result

KernelException: 'orange.Classifier_Python': invalid result

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

KernelException: 'orange.Classifier_Python': invalid result

Postby DasBaca » Mon Feb 03, 2014 17:42

I am attempting to use the example code from the domain documentation page. My script is below.

Code: Select all
import re
import orange

def convertSteamIDToCommunityID(steamID):
    steamIDBase = 76561197960265728
    steamIDParts = re.split(":", steamID)
    communityID = int(steamIDParts[2]) * 2
    if steamIDParts[1] == "1":
        communityID += 1
    communityID += steamIDBase
    return communityID

data = in_data
pid = orange.FloatVariable('profile-id')
pid.getValueFrom = lambda e, getWhat: convertSteamIDToCommunityID(str(e['steamid']))
newdomain = orange.Domain(data.domain.attributes+[pid, data.domain.classVar])
print newdomain.attributes
newdata =

I receive an error on the last line of code: newdata =

The error is:
Code: Select all
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "<string>", line 22, in <module>
KernelException: 'orange.Classifier_Python': invalid result from __call__

I am unsure what to do at this point to troubleshoot the problem. The print line I have before the error appears to work correcly. My new `profile-id` appears as an attribute. Help?

Re: KernelException: 'orange.Classifier_Python': invalid res

Postby Ales » Tue Feb 04, 2014 12:08

The 'convertSteamIDToCommunityID' should return an instance of orange.Value, i.e. orange.Value(communityID).

Note however that the values you are returning seem to be outside of the range that can be stored in a FloatVariable.

Return to Questions & Support