[Home] DMelt member access. Java source code: cc.mallet.classify.RandomClassifier
/* This file is part of "MALLET" (MAchine Learning for LanguagE Toolkit).
http://www.cs.umass.edu/~mccallum/mallet
This software is provided under the terms of the Common Public License,
version 1.0, as published by http://www.opensource.org. For further
information, see the file `LICENSE' included with this distribution. */
package cc.mallet.classify;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import cc.mallet.classify.Classification;
import cc.mallet.classify.Classifier;
import cc.mallet.pipe.Pipe;
import cc.mallet.types.Instance;
import cc.mallet.types.Label;
/**
* 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