Skip to content

Commit 69e2b80

Browse files
author
[zebinyang]
committed
change default settings; version 0.1.8
1 parent 5dcc7e7 commit 69e2b80

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

simtree/cart.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class CARTRegressor(MoBTreeRegressor, RegressorMixin):
1010

11-
def __init__(self, max_depth=2, min_samples_leaf=10, min_impurity_decrease=0,
11+
def __init__(self, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0,
1212
split_features=None, feature_names=None, random_state=0):
1313

1414
super(CARTRegressor, self).__init__(max_depth=max_depth,
@@ -94,7 +94,7 @@ def node_split(self, sample_indice):
9494

9595
class CARTClassifier(MoBTreeClassifier, ClassifierMixin):
9696

97-
def __init__(self, max_depth=2, min_samples_leaf=10, min_impurity_decrease=0,
97+
def __init__(self, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0,
9898
split_features=None, feature_names=None, random_state=0):
9999

100100
super(CARTClassifier, self).__init__(max_depth=max_depth,

simtree/customtree.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
class CustomMobTreeRegressor(MoBTreeRegressor, RegressorMixin):
1818

19-
def __init__(self, base_estimator, param_dict={}, max_depth=2, min_samples_leaf=10, min_impurity_decrease=0, feature_names=None,
20-
split_features=None, n_screen_grid=5, n_feature_search=5, n_split_grid=20, random_state=0, **kargs):
19+
def __init__(self, base_estimator, param_dict={}, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
20+
split_features=None, n_screen_grid=1, n_feature_search=10, n_split_grid=20, random_state=0, **kargs):
2121

2222
super(CustomMobTreeRegressor, self).__init__(max_depth=max_depth,
2323
min_samples_leaf=min_samples_leaf,
@@ -54,8 +54,8 @@ def build_leaf(self, sample_indice):
5454

5555
class CustomMobTreeClassifier(MoBTreeClassifier, RegressorMixin):
5656

57-
def __init__(self, base_estimator, param_dict={}, max_depth=2, min_samples_leaf=10, min_impurity_decrease=0, feature_names=None,
58-
split_features=None, n_screen_grid=5, n_feature_search=5, n_split_grid=20, random_state=0, **kargs):
57+
def __init__(self, base_estimator, param_dict={}, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
58+
split_features=None, n_screen_grid=1, n_feature_search=10, n_split_grid=20, random_state=0, **kargs):
5959

6060
super(CustomMobTreeClassifier, self).__init__(max_depth=max_depth,
6161
min_samples_leaf=min_samples_leaf,

simtree/glmtree.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
class GLMTreeRegressor(MoBTreeRegressor, RegressorMixin):
1717

18-
def __init__(self, max_depth=2, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
19-
split_features=None, n_screen_grid=5, n_feature_search=10, n_split_grid=20, reg_lambda=0, random_state=0):
18+
def __init__(self, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
19+
split_features=None, n_screen_grid=1, n_feature_search=10, n_split_grid=20, reg_lambda=0, random_state=0):
2020

2121
super(GLMTreeRegressor, self).__init__(max_depth=max_depth,
2222
min_samples_leaf=min_samples_leaf,
@@ -55,8 +55,8 @@ def build_leaf(self, sample_indice):
5555

5656
class GLMTreeClassifier(MoBTreeClassifier, ClassifierMixin):
5757

58-
def __init__(self, max_depth=2, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
59-
split_features=None, n_screen_grid=5, n_feature_search=10, n_split_grid=20, reg_lambda=0, random_state=0):
58+
def __init__(self, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
59+
split_features=None, n_screen_grid=1, n_feature_search=10, n_split_grid=20, reg_lambda=0, random_state=0):
6060

6161
super(GLMTreeClassifier, self).__init__(max_depth=max_depth,
6262
min_samples_leaf=min_samples_leaf,

simtree/mobtree.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class MoBTree(BaseEstimator, metaclass=ABCMeta):
1919
"""
2020

2121
@abstractmethod
22-
def __init__(self, max_depth=2, min_samples_leaf=10, min_impurity_decrease=0, feature_names=None,
23-
split_features=None, n_screen_grid=5, n_feature_search=5, n_split_grid=20, random_state=0):
22+
def __init__(self, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
23+
split_features=None, n_screen_grid=1, n_feature_search=10, n_split_grid=20, random_state=0):
2424

2525
self.EPSILON = 1e-7
2626
self.max_depth = max_depth
@@ -519,8 +519,8 @@ def decision_function(self, x):
519519

520520
class MoBTreeRegressor(MoBTree, RegressorMixin):
521521

522-
def __init__(self, max_depth=2, min_samples_leaf=10, min_impurity_decrease=0, feature_names=None,
523-
split_features=None, n_screen_grid=5, n_feature_search=5, n_split_grid=20, random_state=0):
522+
def __init__(self, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
523+
split_features=None, n_screen_grid=1, n_feature_search=10, n_split_grid=20, random_state=0):
524524

525525
super(MoBTreeRegressor, self).__init__(max_depth=max_depth,
526526
min_samples_leaf=min_samples_leaf,
@@ -581,8 +581,8 @@ def predict(self, x):
581581

582582
class MoBTreeClassifier(MoBTree, ClassifierMixin):
583583

584-
def __init__(self, max_depth=2, min_samples_leaf=10, min_impurity_decrease=0, feature_names=None,
585-
split_features=None, n_screen_grid=5, n_feature_search=5, n_split_grid=20, random_state=0):
584+
def __init__(self, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
585+
split_features=None, n_screen_grid=1, n_feature_search=10, n_split_grid=20, random_state=0):
586586

587587
super(MoBTreeClassifier, self).__init__(max_depth=max_depth,
588588
min_samples_leaf=min_samples_leaf,

simtree/simtree.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class SIMTree(metaclass=ABCMeta):
2626
Base SIMTree class for classification and regression.
2727
"""
2828

29-
def __init__(self, max_depth=2, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
30-
split_features=None, n_screen_grid=5, n_feature_search=10, n_split_grid=20,
31-
degree=3, knot_num=30, reg_lambda=0, reg_gamma=1e-5, random_state=0):
29+
def __init__(self, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
30+
split_features=None, n_screen_grid=1, n_feature_search=10, n_split_grid=20,
31+
degree=3, knot_num=20, reg_lambda=0, reg_gamma=1e-5, random_state=0):
3232

3333
super(SIMTree, self).__init__(max_depth=max_depth,
3434
min_samples_leaf=min_samples_leaf,
@@ -405,9 +405,9 @@ def visualize_leaves(self, cols_per_row=3, folder="./results/", name="leaf_sim",
405405

406406
class SIMTreeRegressor(SIMTree, MoBTreeRegressor, RegressorMixin):
407407

408-
def __init__(self, max_depth=2, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
409-
split_features=None, n_screen_grid=5, n_feature_search=10, n_split_grid=20,
410-
degree=3, knot_num=30, reg_lambda=0, reg_gamma=1e-5, random_state=0):
408+
def __init__(self, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
409+
split_features=None, n_screen_grid=1, n_feature_search=10, n_split_grid=20,
410+
degree=3, knot_num=20, reg_lambda=0, reg_gamma=1e-5, random_state=0):
411411

412412
super(SIMTreeRegressor, self).__init__(max_depth=max_depth,
413413
min_samples_leaf=min_samples_leaf,
@@ -448,9 +448,9 @@ def build_leaf(self, sample_indice):
448448

449449
class SIMTreeClassifier(SIMTree, MoBTreeClassifier, ClassifierMixin):
450450

451-
def __init__(self, max_depth=2, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
452-
split_features=None, n_screen_grid=5, n_feature_search=10, n_split_grid=20,
453-
degree=3, knot_num=30, reg_lambda=0, reg_gamma=1e-5, random_state=0):
451+
def __init__(self, max_depth=3, min_samples_leaf=50, min_impurity_decrease=0, feature_names=None,
452+
split_features=None, n_screen_grid=1, n_feature_search=10, n_split_grid=20,
453+
degree=3, knot_num=20, reg_lambda=0, reg_gamma=1e-5, random_state=0):
454454

455455
super(SIMTreeClassifier, self).__init__(max_depth=max_depth,
456456
min_samples_leaf=min_samples_leaf,

0 commit comments

Comments
 (0)