Class WekaClassifierRanker.RankingJob

    • Field Detail

      • m_Classifier

        protected weka.classifiers.Classifier m_Classifier
        the classifier to evaluate.
      • m_Index

        protected int m_Index
        the index in actor's input array.
      • m_Train

        protected weka.core.Instances m_Train
        the train data to evaluate with.
      • m_Test

        protected weka.core.Instances m_Test
        the test data to evaluate with (if folds less than 2).
      • m_Seed

        protected long m_Seed
        the seed value to use.
      • m_Folds

        protected int m_Folds
        the number of folds to use.
      • m_ClassLabel

        protected WekaLabelIndex m_ClassLabel
        the class label index.
      • m_Performance

        protected weka.classifiers.meta.multisearch.Performance m_Performance
        the performance.
      • m_EvaluationError

        protected String m_EvaluationError
        for storing evaluating errors.
      • m_OutputBestSetup

        protected boolean m_OutputBestSetup
        whether to output the best classifier.
      • m_BestClassifier

        protected weka.classifiers.Classifier m_BestClassifier
        the best classifier.
    • Constructor Detail

      • RankingJob

        public RankingJob​(weka.classifiers.Classifier cls,
                          int index,
                          weka.core.Instances train,
                          weka.core.Instances test,
                          long seed,
                          int folds,
                          WekaClassifierRanker.Measure measure,
                          WekaLabelIndex classLabel,
                          boolean best)
        Initializes the job.
        Parameters:
        cls - the classifier to evaluate
        index - the index of the classifier in input array
        train - the training data to use
        test - the test data to use
        seed - the seed value to use
        folds - the number of folds to use
        measure - the measure to use for ranking
        classLabel - the class label index to use
        best - whether to output the best classifier setup (for optimizers)
    • Method Detail

      • getClassifier

        public weka.classifiers.Classifier getClassifier()
        Returns the classifier being used.
        Returns:
        the classifier in use
      • getIndex

        public int getIndex()
        Returns the index of the classifier in the actor's input array.
        Returns:
        the index
      • getTrain

        public weka.core.Instances getTrain()
        The training data.
        Returns:
        the training data
      • getTest

        public weka.core.Instances getTest()
        The test data.
        Returns:
        the test data
      • getSeed

        public long getSeed()
        Returns the seed value.
        Returns:
        the seed value
      • getFolds

        public int getFolds()
        Returns the number of folds.
        Returns:
        the folds
      • getPerformance

        public weka.classifiers.meta.multisearch.Performance getPerformance()
        The generated performance.
        Returns:
        the performance, can be null
      • getBestClassifier

        public weka.classifiers.Classifier getBestClassifier()
        Returns the best classifier found. For optimizers like GridSearch, this outputs the best setup found. For all others, that's the same setup as the actual classifier that was evaluated.
        Returns:
        the best setup or the original setup
      • getOutputBestSetup

        public boolean getOutputBestSetup()
        Returns whether the best setup is output in case of optimizers like GridSearch/MultiSearch.
        Returns:
        true if the best setup is output
      • preProcessCheck

        protected String preProcessCheck()
        Checks whether all pre-conditions have been met.
        Specified by:
        preProcessCheck in class AbstractJob
        Returns:
        null if everything is OK, otherwise an error message
      • getBestClassifier

        protected weka.classifiers.Classifier getBestClassifier​(weka.classifiers.Classifier template,
                                                                weka.classifiers.Classifier trained)
        In case of GridSearch/MultiSearch the best setup is returned, otherwise the classifier itself.
        Parameters:
        template - the template classifier
        trained - the trained classifier
        Returns:
        either the best classifier (in case of GridSearch/MultiSearch) or the template
      • process

        protected void process()
                        throws Exception
        Does the actual execution of the job.
        Specified by:
        process in class AbstractJob
        Throws:
        Exception - if fails to execute job
      • postProcessCheck

        protected String postProcessCheck()
        Checks whether all post-conditions have been met.
        Specified by:
        postProcessCheck in class AbstractJob
        Returns:
        null if everything is OK, otherwise an error message
      • getAdditionalErrorInformation

        protected String getAdditionalErrorInformation()
        Returns additional information to be added to the error message.
        Overrides:
        getAdditionalErrorInformation in class AbstractJob
        Returns:
        the additional information
      • toString

        public String toString()
        Returns a string representation of the job.
        Specified by:
        toString in class AbstractJob
        Returns:
        a string representation