Documentation of 'jsat.classifiers.MajorityVote' Java class
MajorityVote
jsat.classifiers

Class MajorityVote

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Classifier


    public class MajorityVote
    extends java.lang.Object
    implements Classifier
    The Majority Vote classifier is a simple ensemble classifier. Given a list of base classifiers, it will sum the most likely votes from each base classifier and return a result based on the majority votes. It does not take into account the confidence of the votes.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      MajorityVote(Classifier... voters)
      Creates a new Majority Vote classifier using the given voters.
      MajorityVote(java.util.List<Classifier> voters)
      Creates a new Majority Vote classifier using the given voters.
    • Constructor Detail

      • MajorityVote

        public MajorityVote(Classifier... voters)
        Creates a new Majority Vote classifier using the given voters. If already trained, the Majority Vote classifier can be used immediately. The MajorityVote does not make copies of the given classifiers.
        null values in the array will have no vote.
        Parameters:
        voters - the array of voters to use
      • MajorityVote

        public MajorityVote(java.util.List<Classifier> voters)
        Creates a new Majority Vote classifier using the given voters. If already trained, the Majority Vote classifier can be used immediately. The MajorityVote does not make copies of the given classifiers.
        null values in the array will have no vote.
        Parameters:
        voters - the list of voters to use
    • Method Detail

      • classify

        public CategoricalResults classify(DataPoint data)
        Description copied from interface: Classifier
        Performs classification on the given data point.
        Specified by:
        classify in interface Classifier
        Parameters:
        data - the data point to classify
        Returns:
        the results of the classification.
      • train

        public void train(ClassificationDataSet dataSet,
                          boolean parallel)
        Description copied from interface: Classifier
        Trains the classifier and constructs a model for classification using the given data set. If the training method knows how, it will used the threadPool to conduct training in parallel. This method will block until the training has completed.
        Specified by:
        train in interface Classifier
        Parameters:
        dataSet - the data set to train on
        parallel - true if multiple threads should be used to train the model. false if it should be done in a single threaded manner.
      • train

        public void train(ClassificationDataSet dataSet)
        Description copied from interface: Classifier
        Trains the classifier and constructs a model for classification using the given data set.
        Specified by:
        train in interface Classifier
        Parameters:
        dataSet - the data set to train on
      • supportsWeightedData

        public boolean supportsWeightedData()
        Description copied from interface: Classifier
        Indicates whether the model knows how to train using weighted data points. If it does, the model will train assuming the weights. The values returned by this method may change depending on the parameters set for the model.
        Specified by:
        supportsWeightedData in interface Classifier
        Returns:
        true if the model supports weighted data, false otherwise
      • clone

        public Classifier clone()
        Specified by:
        clone in interface Classifier
        Overrides:
        clone in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.