Exemple #1
0
 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
Exemple #2
0
    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
Exemple #3
0
    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
Exemple #4
0
    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
Exemple #5
0
 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)
Exemple #6
0
 def listOptions(self):
     """
     Returns an enumeration describing the available options.
     
     Return:
      
         an enumeration of all the available options.
     """
      
     return AbstractClassifier.listOptions(self)
Exemple #7
0
    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)
Exemple #8
0
    def listOptions(self):
        """
        Returns an enumeration describing the available options.
        
        Return:
         
            an enumeration of all the available options.
        """

        return AbstractClassifier.listOptions(self)
Exemple #9
0
        
        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:])
Exemple #10
0
    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:])