pipefitter.estimator.DecisionForest

class pipefitter.estimator.DecisionForest(alpha=0, bootstrap=0.63212055882, cf_level=0.25, criterion=None, leaf_size=5, m=None, max_branches=2, max_depth=6, n_bins=20, n_trees=50, out_of_bag=False, seed=0, var_importance=False, vote='prob', target=None, nominals=None, inputs=None)

Bases: pipefitter.base.BaseEstimator

Decision Forest

Parameters:

alpha : double, optional

Specifies the value to use for minimal cost-complexity pruning for regression trees

bootstrap : float, optional

Specifies the fraction of the data for the bootstrap sample

cf_level : float, optional

Specifies the aggressiveness of tree pruning according to the C4.5 algorithm.

criterion : string, optional

Split criterion. Valid values are ‘variance’, ‘gain’, ‘gain_ratio’, and ‘gini’.

leaf_size : int, optional

Minimum leaf size

m : int, optional

Number of variables in each split

max_braches : int, optional

Maximum number of branches

max_depth : int, optional

Maximum depth of trees

n_bins : int, optional

Number of bins to use for numeric variables in the calculation of the decision tree

n_trees : int, optional

Specifies the number of trees to create

out_of_bag : boolean, optional

When set to True, specifies that the out-of-bag error is computed when building a forest

seed : float, optional

Specifies the seed for the random number generator

var_importannce : bool, optional

Specifies whether the variable importance information is generated

vote : string, optional

Specifies the vote strategy for classification. Valid values are ‘prob’ and ‘majority’.

target : string, optional

The target variable

nominals : string or list of strings, optional

The nominal variables

inputs : string or list of strings, optional

The input variables

Returns:

DecisionForest

Examples

>>> forest = DecisionForest(target='Origin',
...                         inputs=['MPG_City', 'MPG_Highway', 'Length',
...                                 'Weight', 'Type', 'Cylinders'],
...                         nominals = ['Type', 'Cylinders', 'Origin'])
__init__(alpha=0, bootstrap=0.63212055882, cf_level=0.25, criterion=None, leaf_size=5, m=None, max_branches=2, max_depth=6, n_bins=20, n_trees=50, out_of_bag=False, seed=0, var_importance=False, vote='prob', target=None, nominals=None, inputs=None)

Methods

__init__([alpha, bootstrap, cf_level, ...])
fit(table, \*args, \*\*kwargs) Fit function for decision forest
get_combined_params(\*args, \*\*kwargs) Merge all parameters and verify that they valid
get_filtered_params(\*args, \*\*kwargs) Merge parameters that keys that belong to self
get_param(\*names) Return a copy of the requested parameters
get_params(\*names) Return a copy of the requested parameters
has_param(name) Does the parameter exist?
set_param(\*args, \*\*kwargs) Set one or more parameters
set_params(\*args, \*\*kwargs) Set one or more parameters
transform(table, \*args, \*\*kwargs) Transform function for transformer

Attributes

param_defs
static_params