public class ModelPredictionAttributeGenerator extends BaseAttributeGenerator
For regression, the predicted class value will be used as an attribute
For classification, the predicted class and probability of an entry being each class
known to the model will be used as attributes. Example: P(Yes)>50%, P(Yes), and P(No) for
a binary classification model.
Usage: <name> $<model> $<dataset>
name: Name of model (used to name attributes)
model: Model used to create attributes
dataset: Dataset used to compute attributes for model
Constructor and Description |
---|
ModelPredictionAttributeGenerator() |
Modifier and Type | Method and Description |
---|---|
void |
addAttributes(Dataset data)
Generate new attributes for a dataset.
|
java.lang.String |
printDescription(boolean htmlFormat)
Print out description of attributes.
|
java.lang.String |
printUsage()
Print out required format for options.
|
void |
setModel(java.lang.String name,
BaseModel model,
Dataset data)
Set the model used to create attribute(s).
|
void |
setOptions(java.util.List<java.lang.Object> Options)
Set any options for this object.
|
runCommand
public void setOptions(java.util.List<java.lang.Object> Options) throws java.lang.Exception
Options
Options
- Array of options as Objects - can be null
java.lang.Exception
- if problem with inputspublic java.lang.String printUsage()
Options
public void setModel(java.lang.String name, BaseModel model, Dataset data) throws java.lang.Exception
name
- Name of model. Used to create unique attribute names.model
- Model to evaluate. Will be cloneddata
- Dataset used to generate attributes for that model. Will be clonedjava.lang.Exception
- If model not trainedpublic void addAttributes(Dataset data) throws java.lang.Exception
BaseAttributeGenerator
addAttributes
in class BaseAttributeGenerator
data
- Dataset to be added tojava.lang.Exception
Dataset.addAttribute(java.lang.String, double[])
public java.lang.String printDescription(boolean htmlFormat)
BaseAttributeGenerator
Implementation Notes
Format should look like
[Full Name of generator]: (Number of attributes) Text description of what these attributes are
For HTML format, omit the ":".
printDescription
in class BaseAttributeGenerator
htmlFormat
- Whether to print in HTML format