Author: ogrisel
Date: Fri Jan 13 11:22:26 2012
New Revision: 1231008
URL: http://svn.apache.org/viewvc?rev=1231008&view=rev
Log:
STANBOL-197: better class name for evaluation results and missing javadoc
Added:
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/ClassificationReport.java
Removed:
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/ClassificationPerformance.java
Modified:
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/engine/topic/TopicClassificationEngine.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/engine/topic/TopicClassificationEngine.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/engine/topic/TopicClassificationEngine.java?rev=1231008&r1=1231007&r2=1231008&view=diff
==============================================================================
---
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/engine/topic/TopicClassificationEngine.java
(original)
+++
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/engine/topic/TopicClassificationEngine.java
Fri Jan 13 11:22:26 2012
@@ -65,7 +65,7 @@ import org.apache.stanbol.enhancer.servi
import org.apache.stanbol.enhancer.servicesapi.helper.EnhancementEngineHelper;
import org.apache.stanbol.enhancer.servicesapi.rdf.TechnicalClasses;
import org.apache.stanbol.enhancer.topic.Batch;
-import org.apache.stanbol.enhancer.topic.ClassificationPerformance;
+import org.apache.stanbol.enhancer.topic.ClassificationReport;
import org.apache.stanbol.enhancer.topic.ClassifierException;
import org.apache.stanbol.enhancer.topic.ConfiguredSolrCoreTracker;
import org.apache.stanbol.enhancer.topic.TopicClassifier;
@@ -698,7 +698,7 @@ public class TopicClassificationEngine e
}
@Override
- public ClassificationPerformance getPerformanceEstimates(String topic)
throws ClassifierException {
+ public ClassificationReport getPerformanceEstimates(String topic) throws
ClassifierException {
// TODO Auto-generated method stub
return null;
}
Added:
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=1231008&view=auto
==============================================================================
---
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/ClassificationReport.java
(added)
+++
incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/ClassificationReport.java
Fri Jan 13 11:22:26 2012
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.stanbol.enhancer.topic;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Data transfer object to report estimated classification performance of a
classifier.
+ *
+ * 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
+ *
+ * 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).
+ */
+public class ClassificationReport {
+
+ /**
+ * Number of true positives divided by the sum of true positives and false
positives.
+ */
+ public final float precision;
+
+ /**
+ * Number of true positives divided by the sum of true positives and false
negatives.
+ */
+ public final float recall;
+
+ /**
+ * Harmonic mean of the precision and recall that balance the importance
of false positive and false
+ * negatives equally.
+ */
+ public final float f1;
+
+ public final List<String> falsePositiveExampleIds = new
ArrayList<String>();
+
+ public final List<String> falseNegativeExampleIds = new
ArrayList<String>();
+
+ public ClassificationReport(float precision, float recall, float f1) {
+ this.precision = precision;
+ this.recall = recall;
+ this.f1 = f1;
+ }
+
+}
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=1231008&r1=1231007&r2=1231008&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 11:22:26 2012
@@ -142,5 +142,5 @@ public interface TopicClassifier {
*/
void destroyModel() throws ClassifierException;
- ClassificationPerformance getPerformanceEstimates(String topic) throws
ClassifierException;
+ ClassificationReport getPerformanceEstimates(String topic) throws
ClassifierException;
}