public class StagedRegression extends BaseRegression implements MultiModel, AbstractRegressionModel
Usage: <absolute|relative>
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
Implemented Print Commands
submodel - Print out number of submodels submodel <number> [<command...>] - Pass a print command to one of the submodels
AttributeSelector, trained, TrainingStats, validated, ValidationStats| Constructor and Description |
|---|
StagedRegression() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkStatus()
Verify that this model is ready to be trained
|
StagedRegression |
clone() |
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() |
java.lang.String |
printCommand(java.util.List<java.lang.String> Command)
Handles more complicated printing commands.
|
protected 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
|
void |
useAbsoluteError()
Set to train subsequent models on absolute error from previous.
|
void |
useRelativeError()
Set model to train subsequent models on relative error from previous.
|
doRobustRegression, getRobustRegressionQ, robustTraining, setRobustRegressionQabout, crossValidate, crossValidate, crossValidate, done, externallyValidate, getAttributeSelector, getCitations, getFilter, getTrainTime, getValidationMethod, handleSetCommand, isTrained, isValidated, loadState, printDescription, printModel, resetModel, run, saveCommand, saveState, setAttributeSelector, setComponent, setFilter, train, trainequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdoRobustRegression, getRobustRegressionQ, robustTraining, setRobustRegressionQpublic 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 void useAbsoluteError()
public void useRelativeError()
public 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 StagedRegression clone()
clone in class BaseRegressionprotected void train_protected(Dataset TrainData)
BaseModeltrain_protected in class BaseModelTrainData - Training datapublic void run_protected(Dataset TestData)
BaseModelrun_protected in class BaseModelTestData - Training datapublic int getNFittingParameters()
AbstractRegressionModelgetNFittingParameters in interface AbstractRegressionModelpublic java.lang.String printCommand(java.util.List<java.lang.String> Command)
throws java.lang.Exception
PrintableprintCommand in interface PrintableprintCommand in class BaseModelCommand - Command specifying what to printjava.lang.Exception - If command not understoodprotected java.lang.String printModel_protected()
BaseModelprintModel_protected in class BaseModelpublic 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 wrongpublic 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 format