public abstract class SplitModel extends BaseModel implements MultiModel
How to Use a SplitModel
SplitModels work by first partitioning a Dataset using a BaseDatasetSplitter
and then training several models
Usage: *No options to set*
Implemented Commands:
splitter <method> [<options...>] - Define splitter used to partition dataset between models
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
submodel get generic = <output> - Retrieve the template for any unassigned submodels submodel get <number> = <output> - Retrieve a specific submodel
Implemented Print Commands:
splitter - Print out the name of splitter used by this model submodel - Print out number of submodels submodel <number> [<command...>] - Pass a print command to one of the submodels
| Modifier and Type | Field and Description |
|---|---|
protected BaseModel |
GenericModel
Model used to if a model template for a certain split is not defined
|
protected java.util.ArrayList<BaseModel> |
Model
List of of models used by this model
|
protected BaseDatasetSplitter |
Partitioner
Class used to partition data into similar groups
|
AttributeSelector, trained, TrainingStats, validated, ValidationStats| Constructor and Description |
|---|
SplitModel() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkModelCount(int n)
Checks if enough models are defined.
|
SplitModel |
clone() |
java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.String,Citation>> |
getCitations()
Return a list of citations for this object and any underlying objects.
|
BaseModel |
getGenericModel()
Get the model template
|
BaseModel |
getModel(int index)
Get a specific submodel.
|
int |
NModels()
Returns the number of model slots currently available
|
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 Data)
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.
|
void |
setPartitioner(BaseDatasetSplitter S)
Set the partitioner.
|
protected void |
train_protected(Dataset TrainingData)
Train a model without evaluating performance
|
about, crossValidate, crossValidate, crossValidate, done, externallyValidate, getAttributeSelector, getFilter, getTrainTime, getValidationMethod, handleSetCommand, isTrained, isValidated, loadState, printDescription, printModel, resetModel, run, saveCommand, saveState, setAttributeSelector, setComponent, setFilter, train, trainprotected java.util.ArrayList<BaseModel> Model
protected BaseDatasetSplitter Partitioner
protected BaseModel GenericModel
public SplitModel clone()
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 void setNumberOfModels(int n)
MultiModelsetNumberOfModels in interface MultiModeln - Number of models to usepublic int NModels()
NModels in interface MultiModelpublic BaseModel getGenericModel()
MultiModelgetGenericModel in interface MultiModelpublic void setGenericModel(BaseModel x)
setGenericModel in interface MultiModelx - Template model (will be cloned)public 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)public void setPartitioner(BaseDatasetSplitter S)
S - Dataset splitterprotected void checkModelCount(int n)
n - Number of models requiredprotected void train_protected(Dataset TrainingData)
BaseModeltrain_protected in class BaseModelTrainingData - Training datapublic void run_protected(Dataset Data)
BaseModelrun_protected in class BaseModelData - Training datapublic 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.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 BaseModelCommand - Command as a list of objectsjava.lang.Exception - If something goes wrongpublic java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.String,Citation>> getCitations()
CitablegetCitations in interface CitablegetCitations in class BaseModel