public class CompositeRegression extends BaseRegression implements MultiModel
Has the ability to return the variance in predictions between submodels, which
can be used as a measure of their composite reliability.
Usage: *No options to set*
Implemented Commands:
submodel - Print the number of submodels submodel set generic $<model> - Define a model template to use for all submodels
submodel set <number> $<model - Set a specific submodel
<output> = submodel get generic - Retrieve the template for any unassigned submodels <output = submodel get <number> - Retrieve a specific submodel
| Modifier and Type | Field and Description |
|---|---|
BaseRegression |
GenericModel
Generic composite regression model (use wisely)
|
java.util.List<BaseRegression> |
Model
Collections of models used by this class
|
AttributeSelector, trained, TrainingStats, validated, ValidationStats| Constructor and Description |
|---|
CompositeRegression() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkStatus() |
CompositeRegression |
clone() |
double[] |
getEnsembleMean(Dataset Data)
Get mean prediction by the ensemble for each entry
|
double[] |
getEnsembleMean(double[][] EnsemblePredictions)
Get mean prediction by the ensemble for each entry
|
double[][] |
getEnsemblePredictions(Dataset Data)
Calculate the predicted class using each model
|
double[] |
getEnsembleVariation(Dataset Data)
Return the variance in predictions for each entry.
|
double[] |
getEnsembleVariation(double[][] EnsemblePredictions)
Return the variance in predictions for each entry.
|
BaseRegression |
getGenericModel()
Get the model template
|
BaseModel |
getModel(int index)
Get a specific submodel.
|
int |
getNFittingParameters()
Number of fitting parameters in a model.
|
int |
NModels()
Get the number of models in ensemble
|
java.lang.String |
printModel_protected()
Internal method that handles printing the model as a string.
|
java.util.List<java.lang.String> |
printModelDescriptionDetails(boolean htmlFormat)
Print details of the model.
|
java.lang.String |
printUsage()
Print out required format for options.
|
void |
run_protected(Dataset TestData)
Run a model without checking if stuff is trained (use carefully)
|
java.lang.Object |
runCommand(java.util.List<java.lang.Object> Command)
Process some command described by a list of Objects.
|
void |
setGenericModel(BaseModel x)
Set the model template
|
void |
setModel(int index,
BaseModel x)
Set a specific submodel.
|
void |
setNumberOfModels(int n)
Defines the number of models to be trained.
|
void |
setOptions(java.util.List Options)
Set any options for this object.
|
protected void |
train_protected(Dataset TrainData)
Train a model without evaluating performance
|
doRobustRegression, getRobustRegressionQ, robustTraining, setRobustRegressionQabout, crossValidate, crossValidate, crossValidate, done, externallyValidate, getAttributeSelector, getCitations, getFilter, getTrainTime, getValidationMethod, handleSetCommand, isTrained, isValidated, loadState, printCommand, printDescription, printModel, resetModel, run, saveCommand, saveState, setAttributeSelector, setComponent, setFilter, train, trainpublic java.util.List<BaseRegression> Model
public BaseRegression GenericModel
public void setOptions(java.util.List Options)
throws java.lang.Exception
OptionssetOptions in interface OptionsOptions - Array of options as Objects - can be nulljava.lang.Exception - if problem with inputspublic java.lang.String printUsage()
OptionsprintUsage in interface Optionspublic BaseModel getModel(int index)
MultiModelgetModel in interface MultiModelindex - Model to retrievepublic int NModels()
NModels in interface MultiModelpublic void setNumberOfModels(int n)
MultiModelsetNumberOfModels in interface MultiModeln - Number of models to usepublic void setGenericModel(BaseModel x)
MultiModelsetGenericModel in interface MultiModelx - Template model (will be cloned)public BaseRegression getGenericModel()
MultiModelgetGenericModel in interface MultiModelpublic void setModel(int index,
BaseModel x)
MultiModelAny implementation should not clone the model. This will allow people to construct a model used already-trained models.
setModel in interface MultiModelindex - Index of submodel to be setx - Model to be used (creates a clone)protected void checkStatus()
public CompositeRegression clone()
clone in class BaseRegressionprotected void train_protected(Dataset TrainData)
BaseModeltrain_protected in class BaseModelTrainData - Training datapublic int getNFittingParameters()
AbstractRegressionModelgetNFittingParameters in interface AbstractRegressionModelpublic void run_protected(Dataset TestData)
BaseModelrun_protected in class BaseModelTestData - Training datapublic double[][] getEnsemblePredictions(Dataset Data)
Data - Dataset to be evaluatedpublic double[] getEnsembleMean(double[][] EnsemblePredictions)
EnsemblePredictions - array produced using getEnsemblePredictionspublic double[] getEnsembleMean(Dataset Data)
Double - Dataset to be evaluatedpublic double[] getEnsembleVariation(double[][] EnsemblePredictions)
EnsemblePredictions - Double array produced using getEnsemblePredictionspublic double[] getEnsembleVariation(Dataset Data)
Data - Dataset to evaluatepublic java.lang.String printModel_protected()
BaseModelprintModel_protected in class BaseModelpublic java.util.List<java.lang.String> printModelDescriptionDetails(boolean htmlFormat)
BaseModelBaseModel.printDescription(boolean).
Implementation note: No not add indentation for details. That is handled
by BaseModel.printDescription(boolean). You should also call the super
operation to get the Normalizer and Attribute selector settings
printModelDescriptionDetails in class BaseModelhtmlFormat - Whether to use HTML formatpublic java.lang.Object runCommand(java.util.List<java.lang.Object> Command)
throws java.lang.Exception
CommandablerunCommand in interface CommandablerunCommand in class BaseRegressionCommand - Command as a list of objectsjava.lang.Exception - If something goes wrong