|
|||||||||
| 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.SDEnsemble
public class SDEnsemble
A subgroup discovery model.
| Field Summary | |
|---|---|
private short |
combinationMethod
|
static java.lang.String |
ID
|
private static java.lang.String |
MAX_MODEL_NUMBER
|
private int |
maxModelNumber
|
private java.util.List |
modelInfo
|
private static java.lang.String |
PRED_TO_FILE
|
private java.io.File |
predictionsFile
|
private boolean |
print_to_stdout
|
private double[] |
priors
|
static short |
RULE_COMBINE_ADDITIVE
|
static short |
RULE_COMBINE_MULTIPLY
|
| Constructor Summary | |
|---|---|
SDEnsemble()
Needed for creation of IOModel (when loading from file). |
|
SDEnsemble(Attribute label)
Needed for creation of IOModel (when loading from file). |
|
SDEnsemble(Attribute label,
java.util.List modelInfo,
double[] priors,
short combinationMethod)
|
|
| Method Summary | |
|---|---|
protected Attribute |
createPredictedLabel(ExampleSet exampleSet)
Creates a predicted label with the given name. |
java.lang.String |
getIdentifier()
|
PredictionModel |
getModel(int index)
Getter method for embedded models |
int |
getNumberOfModels()
|
private double |
getPriorOfClass(int classIndex)
Getter method for prior class probabilities estimated as the relative frequencies in the training set. |
private double[] |
getWeightsForModel(int modelNr,
int predicted)
Gets weights for models in the case of general nominal class labels. |
void |
performPrediction(ExampleSet exampleSet,
Attribute predictedLabelAttribute)
Iterates over all models and returns the class with maximum likelihood. |
void |
readPredictionModelData(java.io.ObjectInputStream in)
Reads all models from file. |
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()
|
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
public static final short RULE_COMBINE_ADDITIVE
public static final short RULE_COMBINE_MULTIPLY
private short combinationMethod
private java.util.List modelInfo
private int maxModelNumber
private static final java.lang.String MAX_MODEL_NUMBER
private static final java.lang.String PRED_TO_FILE
private java.io.File predictionsFile
private boolean print_to_stdout
private double[] priors
| Constructor Detail |
|---|
public SDEnsemble()
public SDEnsemble(Attribute label)
label - the class label
public SDEnsemble(Attribute label,
java.util.List modelInfo,
double[] priors,
short combinationMethod)
label - the class labelmodelInfo - a List of Object[2] arrays, each
entry holding a model and a double[][] array
containing weights for all prediction/label combinations.priors - an array of the prior probabilities of labels| Method Detail |
|---|
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 the ruleset.
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. PRED_TO_FILE
requires a filename on the local disk system the predictions of the
single classifiers are written to. print_to_stdout prints
some statistics about the base classifiers to the standard output.
OperatorExceptionpublic int getNumberOfModels()
private double[] getWeightsForModel(int modelNr,
int predicted)
Attribute.FIRST_CLASS_INDEX before calling this method and
before reading from the returned array.
modelNr - the number of the modelpredicted - the predicted label
double[] object with the weights to be applied
for each class if the corresponding rule yields
predicted.private double getPriorOfClass(int classIndex)
classIndex - the index of a class starting with 0 (not the internal YALE
representation!)
public PredictionModel getModel(int index)
index - the number of a model part of this boost model
public void performPrediction(ExampleSet exampleSet,
Attribute predictedLabelAttribute)
throws OperatorException
performPrediction in class PredictionModelexampleSet - the set of examples to be classified
OperatorExceptionprotected Attribute createPredictedLabel(ExampleSet exampleSet)
createPredictedLabel in class PredictionModel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||