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.
        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.
        the classifier in use
      • getIndex

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

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

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

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

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

        public weka.classifiers.meta.multisearch.Performance getPerformance()
        The generated performance.
        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.
        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.
        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
        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.
        template - the template classifier
        trained - the trained classifier
        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
        Exception - if fails to execute job
      • postProcessCheck

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

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

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