public class RandomForestAttributeSelector extends PythonBasedAttributeSelector
This selector works by iteratively selecting only the best-performing attributes as selected by a RandomForest model, and then repeating the process on the reduced set of attributes.
A technical note you should be aware of: This selection makes no assurances that the selected attributes are not correlated with each other. You may want to follow up the selection of a subset with a tool that does ensure selected attributes are not correlated.
Procedure:
Usage: -num_attr <attrs> [-num_steps <steps>]
[-num_trees <trees>]
Modifier and Type | Field and Description |
---|---|
protected int |
NumAttributes
Number of attributes to select.
|
protected int |
NumSteps
Number of selection steps
|
protected int |
NumTrees
Number of trees to use in RandomForest
|
Debug
trained
Constructor and Description |
---|
RandomForestAttributeSelector() |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<java.lang.String> |
assembleSystemCall(java.io.File codePath,
Dataset data)
Prepare the system call with all command-line arguments
|
protected java.lang.String |
getScriptPath()
Get the path to the Python script to be run.
|
java.lang.String |
printDescription(boolean htmlFormat)
Print full name of object, and a simple description of the options.
|
java.lang.String |
printUsage()
Print out required format for options.
|
void |
setNumAttributes(int numAttributes)
Set the target number of attributes to be selected
|
void |
setNumSteps(int numSteps)
Number of iterations during attribute selection
|
void |
setNumTrees(int numTrees)
Number of trees for the RandomForest model
|
void |
setOptions(java.util.List<java.lang.Object> Options)
Set any options for this object.
|
spawnStderrReader, train_protected
about, applyAttributeSelection, clone, getSelectionNames, getSelections, isTrained, printCommand, printSelections, run, runCommand, train
protected int NumAttributes
protected int NumSteps
protected int NumTrees
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
protected java.lang.String getScriptPath()
PythonBasedAttributeSelector
getScriptPath
in class PythonBasedAttributeSelector
public void setNumAttributes(int numAttributes)
numAttributes
- Target number of attributespublic void setNumSteps(int numSteps)
numSteps
- Desired number of stepspublic void setNumTrees(int numTrees)
numTrees
- Desired number of treesprotected java.util.List<java.lang.String> assembleSystemCall(java.io.File codePath, Dataset data)
PythonBasedAttributeSelector
assembleSystemCall
in class PythonBasedAttributeSelector
codePath
- Path to executable or script to be rundata
- Dataset being used to train attribute selectorpublic java.lang.String printDescription(boolean htmlFormat)
Printable
Example: For a model training a separate WekaRegression for intermetallics
magpie.models.regression.SplitRegression
printDescription
in interface Printable
printDescription
in class BaseAttributeSelector
htmlFormat
- Whether format for output to an HTML page
(e.g., <div> to create indentation) or for printing to screen.#printModel()