def setOptions(self, options): """ Parses a given list of options. Parameter(s): 'options' -- the list of options as an array of strings """ AbstractClassifier.setOptions(self, options) return
def getCapabilities(self): """ returns the capabilities of this classifier Return: the capabilities of this classifier """ result = AbstractClassifier.getCapabilities(self) # attributes result.enable(Capability.NOMINAL_ATTRIBUTES) result.enable(Capability.NUMERIC_ATTRIBUTES) result.enable(Capability.DATE_ATTRIBUTES) result.enable(Capability.STRING_ATTRIBUTES) result.enable(Capability.RELATIONAL_ATTRIBUTES) result.enable(Capability.MISSING_VALUES) # class result.enable(Capability.NOMINAL_CLASS) result.enable(Capability.NUMERIC_CLASS) result.enable(Capability.DATE_CLASS) result.enable(Capability.MISSING_CLASS_VALUES) # instances result.setMinimumNumberInstances(0) return result
def getOptions(self): """ Gets the current settings of the Classifier as string array. Return: an array of strings suitable for passing to setOptions """ return AbstractClassifier.getOptions(self)
def listOptions(self): """ Returns an enumeration describing the available options. Return: an enumeration of all the available options. """ return AbstractClassifier.listOptions(self)
return result def toString(self): """ Prints a string representation of the classifier Return: string representation of the classifier """ if (self.__Class == None): return "JeroR: No model built yet." if (self.__Counts == None): return "JeroR predicts class value: " + str(self.__ClassValue) else: return "JeroR predicts class value: " + str(self.__Class.value(int(self.__ClassValue))) # simulating the Java "main" method if __name__ == "__main__": # need to set the following jython registory value: # python.security.respectJavaAccessibility=false # # Links: # - Python registry # http://www.jython.org/docs/registry.html # - Accessing Java protected static members: # http://www.jython.org/cgi-bin/faqw.py?req=all#3.5 AbstractClassifier.runClassifier(JeroR(), sys.argv[1:])
def toString(self): """ Prints a string representation of the classifier Return: string representation of the classifier """ if (self.__Class == None): return "JeroR: No model built yet." if (self.__Counts == None): return "JeroR predicts class value: " + str(self.__ClassValue) else: return "JeroR predicts class value: " + str( self.__Class.value(int(self.__ClassValue))) # simulating the Java "main" method if __name__ == "__main__": # need to set the following jython registory value: # python.security.respectJavaAccessibility=false # # Links: # - Python registry # http://www.jython.org/docs/registry.html # - Accessing Java protected static members: # http://www.jython.org/cgi-bin/faqw.py?req=all#3.5 AbstractClassifier.runClassifier(JeroR(), sys.argv[1:])