com.wcohen.ss
Class AdaptiveStringDistanceLearner

java.lang.Object
  extended by com.wcohen.ss.CombinedStringDistanceLearner
      extended by com.wcohen.ss.AdaptiveStringDistanceLearner
All Implemented Interfaces:
StringDistanceLearner

public class AdaptiveStringDistanceLearner
extends CombinedStringDistanceLearner

Abstract StringDistanceLearner class which averages results of a number of inner distance metrics, learned by a number of inner distance learners.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.wcohen.ss.CombinedStringDistanceLearner
CombinedStringDistanceLearner.CombinedStringDistance, CombinedStringDistanceLearner.JthDistanceInstanceIterator, CombinedStringDistanceLearner.JthStringWrapperValueIterator, CombinedStringDistanceLearner.MyDistanceInstance, CombinedStringDistanceLearner.MyMultiDistanceInstance
 
Field Summary
 
Fields inherited from class com.wcohen.ss.CombinedStringDistanceLearner
delim, innerLearners
 
Constructor Summary
AdaptiveStringDistanceLearner()
           
AdaptiveStringDistanceLearner(com.wcohen.cls.BinaryClassifierLearner comboLearner)
           
AdaptiveStringDistanceLearner(StringDistanceLearner[] innerLearners, java.lang.String delim, com.wcohen.cls.BinaryClassifierLearner comboLearner)
           
 
Method Summary
protected  void comboAddExample(DistanceInstance distanceInstance)
          Pass a labeled example to the score-combination learner.
protected  boolean comboHasNextQuery()
          Poll the routine that learns to combine inner distance scores to see if it wants to make more queries.
protected  DistanceInstance comboNextQuery()
          Get the next query from the score-combination learner.
protected  void comboSetDistanceInstancePool(java.util.Iterator it)
          Set up a pool of (possibly unlabeled) instance distances, for the learner to make queries from.
protected  void comboSetStringWrapperPool(java.util.Iterator it)
          Pass an iterator over unlabeled string wrappers to the score-combination learner, just in case that's useful.
 StringDistance getDistance()
          Get the final string distance, which will be based on the distances learned by the inner learners, as well as the combination scheme learned by comboSetAnswer, comboTrain, and etc.
 
Methods inherited from class com.wcohen.ss.CombinedStringDistanceLearner
addExample, asMultiDistanceInstance, asMultiDistanceInstanceList, asMultiStringWrapper, asMultiStringWrapperList, getInnerDistances, hasNextQuery, nextQuery, prepare, prepare, setDistanceInstancePool, setStringWrapperPool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdaptiveStringDistanceLearner

public AdaptiveStringDistanceLearner()

AdaptiveStringDistanceLearner

public AdaptiveStringDistanceLearner(com.wcohen.cls.BinaryClassifierLearner comboLearner)

AdaptiveStringDistanceLearner

public AdaptiveStringDistanceLearner(StringDistanceLearner[] innerLearners,
                                     java.lang.String delim,
                                     com.wcohen.cls.BinaryClassifierLearner comboLearner)
Method Detail

comboSetStringWrapperPool

protected void comboSetStringWrapperPool(java.util.Iterator it)
Description copied from class: CombinedStringDistanceLearner
Pass an iterator over unlabeled string wrappers to the score-combination learner, just in case that's useful.

Specified by:
comboSetStringWrapperPool in class CombinedStringDistanceLearner

comboSetDistanceInstancePool

protected void comboSetDistanceInstancePool(java.util.Iterator it)
Description copied from class: CombinedStringDistanceLearner
Set up a pool of (possibly unlabeled) instance distances, for the learner to make queries from.

Specified by:
comboSetDistanceInstancePool in class CombinedStringDistanceLearner

comboHasNextQuery

protected boolean comboHasNextQuery()
Description copied from class: CombinedStringDistanceLearner
Poll the routine that learns to combine inner distance scores to see if it wants to make more queries.

Specified by:
comboHasNextQuery in class CombinedStringDistanceLearner

comboNextQuery

protected DistanceInstance comboNextQuery()
Description copied from class: CombinedStringDistanceLearner
Get the next query from the score-combination learner.

Specified by:
comboNextQuery in class CombinedStringDistanceLearner

comboAddExample

protected void comboAddExample(DistanceInstance distanceInstance)
Description copied from class: CombinedStringDistanceLearner
Pass a labeled example to the score-combination learner.

Specified by:
comboAddExample in class CombinedStringDistanceLearner

getDistance

public StringDistance getDistance()
Description copied from class: CombinedStringDistanceLearner
Get the final string distance, which will be based on the distances learned by the inner learners, as well as the combination scheme learned by comboSetAnswer, comboTrain, and etc.

Specified by:
getDistance in interface StringDistanceLearner
Specified by:
getDistance in class CombinedStringDistanceLearner