Skip to content

Commit

Permalink
Revert "XGBoost: Temporary workaround before release of v1.5"
Browse files Browse the repository at this point in the history
This reverts commit 1389f99.
  • Loading branch information
janezd authored and PrimozGodec committed Oct 25, 2021
1 parent f4b412d commit f72a451
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
8 changes: 2 additions & 6 deletions Orange/classification/xgb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# pylint: disable=too-many-arguments
from typing import Tuple
import sys

import numpy as np

Expand All @@ -13,9 +12,6 @@

__all__ = ["XGBClassifier", "XGBRFClassifier"]

# Temporary workaround for https://github.com/dmlc/xgboost/issues/7156
N_JOBS = 1 if sys.platform == "darwin" else None


class _FeatureScorerMixin(LearnerScorer):
feature_type = Variable
Expand All @@ -37,7 +33,7 @@ def __init__(self,
objective="binary:logistic",
booster=None,
tree_method=None,
n_jobs=N_JOBS,
n_jobs=None,
gamma=None,
min_child_weight=None,
max_delta_step=None,
Expand Down Expand Up @@ -100,7 +96,7 @@ def __init__(self,
objective="binary:logistic",
booster=None,
tree_method=None,
n_jobs=N_JOBS,
n_jobs=None,
gamma=None,
min_child_weight=None,
max_delta_step=None,
Expand Down
9 changes: 0 additions & 9 deletions Orange/modelling/tests/test_xgb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import unittest
from typing import Callable, Union
import xgboost

from Orange.data import Table
from Orange.evaluation import CrossValidation
Expand All @@ -26,14 +25,6 @@ def setUpClass(cls):
cls.iris = Table("iris")
cls.housing = Table("housing")

def test_xgboost_workaround(self):
self.assertLessEqual(
list(map(int, xgboost.__version__.split("."))),
[1, 5, 0],
"\nCheck the new release of xgboost and revert this "
"commit if possible, or do something else if not."
)

@test_learners
def test_cls(self, learner_class: Union[XGBLearner, XGBRFLearner]):
booster = learner_class()
Expand Down
8 changes: 2 additions & 6 deletions Orange/regression/xgb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# pylint: disable=too-many-arguments
from typing import Tuple
import sys

import numpy as np
import xgboost
Expand All @@ -12,9 +11,6 @@

__all__ = ["XGBRegressor", "XGBRFRegressor"]

# Temporary workaround for https://github.com/dmlc/xgboost/issues/7156
N_JOBS = 1 if sys.platform == "darwin" else None


class _FeatureScorerMixin(LearnerScorer):
feature_type = Variable
Expand All @@ -36,7 +32,7 @@ def __init__(self,
objective="reg:squarederror",
booster=None,
tree_method=None,
n_jobs=N_JOBS,
n_jobs=None,
gamma=None,
min_child_weight=None,
max_delta_step=None,
Expand Down Expand Up @@ -88,7 +84,7 @@ def __init__(self,
objective="reg:squarederror",
booster=None,
tree_method=None,
n_jobs=N_JOBS,
n_jobs=None,
gamma=None,
min_child_weight=None,
max_delta_step=None,
Expand Down

0 comments on commit f72a451

Please sign in to comment.