public class WekaRegression extends BaseRegression implements WekaModel
WekaModel
for regression purposes. To use this class, simply provide
the name of the Weka algorithm and a list of options as input.
Example: model = new models.classification.WekaClassifier trees.REPTree -L 5
Usage: <Weka classifier> [<classifier options...>]
Modifier and Type | Field and Description |
---|---|
weka.classifiers.AbstractClassifier |
Model
Link to Weka-based model
|
boolean |
model_defined
Whether model type has been defined
|
protected java.lang.String[] |
Model_Options
Options supplied when instantiating Model
|
protected java.lang.String |
Model_Type
Name of model type currently in use
|
AttributeSelector, trained, TrainingStats, validated, ValidationStats
Constructor and Description |
---|
WekaRegression()
Create a WekaRegression model based on the "rules.ZeroR" algorithm
|
WekaRegression(java.lang.String model_type,
java.lang.String[] options)
Create a Weka model with a specified model and options
|
Modifier and Type | Method and Description |
---|---|
WekaRegression |
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.
|
java.lang.String |
getModelFull()
Return model name and options
|
java.lang.String |
getModelName()
Return the model name
|
java.lang.String[] |
getModelOptions()
Return the model options
|
int |
getNFittingParameters()
Number of fitting parameters in a model.
|
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)
|
void |
setModel(java.lang.String model_type,
java.lang.String[] options)
Set the underlying Weka-based model
|
void |
setOptions(java.util.List OptionsObj)
Set any options for this object.
|
java.lang.String |
toString() |
protected void |
train_protected(Dataset TrainingData)
Train a model without evaluating performance
|
doRobustRegression, getRobustRegressionQ, robustTraining, runCommand, setRobustRegressionQ
about, crossValidate, crossValidate, crossValidate, done, externallyValidate, getAttributeSelector, getFilter, getTrainTime, getValidationMethod, handleSetCommand, isTrained, isValidated, loadState, printCommand, printDescription, printModel, resetModel, run, saveCommand, saveState, setAttributeSelector, setComponent, setFilter, train, train
public weka.classifiers.AbstractClassifier Model
public boolean model_defined
protected java.lang.String Model_Type
protected java.lang.String[] Model_Options
public WekaRegression(java.lang.String model_type, java.lang.String[] options) throws java.lang.Exception
model_type
- Model type (ie trees.J48)options
- Options for the modeljava.lang.Exception
public WekaRegression() throws java.lang.Exception
java.lang.Exception
public void setOptions(java.util.List OptionsObj) throws java.lang.Exception
Options
setOptions
in interface Options
OptionsObj
- Array of options as Objects - can be null
java.lang.Exception
- if problem with inputspublic java.lang.String printUsage()
Options
printUsage
in interface Options
public WekaRegression clone()
clone
in class BaseRegression
public final void setModel(java.lang.String model_type, java.lang.String[] options) throws java.lang.Exception
public java.lang.String getModelName()
getModelName
in interface WekaModel
public java.lang.String[] getModelOptions()
getModelOptions
in interface WekaModel
public java.lang.String getModelFull()
getModelFull
in interface WekaModel
public java.lang.String toString()
toString
in class java.lang.Object
protected void train_protected(Dataset TrainingData)
BaseModel
train_protected
in class BaseModel
TrainingData
- Training datapublic void run_protected(Dataset TestData)
BaseModel
run_protected
in class BaseModel
TestData
- Training datapublic int getNFittingParameters()
AbstractRegressionModel
getNFittingParameters
in interface AbstractRegressionModel
protected java.lang.String printModel_protected()
BaseModel
printModel_protected
in class BaseModel
public java.util.List<java.lang.String> printModelDescriptionDetails(boolean htmlFormat)
BaseModel
BaseModel.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 BaseModel
htmlFormat
- Whether to use HTML formatpublic java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.String,Citation>> getCitations()
Citable
getCitations
in interface Citable
getCitations
in class BaseModel