|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectLBJ2.classify.Classifier
LBJ2.learn.Learner
LBJ2.learn.MuxLearner
public class MuxLearner
A MuxLearner uses one of many Learners indexed
by the first feature in an example to produce a classification. During
training, the features produced by the first child classifier of this
classifier's composite generator feature extractor are taken to determine
which Learners will learn from the training object. For any
given example, there must be one Feature produced by the
labeler for each Feature produced by the first child
classifier. If this classifier's feature extractor is not a composite
generator, the first feature it produces is the only one taken.
It is assumed that the Learner being multiplexed expects
a single label feature on each training example, and that the feature(s)
used to do the multiplexing are DiscreteFeature(s).
Furthermore, if this classifier's feature extractor is a composite
generator, it must produce the same number of features as this
classifier's labeler, and they must correspond to each other in the order
produced.
This algorithm's user-configurable parameters are stored in member
fields of this class. They may be set via either a constructor that names
each parameter explicitly or a constructor that takes an instance of
Parameters as input. The
documentation in each member field in this class indicates the default
value of the associated parameter when using the former type of
constructor. The documentation of the associated member field in the
Parameters class indicates the
default value of the parameter when using the latter type of constructor.
| Nested Class Summary | |
|---|---|
static class |
MuxLearner.Parameters
Simply a container for all of MuxLearner's configurable
parameters. |
| Field Summary | |
|---|---|
protected Learner |
baseLearner
Instances of this learning algorithm will be multiplexed; default null. |
protected java.util.LinkedList |
compositeChildren
If this classifier's feature extractor is a composite generator, this list will contain every child classifier of that composite generator except the first; otherwise, it is null. |
static java.lang.String |
defaultDefaultPrediction
Default for defaultPrediction. |
protected java.lang.String |
defaultPrediction
This string is returned during testing when the multiplexed Learner doesn't exist; default
defaultDefaultPrediction. |
protected java.util.HashMap |
network
A map from feature values to learners. |
protected Classifier |
select
If this classifier's feature extractor is a composite generator, this member variable will reference the first child classifier of that composite generator; otherwise, it is null. |
| Fields inherited from class LBJ2.learn.Learner |
|---|
extractor, labeler |
| Fields inherited from class LBJ2.classify.Classifier |
|---|
containingPackage, name |
| Constructor Summary | |
|---|---|
MuxLearner()
For the LBJ compiler; not for use by the LBJ user. |
|
MuxLearner(Learner base)
Instantiates this multiplexed learner using the specified base learning algorithm. |
|
MuxLearner(Learner base,
java.lang.String d)
Instantiates this multiplexed learner using the specified base learning algorithm. |
|
MuxLearner(MuxLearner.Parameters p)
Initializing constructor. |
|
MuxLearner(java.lang.String n)
For the LBJ compiler; not for use by the LBJ user. |
|
MuxLearner(java.lang.String n,
Learner base)
Instantiates this multiplexed learner using the specified base learning algorithm. |
|
MuxLearner(java.lang.String n,
Learner base,
java.lang.String d)
Instantiates this multiplexed learner using the specified base learning algorithm. |
|
MuxLearner(java.lang.String n,
MuxLearner.Parameters p)
Initializing constructor. |
|
| Method Summary | |
|---|---|
FeatureVector |
classify(java.lang.Object example)
This method performs the multiplexing and returns the output of the selected Learner. |
java.lang.Object |
clone()
Returns a deep clone of this learning algorithm. |
void |
forget()
Clears the network. |
void |
learn(java.lang.Object example)
The training example is multiplexed to the appropriate Learner(s). |
ScoreSet |
scores(java.lang.Object example)
Produces a set of scores indicating the degree to which each possible discrete classification value is associated with the given example object. |
void |
setBase(Learner base)
Sets baseLearner. |
void |
setExtractor(Classifier e)
Sets the extractor. |
void |
setLabeler(Classifier l)
Sets the labeler. |
void |
write(java.io.PrintStream out)
Writes the algorithm's internal representation as text. |
| Methods inherited from class LBJ2.learn.Learner |
|---|
doneLearning, getExtractor, getLabeler, learn, save |
| Methods inherited from class LBJ2.classify.Classifier |
|---|
allowableValues, binaryRead, binaryRead, binaryRead, binaryRead, binaryWrite, binaryWrite, classify, discreteValue, discreteValueArray, getCompositeChildren, getInputType, getOutputType, realValue, realValueArray, test, toString, valueIndexOf |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String defaultDefaultPrediction
defaultPrediction.
protected Learner baseLearner
null.
protected java.util.HashMap network
protected java.lang.String defaultPrediction
Learner doesn't exist; default
defaultDefaultPrediction.
protected Classifier select
null.
protected java.util.LinkedList compositeChildren
null.
| Constructor Detail |
|---|
public MuxLearner()
public MuxLearner(Learner base)
base - Instances of this learner will be multiplexed.
public MuxLearner(Learner base,
java.lang.String d)
base - Instances of this learner will be multiplexed.d - This prediction will be returned during testing when the
multiplexed Learner does not exist.public MuxLearner(MuxLearner.Parameters p)
MuxLearner.Parameters object.
p - The settings of all parameters.public MuxLearner(java.lang.String n)
public MuxLearner(java.lang.String n,
Learner base)
n - The name of the classifier.base - Instances of this learner will be multiplexed.
public MuxLearner(java.lang.String n,
Learner base,
java.lang.String d)
n - The name of the classifier.base - Instances of this learner will be multiplexed.d - This prediction will be returned during testing when the
multiplexed Learner does not exist.
public MuxLearner(java.lang.String n,
MuxLearner.Parameters p)
MuxLearner.Parameters object.
n - The name of the classifier.p - The settings of all parameters.| Method Detail |
|---|
public void setBase(Learner base)
baseLearner. This method will not have any effect
on the learners that already exist in the network. However, new
learners created after this method is executed will be of the same type
as the object specified.
base - The new base learning algorithm.public void setLabeler(Classifier l)
setLabeler in class Learnerl - A labeling classifier.public void setExtractor(Classifier e)
setExtractor in class Learnere - A feature extracting classifier.public void learn(java.lang.Object example)
Learner(s).
learn in class Learnerexample - The example object.public void forget()
forget in class Learnerpublic ScoreSet scores(java.lang.Object example)
Learner's scores(Object) method.
scores in class Learnerexample - The example object.
Learner.scores(Object)public FeatureVector classify(java.lang.Object example)
Learner.
classify in class Classifierexample - The example object.
Learner.public void write(java.io.PrintStream out)
write in class Learnerout - The output stream.public java.lang.Object clone()
clone in class Classifier
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||