|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.types.ROCData
public class ROCData
Tracks ROC data for instances in Trial
results.
Trial
,
InstanceList
,
Classifier
,
Classification
,
Serialized FormField Summary | |
---|---|
static int |
FALSE_NEGATIVE
|
static int |
FALSE_POSITIVE
|
static int |
TRUE_NEGATIVE
|
static int |
TRUE_POSITIVE
|
Constructor Summary | |
---|---|
ROCData(double[] thresholds,
LabelAlphabet labelAlphabet)
Constructs a new object |
Method Summary | |
---|---|
void |
add(Classification classification)
Adds classification results to the ROC data |
void |
add(ROCData rocData)
Adds existing ROC data to this ROC data |
void |
add(Trial trial)
Adds trial results to the ROC data |
Alphabet |
getAlphabet()
|
Alphabet[] |
getAlphabets()
|
int[][] |
getCounts(Label label)
Gets the raw counts for a specified label. |
int[] |
getCounts(Label label,
double threshold)
Gets the raw counts for a specified label and threshold. |
LabelAlphabet |
getLabelAlphabet()
Gets the label alphabet |
double |
getPositivePercent(Label label,
double threshold)
Gets the estimated percentage of training events that exceed the threshold. |
double |
getPrecision(Label label,
double threshold)
Gets the precision for a specified label and threshold. |
double |
getPrecisionForScore(Label label,
double score)
Gets the precision for a specified label and score. |
double |
getRecall(Label label,
double threshold)
Gets the recall rate for a specified label and threshold. |
double[] |
getThresholds()
Gets the thresholds being tracked |
void |
setCounts(Label label,
double threshold,
int[] newCounts)
Sets the raw counts for a specified label and threshold. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TRUE_POSITIVE
public static final int FALSE_POSITIVE
public static final int FALSE_NEGATIVE
public static final int TRUE_NEGATIVE
Constructor Detail |
---|
public ROCData(double[] thresholds, LabelAlphabet labelAlphabet)
thresholds
- Array of thresholds to track counts forlabelAlphabet
- Label alphabet for instances in Trial
Method Detail |
---|
public void add(Classification classification)
trial
- Trial results to add to ROC datapublic void add(Trial trial)
trial
- Trial results to add to ROC datapublic void add(ROCData rocData)
rocData
- ROC data to addpublic Alphabet getAlphabet()
getAlphabet
in interface AlphabetCarrying
public Alphabet[] getAlphabets()
getAlphabets
in interface AlphabetCarrying
public int[][] getCounts(Label label)
label
- Label to get counts for
TRUE_POSITIVE
,
FALSE_POSITIVE
,
FALSE_NEGATIVE
,
TRUE_NEGATIVE
public int[] getCounts(Label label, double threshold)
label
- Label to get counts forthreshold
- Threshold to get counts for
TRUE_POSITIVE
,
FALSE_POSITIVE
,
FALSE_NEGATIVE
,
TRUE_NEGATIVE
public LabelAlphabet getLabelAlphabet()
public double getPrecision(Label label, double threshold)
label
- Label to get precision forthreshold
- Threshold to get precision for
public double getPrecisionForScore(Label label, double score)
ROCData.getPrecision(Label, double)
in that it is the precision
for only scores falling in the one score value, not for all scores
above the threshold.
If data was not collected for the exact threshold specified, then results
will for the highest threshold <= the specified threshold will be
returned.
label
- Label to get precision forthreshold
- Threshold to get precision for
public double getPositivePercent(Label label, double threshold)
label
- Label to get precision forthreshold
- Threshold to get precision for
public double getRecall(Label label, double threshold)
label
- Label to get recall forthreshold
- Threshold to get recall for
public double[] getThresholds()
public void setCounts(Label label, double threshold, int[] newCounts)
label
- Label to get counts forthreshold
- Threshold to get counts fornewCounts
- New count values for the label and thresholdTRUE_POSITIVE
,
FALSE_POSITIVE
,
FALSE_NEGATIVE
,
TRUE_NEGATIVE
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |