Class RandomClassifier

  • All Implemented Interfaces:

    public class RandomClassifier
    extends Classifier
    A Classifier that will return a randomly selected class label. The Classifier needs to be trained using the RandomAssignmentTrainer. Note that the frequency distribution gives more weight to class labels with a higher frequency in the training data. To create a Classifier which gives equal weight to each class, simply use a Set
    Martin Wunderlich
    See Also:
    RandomAssignmentTrainer, Serialized Form
    • Constructor Detail

      • RandomClassifier

        public RandomClassifier​(Pipe instancePipe)
    • Method Detail

      • classify

        public Classification classify​(Instance instance)
        Classify an instance using random selection based on the trained data.
        Specified by:
        classify in class Classifier
        Instance - to be classified. Data field must be a FeatureVector.
        Classification containing the labeling of the instance.
      • addTargetLabel

        public void addTargetLabel​(Label label)