Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module for gradient boosting for regression and classification, resolves #1 #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions hunga_bunga/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
from sklearn.base import ClassifierMixin
from sklearn.base import RegressorMixin
from sklearn.base import is_classifier
from sklearn.ensemble import GradientBoostingClassifier

from core import *
from params import *
from hunga_bunga.core import *
from hunga_bunga.params import *


linear_models_n_params = [
Expand Down Expand Up @@ -157,7 +158,11 @@
(ExtraTreesClassifier,
{'n_estimators': n_estimators, 'max_features': max_features, 'max_depth': max_depth,
'min_samples_split': min_samples_split, 'min_samples_leaf': min_samples_leaf, 'min_impurity_split': min_impurity_split, 'warm_start': warm_start,
'criterion': ['gini', 'entropy']})
'criterion': ['gini', 'entropy']}),

(GradientBoostingClassifier,
{'n_estimators': n_estimators, 'max_features': max_features, 'max_depth': max_depth, 'min_samples_split': min_samples_split,
'min_samples_leaf': min_samples_leaf, 'min_impurity_split': min_impurity_split, 'warm_start': warm_start})
]

tree_models_n_params_small = [
Expand All @@ -171,6 +176,10 @@
}),

(ExtraTreesClassifier,
{'n_estimators_small': n_estimators_small, 'max_features_small': max_features_small, 'max_depth_small': max_depth_small,
'min_samples_split': min_samples_split, 'min_samples_leaf': min_samples_leaf}),

(GradientBoostingClassifier,
{'n_estimators_small': n_estimators_small, 'max_features_small': max_features_small, 'max_depth_small': max_depth_small,
'min_samples_split': min_samples_split, 'min_samples_leaf': min_samples_leaf})
]
Expand Down
16 changes: 12 additions & 4 deletions hunga_bunga/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
from sklearn.gaussian_process.kernels import RBF, ConstantKernel, DotProduct, WhiteKernel
from sklearn.ensemble import AdaBoostRegressor, ExtraTreesRegressor, RandomForestRegressor
from sklearn.linear_model import LinearRegression, Ridge, Lasso, ElasticNet, Lars, LassoLars, OrthogonalMatchingPursuit, BayesianRidge, ARDRegression, SGDRegressor, PassiveAggressiveRegressor, RANSACRegressor, HuberRegressor
from sklearn.ensemble import GradientBoostingRegressor


from core import *
from params import *
from hunga_bunga.core import *
from hunga_bunga.params import *


linear_models_n_params = [
Expand Down Expand Up @@ -271,6 +271,10 @@
{'n_estimators': n_estimators, 'max_features': max_features, 'max_depth': max_depth, 'min_samples_split': min_samples_split,
'min_samples_leaf': min_samples_leaf, 'min_impurity_split': min_impurity_split, 'warm_start': warm_start,
'criterion': ['mse', 'mae']}),

(GradientBoostingRegressor,
{'n_estimators': n_estimators, 'max_features': max_features, 'max_depth': max_depth, 'min_samples_split': min_samples_split,
'min_samples_leaf': min_samples_leaf, 'min_impurity_split': min_impurity_split, 'warm_start': warm_start}),

]

Expand All @@ -282,7 +286,11 @@
(ExtraTreesRegressor,
{'n_estimators': n_estimators_small, 'max_features': max_features_small, 'max_depth': max_depth_small, 'min_samples_split': min_samples_split,
'min_samples_leaf': min_samples_leaf,
'criterion': ['mse', 'mae']})
'criterion': ['mse', 'mae']}),

(GradientBoostingRegressor,
{'n_estimators': n_estimators_small, 'max_features': max_features_small, 'max_depth': max_depth_small, 'min_samples_split': min_samples_split,
'min_samples_leaf': min_samples_leaf})
]


Expand Down