pipefitter.estimator.GBTree

class pipefitter.estimator.GBTree(distribution=None, early_stop_stagnation=0, lasso=0, leaf_size=5, learning_rate=0.1, m=None, max_branches=2, max_depth=6, n_bins=20, n_trees=50, ridge=0, seed=0, subsample_rate=0.5, var_importance=False, target=None, nominals=None, inputs=None)

Bases: pipefitter.base.BaseEstimator

Gradient Boosting Tree

Parameters:

distribution : string, optional

Split criterion. Valid values are ‘gaussian’, ‘binary’, and ‘multinomial’.

early_stop_stagnation : int, optional

Early stop stagnation parameter

lasso : float, optional

Specifies the L1 norm regularization on prediction

leaf_size : int, optional

Minimum leaf size

learning_rate : float, optional

Specifies the learning rate of each tree

m : int, optional

Specifies the 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

ridge : float, optional

Specifies the L2 norm regularization on prediction

seed : float, optional

Specifies the seed for the random number generator

subsample_rate : float, optional

Specifies the fraction of the data to use for building each tree

var_importannce : bool, optional

Specifies whether the variable importance information is generated

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:

GBTree

Examples

>>> gbt = GBTree(target='Origin',
...              inputs=['MPG_City', 'MPG_Highway', 'Length',
...                      'Weight', 'Type', 'Cylinders'],
...              nominals = ['Type', 'Cylinders', 'Origin'])
__init__(distribution=None, early_stop_stagnation=0, lasso=0, leaf_size=5, learning_rate=0.1, m=None, max_branches=2, max_depth=6, n_bins=20, n_trees=50, ridge=0, seed=0, subsample_rate=0.5, var_importance=False, target=None, nominals=None, inputs=None)

Methods

__init__([distribution, ...])
fit(table, \*args, \*\*kwargs) Fit function for gradient boosting tree
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