L
- The type of the labels in the DatasetF
- The type of the features in the Datasetpublic class LogisticClassifier<L,F> extends java.lang.Object implements Classifier<L,F>, RVFClassifier<L,F>
justificationOf(Collection)
Constructor and Description |
---|
LogisticClassifier(boolean biased)
Deprecated.
|
LogisticClassifier(double[] weights,
Index<F> featureIndex,
L[] classes) |
LogisticClassifier(LogPrior prior)
Deprecated.
|
LogisticClassifier(LogPrior prior,
boolean biased)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
L |
classOf(java.util.Collection<F> features) |
L |
classOf(Counter<F> features) |
L |
classOf(Datum<L,F> datum) |
L |
classOf(RVFDatum<L,F> example)
Deprecated.
|
Index<F> |
getFeatureIndex() |
L |
getLabelForInternalNegativeClass() |
L |
getLabelForInternalPositiveClass() |
double[] |
getWeights() |
Counter<F> |
justificationOf(java.util.Collection<F> features)
returns the weights assigned by the classifier to each feature
|
Counter<F> |
justificationOf(Counter<F> features) |
java.util.Collection<L> |
labels() |
static void |
main(java.lang.String[] args)
This runs a simple train and test regime.
|
double |
probabilityOf(java.util.Collection<F> features,
L label) |
double |
probabilityOf(Counter<F> features,
L label) |
double |
probabilityOf(Datum<L,F> example) |
double |
probabilityOf(RVFDatum<L,F> example) |
double |
scoreOf(java.util.Collection<F> features) |
double |
scoreOf(Counter<F> features) |
Counter<L> |
scoresOf(Datum<L,F> datum)
returns the scores for both the classes
|
Counter<L> |
scoresOf(RVFDatum<L,F> example)
Deprecated.
|
java.lang.String |
toString() |
void |
train(GeneralDataset<L,F> data)
Deprecated.
|
void |
train(GeneralDataset<L,F> data,
double l1reg,
double tol)
Deprecated.
|
void |
trainWeightedData(GeneralDataset<L,F> data,
float[] dataWeights)
Deprecated.
|
Counter<F> |
weightsAsCounter() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
evaluateAccuracy, evaluatePrecisionAndRecall
@Deprecated public LogisticClassifier(boolean biased)
@Deprecated public LogisticClassifier(LogPrior prior)
@Deprecated public LogisticClassifier(LogPrior prior, boolean biased)
public java.lang.String toString()
toString
in class java.lang.Object
public L getLabelForInternalPositiveClass()
public L getLabelForInternalNegativeClass()
public double[] getWeights()
public java.util.Collection<L> labels()
labels
in interface Classifier<L,F>
@Deprecated public L classOf(RVFDatum<L,F> example)
classOf
in interface RVFClassifier<L,F>
public double scoreOf(java.util.Collection<F> features)
public Counter<F> justificationOf(java.util.Collection<F> features)
public Counter<L> scoresOf(Datum<L,F> datum)
scoresOf
in interface Classifier<L,F>
@Deprecated public Counter<L> scoresOf(RVFDatum<L,F> example)
scoresOf
in interface RVFClassifier<L,F>
@Deprecated public void trainWeightedData(GeneralDataset<L,F> data, float[] dataWeights)
dataWeights
- weights of the data.@Deprecated public void train(GeneralDataset<L,F> data)
@Deprecated public void train(GeneralDataset<L,F> data, double l1reg, double tol)
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- The arguments/flags are: -trainFile trainFile -testFile testFile [-l1reg num] [-biased]java.lang.Exception