Exemple #1
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 #2
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:])