public abstract class CombinedStringDistanceLearner extends Object implements StringDistanceLearner
| Modifier and Type | Class and Description |
|---|---|
protected class |
CombinedStringDistanceLearner.CombinedStringDistance
Abstract class for combining innerDistances's
|
protected class |
CombinedStringDistanceLearner.JthDistanceInstanceIterator
Iterate over the j-th field of MultiStringWrapper's in a DistanceInstance of MultiStringWrapper's
|
protected class |
CombinedStringDistanceLearner.JthStringWrapperValueIterator
Iterate over the j-th field of MultiStringWrapper
|
protected class |
CombinedStringDistanceLearner.MyDistanceInstance |
protected class |
CombinedStringDistanceLearner.MyMultiDistanceInstance |
| Modifier and Type | Field and Description |
|---|---|
protected String |
delim |
protected StringDistanceLearner[] |
innerLearners |
| Constructor and Description |
|---|
CombinedStringDistanceLearner() |
CombinedStringDistanceLearner(StringDistanceLearner[] innerLearners,
String delim) |
| Modifier and Type | Method and Description |
|---|---|
void |
addExample(DistanceInstance answeredQuery)
Pass new labels to the sublearners.
|
protected CombinedStringDistanceLearner.MyMultiDistanceInstance |
asMultiDistanceInstance(DistanceInstance di) |
protected List |
asMultiDistanceInstanceList(DistanceInstanceIterator i) |
protected MultiStringWrapper |
asMultiStringWrapper(StringWrapper w) |
protected List |
asMultiStringWrapperList(StringWrapperIterator i) |
protected abstract void |
comboAddExample(DistanceInstance di)
Pass a labeled example to the score-combination learner.
|
protected abstract boolean |
comboHasNextQuery()
Poll the routine that learns to combine inner distance scores to see if it
wants to make more queries.
|
protected abstract DistanceInstance |
comboNextQuery()
Get the next query from the score-combination learner.
|
protected abstract void |
comboSetDistanceInstancePool(Iterator i)
Set up a pool of (possibly unlabeled) instance distances, for the learner
to make queries from.
|
protected abstract void |
comboSetStringWrapperPool(Iterator i)
Pass an iterator over unlabeled string wrappers to the score-combination learner,
just in case that's useful.
|
abstract 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.
|
protected StringDistance[] |
getInnerDistances()
Get an array of trained inner distances.
|
boolean |
hasNextQuery()
See if someone has a query
|
DistanceInstance |
nextQuery()
Get a next query from one of the sublearners
|
DistanceInstanceIterator |
prepare(DistanceInstanceIterator it)
Prepare data for the learners.
|
StringWrapperIterator |
prepare(StringWrapperIterator it)
Prepare data for the sublearners.
|
void |
setDistanceInstancePool(DistanceInstanceIterator it)
Pass the training data along to the inner learners.
|
void |
setStringWrapperPool(StringWrapperIterator it)
Pass the training data along to the inner learners.
|
protected StringDistanceLearner[] innerLearners
protected String delim
public CombinedStringDistanceLearner()
public CombinedStringDistanceLearner(StringDistanceLearner[] innerLearners, String delim)
protected abstract void comboSetStringWrapperPool(Iterator i)
protected abstract void comboSetDistanceInstancePool(Iterator i)
protected abstract boolean comboHasNextQuery()
protected abstract DistanceInstance comboNextQuery()
protected abstract void comboAddExample(DistanceInstance di)
public abstract StringDistance getDistance()
getDistance in interface StringDistanceLearnerpublic void setStringWrapperPool(StringWrapperIterator it)
setStringWrapperPool in interface StringDistanceLearnerpublic void setDistanceInstancePool(DistanceInstanceIterator it)
setDistanceInstancePool in interface StringDistanceLearnerpublic boolean hasNextQuery()
hasNextQuery in interface StringDistanceLearnerpublic DistanceInstance nextQuery()
nextQuery in interface StringDistanceLearnerpublic void addExample(DistanceInstance answeredQuery)
addExample in interface StringDistanceLearnerpublic StringWrapperIterator prepare(StringWrapperIterator it)
prepare in interface StringDistanceLearnerpublic DistanceInstanceIterator prepare(DistanceInstanceIterator it)
prepare in interface StringDistanceLearnerprotected List asMultiStringWrapperList(StringWrapperIterator i)
protected MultiStringWrapper asMultiStringWrapper(StringWrapper w)
protected List asMultiDistanceInstanceList(DistanceInstanceIterator i)
protected CombinedStringDistanceLearner.MyMultiDistanceInstance asMultiDistanceInstance(DistanceInstance di)
protected StringDistance[] getInnerDistances()
Copyright © 2016. All rights reserved.