|
||||||||||
| 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.AdaBoost
public class AdaBoost
Implementation of the AdaBoost binary classification learning algorithm.
A Classifier learned with this algorithm will always produce
a single Feature with value equal to a value the weak learner
is capable of producing. This implementation samples from its internal
distribution, giving the weak learner a new set of examples that the weak
learner assumes are weighted equally.
Assumptions:
Learner used as the weak learner is cloneable.
| Field Summary | |
|---|---|
private double[] |
alpha
Parameters associated with the trained copies of the weak learner. |
protected int |
rounds
The number of times the weak learner will be called. |
protected Learner |
weakLearner
The weak learning algorithm to be boosted. |
private Learner[] |
weakLearners
Will be filled with trained copies of the weak learner. |
| Fields inherited from class LBJ2.learn.Learner |
|---|
extractor, labeler |
| Fields inherited from class LBJ2.classify.Classifier |
|---|
containingPackage, name |
| Constructor Summary | |
|---|---|
AdaBoost()
This constructor is used by the LBJ2 compiler; it should never be called by a programmer. |
|
AdaBoost(java.lang.String n,
Learner w,
int r)
Instantiates member variables. |
|
| Method Summary | |
|---|---|
FeatureVector |
classify(java.lang.Object example)
This method uses the trained parameters to make a binary decision about an example object. |
java.lang.Object |
clone()
Returns a deep clone of this learning algorithm. |
void |
forget()
Clears weakLearners and alpha, although this
is not necessary since learn(Object[]) will overwrite them
fresh each time it is called. |
void |
learn(java.lang.Object e)
This implementation of AdaBoost cannot be trained in an online fashion, so this method simply reports an error. |
void |
learn(java.lang.Object[] examples)
The AdaBoost training algorithm. |
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 |
setExtractor(Classifier e)
Sets the extractor. |
void |
setLabeler(Classifier l)
Sets the labeler. |
void |
write(java.io.PrintStream out)
Writes this algorithm's internal representation as text. |
| Methods inherited from class LBJ2.learn.Learner |
|---|
doneLearning, getExtractor, getLabeler, 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 |
|---|
protected Learner weakLearner
protected int rounds
private Learner[] weakLearners
private double[] alpha
| Constructor Detail |
|---|
public AdaBoost()
public AdaBoost(java.lang.String n,
Learner w,
int r)
n - The name of the classifier.w - The weak learning algorithm.r - The number of rounds of boosting.| Method Detail |
|---|
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 e)
learn in class Learnere - The parameter will be ignored.public void learn(java.lang.Object[] examples)
learn in class Learnerexamples - The entire training set.public void forget()
weakLearners and alpha, although this
is not necessary since learn(Object[]) will overwrite them
fresh each time it is called.
forget in class Learnerpublic ScoreSet scores(java.lang.Object example)
scores in class Learnerexample - The object to make decisions about.
public FeatureVector classify(java.lang.Object example)
classify in class Classifierexample - The example object.
DiscreteFeature.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 | |||||||||