Author: ogrisel
Date: Fri Jan 13 14:26:03 2012
New Revision: 1231089
URL: http://svn.apache.org/viewvc?rev=1231089&view=rev
Log:
STANBOL-197: more javadoc improvement
Modified:
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/ClassificationReport.java
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/TopicClassifier.java
Modified:
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/ClassificationReport.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/ClassificationReport.java?rev=1231089&r1=1231088&r2=1231089&view=diff
==============================================================================
---
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/ClassificationReport.java
(original)
+++
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/ClassificationReport.java
Fri Jan 13 14:26:03 2012
@@ -21,15 +21,21 @@ import java.util.List;
/**
* Data transfer object to report estimated classification performance of a
classifier.
- *
+ *
+ * <p>
* Report scores to evaluate the quality of a model on a labeled evaluation
dataset (that should not have been
- * used when training the model). See:
- *
- * http://en.wikipedia.org/wiki/Precision_and_recall
- *
+ * used when training the model).
+ * </p>
+ *
+ * <p>
+ * See: http://en.wikipedia.org/wiki/Precision_and_recall
+ * </p>
+ *
+ * <p>
* Precision, Recall are F1-score and preferred over a simple rate of good
classification so as to account for
* potentially imbalanced evaluation set (e.g. when the number of negative
examples is much larger than the
* number of positive examples).
+ * </p>
*/
public class ClassificationReport {
@@ -49,14 +55,30 @@ public class ClassificationReport {
*/
public final float f1;
+ /**
+ * Total number of positive examples used by the evaluation procedure.
+ */
+ public final int positiveSupport;
+
+ /**
+ * Total number of negative examples used by the evaluation procedure.
+ */
+ public final int negativeSupport;
+
public final List<String> falsePositiveExampleIds = new
ArrayList<String>();
public final List<String> falseNegativeExampleIds = new
ArrayList<String>();
- public ClassificationReport(float precision, float recall, float f1) {
+ public ClassificationReport(float precision,
+ float recall,
+ float f1,
+ int positiveSupport,
+ int negativeSupport) {
this.precision = precision;
this.recall = recall;
this.f1 = f1;
+ this.positiveSupport = positiveSupport;
+ this.negativeSupport = negativeSupport;
}
}
Modified:
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/TopicClassifier.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/TopicClassifier.java?rev=1231089&r1=1231088&r2=1231089&view=diff
==============================================================================
---
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/TopicClassifier.java
(original)
+++
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/TopicClassifier.java
Fri Jan 13 14:26:03 2012
@@ -142,5 +142,9 @@ public interface TopicClassifier {
*/
void destroyModel() throws ClassifierException;
+ /**
+ * Get a classification report with various accuracy metrics (precision,
recall and f1-score) along with
+ * the example ids of some mistakes (false positives or false negatives).
+ */
ClassificationReport getPerformanceEstimates(String topic) throws
ClassifierException;
}