Skip to content

Commit 454930a

Browse files
Added a modulde of Gradient Boosting to Regressor and Classifier
resolves #1
1 parent 937da12 commit 454930a

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

hunga_bunga/classification.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
from sklearn.base import ClassifierMixin
2525
from sklearn.base import RegressorMixin
2626
from sklearn.base import is_classifier
27+
from sklearn.ensemble import GradientBoostingClassifier
2728

28-
from core import *
29-
from params import *
29+
from hunga_bunga.core import *
30+
from hunga_bunga.params import *
3031

3132

3233
linear_models_n_params = [
@@ -157,7 +158,11 @@
157158
(ExtraTreesClassifier,
158159
{'n_estimators': n_estimators, 'max_features': max_features, 'max_depth': max_depth,
159160
'min_samples_split': min_samples_split, 'min_samples_leaf': min_samples_leaf, 'min_impurity_split': min_impurity_split, 'warm_start': warm_start,
160-
'criterion': ['gini', 'entropy']})
161+
'criterion': ['gini', 'entropy']}),
162+
163+
(GradientBoostingClassifier,
164+
{'n_estimators': n_estimators, 'max_features': max_features, 'max_depth': max_depth, 'min_samples_split': min_samples_split,
165+
'min_samples_leaf': min_samples_leaf, 'min_impurity_split': min_impurity_split, 'warm_start': warm_start})
161166
]
162167

163168
tree_models_n_params_small = [
@@ -171,6 +176,10 @@
171176
}),
172177

173178
(ExtraTreesClassifier,
179+
{'n_estimators_small': n_estimators_small, 'max_features_small': max_features_small, 'max_depth_small': max_depth_small,
180+
'min_samples_split': min_samples_split, 'min_samples_leaf': min_samples_leaf}),
181+
182+
(GradientBoostingClassifier,
174183
{'n_estimators_small': n_estimators_small, 'max_features_small': max_features_small, 'max_depth_small': max_depth_small,
175184
'min_samples_split': min_samples_split, 'min_samples_leaf': min_samples_leaf})
176185
]

hunga_bunga/regression.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from sklearn.gaussian_process.kernels import RBF, ConstantKernel, DotProduct, WhiteKernel
2020
from sklearn.ensemble import AdaBoostRegressor, ExtraTreesRegressor, RandomForestRegressor
2121
from sklearn.linear_model import LinearRegression, Ridge, Lasso, ElasticNet, Lars, LassoLars, OrthogonalMatchingPursuit, BayesianRidge, ARDRegression, SGDRegressor, PassiveAggressiveRegressor, RANSACRegressor, HuberRegressor
22-
22+
from sklearn.ensemble import GradientBoostingRegressor
2323

2424
from hunga_bunga.core import *
2525
from hunga_bunga.params import *
@@ -271,6 +271,10 @@
271271
{'n_estimators': n_estimators, 'max_features': max_features, 'max_depth': max_depth, 'min_samples_split': min_samples_split,
272272
'min_samples_leaf': min_samples_leaf, 'min_impurity_split': min_impurity_split, 'warm_start': warm_start,
273273
'criterion': ['mse', 'mae']}),
274+
275+
(GradientBoostingRegressor,
276+
{'n_estimators': n_estimators, 'max_features': max_features, 'max_depth': max_depth, 'min_samples_split': min_samples_split,
277+
'min_samples_leaf': min_samples_leaf, 'min_impurity_split': min_impurity_split, 'warm_start': warm_start}),
274278

275279
]
276280

@@ -282,7 +286,11 @@
282286
(ExtraTreesRegressor,
283287
{'n_estimators': n_estimators_small, 'max_features': max_features_small, 'max_depth': max_depth_small, 'min_samples_split': min_samples_split,
284288
'min_samples_leaf': min_samples_leaf,
285-
'criterion': ['mse', 'mae']})
289+
'criterion': ['mse', 'mae']}),
290+
291+
(GradientBoostingRegressor,
292+
{'n_estimators': n_estimators_small, 'max_features': max_features_small, 'max_depth': max_depth_small, 'min_samples_split': min_samples_split,
293+
'min_samples_leaf': min_samples_leaf})
286294
]
287295

288296

0 commit comments

Comments
 (0)