Skip to content

Commit dd87fd0

Browse files
author
ZebinYang
committed
skip grid search cv in build leaf if param_dict is empty; version 0.2.4
1 parent 941b7e3 commit dd87fd0

File tree

3 files changed

+59
-23
lines changed

3 files changed

+59
-23
lines changed

examples/demo.ipynb

Lines changed: 58 additions & 20 deletions
Large diffs are not rendered by default.

simtree/glmtree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def build_leaf(self, sample_indice):
4444

4545
if len(self.reg_lambda) > 1:
4646
best_estimator = LassoCV(alphas=self.reg_lambda, cv=5, precompute=False, random_state=self.random_state)
47-
best_estimator.fit(nx, self.y[sample_indice], self.sample_weight[sample_indice])
47+
best_estimator.fit(nx, self.y[sample_indice])
4848
else:
4949
if self.reg_lambda[0] > 0:
5050
best_estimator = Lasso(alpha=self.reg_lambda[0], precompute=False, random_state=self.random_state)

simtree/mobtree.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,6 @@ def get_loss(self, label, pred):
627627
containing the input dataset
628628
pred : array-like of shape (n_samples,)
629629
containing the output dataset
630-
sample_weight : array-like of shape (n_samples,), optional
631-
containing sample weights
632630
Returns
633631
-------
634632
float

0 commit comments

Comments
 (0)