-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhistgradientboostingtree.yaml
134 lines (104 loc) · 7.74 KB
/
histgradientboostingtree.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: histgradientboostingtree
framework: sklearn
model_type: tabular
model_tasks:
- classification
label_types:
- binary
- discrete
set_params_function:
_target_: CMC_utils.models.set_histgradientboostingtree_params
init_params:
_target_: sklearn.ensemble.HistGradientBoostingClassifier
_convert_: all
loss: log_loss
# {‘log_loss’, ‘auto’, ‘binary_crossentropy’, ‘categorical_crossentropy’}, default=’log_loss’
# The loss function to use in the boosting process.
# For binary classification problems, ‘log_loss’ is also known as logistic loss, binomial deviance or binary crossentropy.
# Internally, the model fits one tree per boosting iteration and uses the logistic sigmoid function (expit) as inverse link function to compute the predicted positive class probability.
# For multiclass classification problems, ‘log_loss’ is also known as multinomial deviance or categorical crossentropy.
# Internally, the model fits one tree per boosting iteration and per class and uses the softmax function as inverse link function to compute the predicted probabilities of the classes.
learning_rate: 0.1
# float, default=0.1
# The learning rate, also known as shrinkage. This is used as a multiplicative factor for the leaves values. Use 1 for no shrinkage.
max_iter: ${dl_params.max_epochs} # 100
# int, default=100
# The maximum number of iterations of the boosting process, i.e. the maximum number of trees for binary classification.
# For multiclass classification, n_classes trees per iteration are built.
max_leaf_nodes: 31
# int or None, default=31
# The maximum number of leaves for each tree. Must be strictly greater than 1. If None, there is no maximum limit.
max_depth:
# int or None, default=None
# The maximum depth of each tree. The depth of a tree is the number of edges to go from the root to the deepest leaf. Depth isn’t constrained by default.
min_samples_leaf: 20
# int, default=20
# The minimum number of samples per leaf. For small datasets with less than a few hundred samples, it is recommended to lower this value since only very shallow trees would be built.
l2_regularization: 0
# float, default=0
# The L2 regularization parameter. Use 0 for no regularization.
max_bins: 255
# int, default=255
# The maximum number of bins to use for non-missing values. Before training, each feature of the input array X is binned into integer-valued bins, which allows for a much faster training stage. Features with a small number of unique values may use less than max_bins bins. In addition to the max_bins bins, one more bin is always reserved for missing values. Must be no larger than 255.
categorical_features:
# array-like of {bool, int, str} of shape (n_features) or shape (n_categorical_features,), default=None
# Indicates the categorical features.
# - None: no feature will be considered categorical.
# - boolean array-like: boolean mask indicating categorical features.
# - integer array-like: integer indices indicating categorical features.
# - str array-like: names of categorical features (assuming the training data has feature names).
# For each categorical feature, there must be at most max_bins unique categories, and each categorical value must be in [0, max_bins -1]. During prediction, categories encoded as a negative value are treated as missing values.
monotonic_cst:
# array-like of int of shape (n_features) or dict, default=None
# Monotonic constraint to enforce on each feature are specified using the following integer values:
# - 1: monotonic increase
# - 0: no constraint
# - -1: monotonic decrease
# If a dict with str keys, map feature to monotonic constraints by name.
# If an array, the features are mapped to constraints by position. See Using feature names to specify monotonic constraints for a usage example.
# The constraints are only valid for binary classifications and hold over the probability of the positive class. Read more in the User Guide.
# interaction_cst:
# {“pairwise”, “no_interaction”} or sequence of lists/tuples/sets of int, default=None
# Specify interaction constraints, the sets of features which can interact with each other in child node splits.
# Each item specifies the set of feature indices that are allowed to interact with each other.
# If there are more features than specified in these constraints, they are treated as if they were specified as an additional set.
# The strings “pairwise” and “no_interactions” are shorthands for allowing only pairwise or no interactions, respectively.
# For instance, with 5 features in total, interaction_cst=[{0, 1}] is equivalent to interaction_cst=[{0, 1}, {2, 3, 4}], and specifies that each branch of a tree will either only split on features 0 and 1 or only split on features 2, 3 and 4.
warm_start: False
# bool, default=False
# When set to True, reuse the solution of the previous call to fit and add more estimators to the ensemble.
# For results to be valid, the estimator should be re-trained on the same data only. See the Glossary.
early_stopping: auto
# ‘auto’ or bool, default=’auto’
# If ‘auto’, early stopping is enabled if the sample size is larger than 10000. If True, early stopping is enabled, otherwise early stopping is disabled.
scoring: loss
# str or callable or None, default=’loss’
# Scoring parameter to use for early stopping. It can be a single string (see The scoring parameter: defining model evaluation rules) or a callable (see Defining your scoring strategy from metric functions). If None, the estimator’s default scorer is used. If scoring='loss', early stopping is checked w.r.t the loss value. Only used if early stopping is performed.
validation_fraction: 0.1
# int or float or None, default=0.1
# Proportion (or absolute size) of training data to set aside as validation data for early stopping. If None, early stopping is done on the training data. Only used if early stopping is performed.
n_iter_no_change: ${dl_params.early_stopping_patience} #10
# int, default=10
# Used to determine when to “early stop”. The fitting process is stopped when none of the last n_iter_no_change scores are better than the n_iter_no_change - 1 -th-to-last one, up to some tolerance. Only used if early stopping is performed.
tol: 1e-7
# float, default=1e-7
# The absolute tolerance to use when comparing scores. The higher the tolerance, the more likely we are to early stop: higher tolerance means that it will be harder for subsequent iterations to be considered an improvement upon the reference score.
verbose: ${verbose}
# int, default=0
# The verbosity level. If not zero, print some information about the fitting process.
random_state: ${seed}
# int, RandomState instance or None, default=None
# Pseudo-random number generator to control the subsampling in the binning process, and the train/validation data split if early stopping is enabled. Pass an int for reproducible output across multiple function calls. See Glossary.
# class_weight: balanced
# dict or ‘balanced’, default=None
# Weights associated with classes in the form {class_label: weight}. If not given, all classes are supposed to have weight one. The “balanced” mode uses the values of y to automatically adjust weights inversely proportional to class frequencies in the input data as n_samples / (n_classes * np.bincount(y)). Note that these weights will be multiplied with sample_weight (passed through the fit method) if sample_weight is specified.
fit_params: {}
train_function:
_target_: CMC_utils.models.train_sklearn_model
test_function:
_target_: CMC_utils.models.test_sklearn_model
save_function:
_target_: CMC_utils.save_load.save_model
file_extension: pkl
load_function:
_target_: CMC_utils.save_load.load_model