Class RandomClassifier

  • All Implemented Interfaces:
    AlphabetCarrying, java.io.Serializable

    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
    Author:
    Martin Wunderlich martin@wunderlich.com
    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
        Parameters:
        Instance - to be classified. Data field must be a FeatureVector.
        Returns:
        Classification containing the labeling of the instance.
      • addTargetLabel

        public void addTargetLabel​(Label label)