public class MultinomialLogisticClassifier<L,F> extends java.lang.Object implements ProbabilisticClassifier<L,F>, RVFClassifier<L,F>
Constructor and Description |
---|
MultinomialLogisticClassifier(double[][] weights,
Index<F> featureIndex,
Index<L> labelIndex) |
Modifier and Type | Method and Description |
---|---|
L |
classOf(Datum<L,F> example) |
L |
classOf(RVFDatum<L,F> example) |
java.util.Collection<L> |
labels() |
Counter<L> |
logProbabilityOf(Datum<L,F> example) |
Counter<L> |
probabilityOf(Datum<L,F> example) |
Counter<L> |
scoresOf(Datum<L,F> example) |
Counter<L> |
scoresOf(RVFDatum<L,F> example) |
java.util.Map<L,Counter<F>> |
weightsAsGenericCounter() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
evaluateAccuracy, evaluatePrecisionAndRecall
public MultinomialLogisticClassifier(double[][] weights, Index<F> featureIndex, Index<L> labelIndex)
weights
- A (numClasses - 1) by numFeatures matrix that holds the weight array for each
class. Note that only (numClasses - 1) rows are needed, as the probability for last class is
uniquely determined by the others.public java.util.Collection<L> labels()
labels
in interface Classifier<L,F>
public Counter<L> scoresOf(Datum<L,F> example)
scoresOf
in interface Classifier<L,F>
public L classOf(RVFDatum<L,F> example)
classOf
in interface RVFClassifier<L,F>
public Counter<L> scoresOf(RVFDatum<L,F> example)
scoresOf
in interface RVFClassifier<L,F>
public Counter<L> probabilityOf(Datum<L,F> example)
probabilityOf
in interface ProbabilisticClassifier<L,F>
public Counter<L> logProbabilityOf(Datum<L,F> example)
logProbabilityOf
in interface ProbabilisticClassifier<L,F>