ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1585777 - in /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal: ae/EventAnnotator.java eval/EvaluationOfEventSpans.java
Date Tue, 08 Apr 2014 16:30:11 GMT
Author: tmill
Date: Tue Apr  8 16:30:10 2014
New Revision: 1585777

URL: http://svn.apache.org/r1585777
Log:
CTAKES-82: Fixed feature selection threshold to be logical and consistent across classes.

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventSpans.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java?rev=1585777&r1=1585776&r2=1585777&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
Tue Apr  8 16:30:10 2014
@@ -85,7 +85,7 @@ public class EventAnnotator extends Temp
       name = PARAM_FEATURE_SELECTION_THRESHOLD,
       mandatory = false,
       description = "the Chi-squared threshold at which features should be removed")
-  protected Float featureSelectionThreshold = 1f; //default is not using feature selection,
i.e. select 100% of all features.
+  protected Float featureSelectionThreshold = -1f; //default is not using feature selection,
i.e. select 100% of all features.
   
   public static final String PARAM_SMOTE_NUM_NEIGHBORS = "NumOfNeighborForSMOTE";
 
@@ -197,7 +197,7 @@ public class EventAnnotator extends Temp
         new Preceding(3),
         new Following(3));
 
-    if (featureSelectionThreshold == 1) {
+    if (featureSelectionThreshold < 0) {
       this.featureSelection = null;
     } else {
       this.featureSelection = EventAnnotator.createFeatureSelection(this.featureSelectionThreshold);

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventSpans.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventSpans.java?rev=1585777&r1=1585776&r2=1585777&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventSpans.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventSpans.java
Tue Apr  8 16:30:10 2014
@@ -49,7 +49,7 @@ public class EvaluationOfEventSpans exte
     @Option(longName = "downratio", defaultValue = "1")
     public float getProbabilityOfKeepingANegativeExample();
 
-    @Option(longName = "featureSelectionThreshold", defaultValue = "1")
+    @Option(longName = "featureSelectionThreshold", defaultValue = "-1")
     public float getFeatureSelectionThreshold();
 
     @Option(longName = "SMOTENeighborNumber", defaultValue = "0")
@@ -110,7 +110,7 @@ public class EvaluationOfEventSpans exte
   @Override
   protected AnalysisEngineDescription getDataWriterDescription(File directory)
       throws ResourceInitializationException {
-    Class<?> dataWriterClass = this.featureSelectionThreshold > 0f
+    Class<?> dataWriterClass = this.featureSelectionThreshold >= 0f
         ? InstanceDataWriter.class
         : LIBLINEARStringOutcomeDataWriter.class;
     return EventAnnotator.createDataWriterDescription(



Mime
View raw message