All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cc.mallet.classify.RandomClassifier Maven / Gradle / Ivy

Go to download

MALLET is a Java-based package for statistical natural language processing, document classification, clustering, topic modeling, information extraction, and other machine learning applications to text.

The newest version!
/* 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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy