|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.udo.cs.yale.operator.AbstractIOObject
edu.udo.cs.yale.operator.ResultObjectAdapter
edu.udo.cs.yale.operator.AbstractModel
edu.udo.cs.yale.operator.IOModel
edu.udo.cs.yale.operator.learner.PredictionModel
edu.udo.cs.yale.operator.learner.meta.AdaBoostModel
public class AdaBoostModel
A model for the Yale AdaBoost implementation.
| Field Summary | |
|---|---|
static java.lang.String |
ID
|
private static java.lang.String |
MAX_MODEL_NUMBER
|
private int |
maxModelNumber
|
private java.util.List<Model> |
models
|
private java.util.List<java.lang.Double> |
weights
|
| Constructor Summary | |
|---|---|
AdaBoostModel()
|
|
AdaBoostModel(Attribute label)
Needed for creation of IOModel (when loading from file). |
|
AdaBoostModel(Attribute label,
java.util.List<Model> models,
java.util.List<java.lang.Double> weights)
|
|
| Method Summary | |
|---|---|
protected Attribute |
createPredictedLabel(ExampleSet exampleSet)
Creates a predicted label with the given name. |
private void |
evaluateSpecialAttributes(ExampleSet exampleSet,
Attribute[] specialAttributes)
|
java.lang.String |
getIdentifier()
|
Model |
getModel(int index)
Getter method for embedded models |
int |
getNumberOfModels()
|
private double |
getWeightForModel(int modelNr)
|
void |
performPrediction(ExampleSet origExampleSet,
Attribute predictedLabel)
Iterates over all models and returns the class with maximum likelihood. |
void |
readPredictionModelData(java.io.ObjectInputStream in)
Reads all models from file. |
void |
setMaxModelNumber(int numModels)
Using this setter with a positive value makes the model discard all but the specified number of base models. |
void |
setParameter(java.lang.String name,
java.lang.String value)
Setting the parameter MAX_MODEL_NUMBER allows to discard
all but the first n models for specified n. |
java.lang.String |
toString()
|
private void |
updateEstimates(ExampleSet exampleSet,
int modelNr,
Attribute[] specialAttributes)
|
void |
writePredictionModelData(java.io.ObjectOutputStream out)
Writes the models subsequently to the output stream. |
| Methods inherited from class edu.udo.cs.yale.operator.learner.PredictionModel |
|---|
apply, getLabel, readData, removePredictedLabel, setLabel, writeData |
| Methods inherited from class edu.udo.cs.yale.operator.AbstractModel |
|---|
equals, getExtension, getFileDescription, readModel, readModel, save, setParameter, writeModel, writeModel |
| Methods inherited from class edu.udo.cs.yale.operator.ResultObjectAdapter |
|---|
addAction, getActions, getName, getVisualisationComponent, toHTML, toResultString |
| Methods inherited from class edu.udo.cs.yale.operator.AbstractIOObject |
|---|
copy, read, read, read, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.udo.cs.yale.operator.ResultObject |
|---|
getActions, getName, getVisualisationComponent, toResultString |
| Methods inherited from interface edu.udo.cs.yale.operator.IOObject |
|---|
copy, write, write |
| Field Detail |
|---|
public static final java.lang.String ID
private java.util.List<Model> models
private java.util.List<java.lang.Double> weights
private int maxModelNumber
private static final java.lang.String MAX_MODEL_NUMBER
| Constructor Detail |
|---|
public AdaBoostModel()
public AdaBoostModel(Attribute label)
label - the class label
public AdaBoostModel(Attribute label,
java.util.List<Model> models,
java.util.List<java.lang.Double> weights)
| Method Detail |
|---|
public void setParameter(java.lang.String name,
java.lang.String value)
throws OperatorException
MAX_MODEL_NUMBER allows to discard
all but the first n models for specified n.
OperatorExceptionpublic void setMaxModelNumber(int numModels)
public java.lang.String getIdentifier()
public void readPredictionModelData(java.io.ObjectInputStream in)
throws java.io.IOException
readPredictionModelData in class PredictionModeljava.io.IOException
public void writePredictionModelData(java.io.ObjectOutputStream out)
throws java.io.IOException
writePredictionModelData in class PredictionModeljava.io.IOExceptionpublic java.lang.String toString()
toString in class PredictionModelString representation of this boosting model.public int getNumberOfModels()
private double getWeightForModel(int modelNr)
public Model getModel(int index)
index - the number of a model part of this boost model
public void performPrediction(ExampleSet origExampleSet,
Attribute predictedLabel)
throws OperatorException
performPrediction in class PredictionModelorigExampleSet - the set of examples to be classified
OperatorException
private void updateEstimates(ExampleSet exampleSet,
int modelNr,
Attribute[] specialAttributes)
private void evaluateSpecialAttributes(ExampleSet exampleSet,
Attribute[] specialAttributes)
protected Attribute createPredictedLabel(ExampleSet exampleSet)
createPredictedLabel in class PredictionModel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||