Class MajorityConfidenceVote

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, weka.classifiers.Classifier, weka.core.Aggregateable<weka.classifiers.Classifier>, weka.core.BatchPredictor, weka.core.CapabilitiesHandler, weka.core.CapabilitiesIgnorer, weka.core.CommandlineRunnable, weka.core.EnvironmentHandler, weka.core.OptionHandler, weka.core.Randomizable, weka.core.RevisionHandler, weka.core.TechnicalInformationHandler

    public class MajorityConfidenceVote
    extends weka.classifiers.meta.Vote
    Vote implementation for majority confidence. The ensemble's distributions of each classifier are aggregated using the sum of each unique values times classifier weights. The classifier weights are determined during training using a CV.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class weka.classifiers.meta.Vote

        AVERAGE_RULE, m_classifiersToLoad, m_CombinationRule, m_dontPrintModels, m_env, m_preBuiltClassifiers, m_structure, MAJORITY_VOTING_RULE, MAX_RULE, MEDIAN_RULE, MIN_RULE, PRODUCT_RULE, TAGS_RULES
      • Fields inherited from class weka.classifiers.RandomizableMultipleClassifiersCombiner

        m_Seed
      • Fields inherited from class weka.classifiers.MultipleClassifiersCombiner

        m_Classifiers
      • Fields inherited from class weka.classifiers.AbstractClassifier

        BATCH_SIZE_DEFAULT, m_BatchSize, m_Debug, m_DoNotCheckCapabilities, m_numDecimalPlaces, NUM_DECIMAL_PLACES_DEFAULT
    • Constructor Summary

      Constructors 
      Constructor Description
      MajorityConfidenceVote​(int numFolds, long seed)
      Constructor for a majority confidence vote ensemble classifier.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void buildClassifier​(weka.core.Instances data)
      Builds the ensemble by assessing the classifier weights using a cross validation of each classifier of the ensemble and then training the classifiers using the complete data.
      double classifyInstance​(weka.core.Instance instance)
      double[] distributionForInstance​(weka.core.Instance instance)
      Function calculating the distribution for a instance by predicting the distributions for each classifier and multiplying the result by the classifier weights.
      • Methods inherited from class weka.classifiers.meta.Vote

        addPreBuiltClassifier, aggregate, classifyInstanceMedian, combinationRuleTipText, distributionForInstanceAverage, distributionForInstanceMajorityVoting, distributionForInstanceMax, distributionForInstanceMin, distributionForInstanceProduct, doNotPrintModelsTipText, finalizeAggregation, getCapabilities, getCombinationRule, getDoNotPrintModels, getOptions, getPreBuiltClassifiers, getRevision, getTechnicalInformation, globalInfo, listOptions, main, preBuiltClassifiersTipText, removePreBuiltClassifier, setCombinationRule, setDoNotPrintModels, setEnvironment, setOptions, setPreBuiltClassifiers, toString
      • Methods inherited from class weka.classifiers.RandomizableMultipleClassifiersCombiner

        getSeed, seedTipText, setSeed
      • Methods inherited from class weka.classifiers.MultipleClassifiersCombiner

        classifiersTipText, getClassifier, getClassifiers, getClassifierSpec, postExecution, preExecution, setClassifiers
      • Methods inherited from class weka.classifiers.AbstractClassifier

        batchSizeTipText, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MajorityConfidenceVote

        public MajorityConfidenceVote​(int numFolds,
                                      long seed)
        Constructor for a majority confidence vote ensemble classifier.
        Parameters:
        numFolds - See numFolds
        seed - See seed
    • Method Detail

      • buildClassifier

        public void buildClassifier​(weka.core.Instances data)
                             throws java.lang.Exception
        Builds the ensemble by assessing the classifier weights using a cross validation of each classifier of the ensemble and then training the classifiers using the complete data.
        Specified by:
        buildClassifier in interface weka.classifiers.Classifier
        Overrides:
        buildClassifier in class weka.classifiers.meta.Vote
        Parameters:
        data - Training instances
        Throws:
        java.lang.Exception
      • distributionForInstance

        public double[] distributionForInstance​(weka.core.Instance instance)
                                         throws java.lang.Exception
        Function calculating the distribution for a instance by predicting the distributions for each classifier and multiplying the result by the classifier weights. The final result is the sum of each probabilities for each class.
        Specified by:
        distributionForInstance in interface weka.classifiers.Classifier
        Overrides:
        distributionForInstance in class weka.classifiers.meta.Vote
        Parameters:
        instace - Instance to be predicted
        Returns:
        Returns the final probability distribution for each class for the given instance
        Throws:
        java.lang.Exception
      • classifyInstance

        public double classifyInstance​(weka.core.Instance instance)
                                throws java.lang.Exception
        Specified by:
        classifyInstance in interface weka.classifiers.Classifier
        Overrides:
        classifyInstance in class weka.classifiers.meta.Vote
        Throws:
        java.lang.Exception