Hi,
With NumPy 2.x, np.in1d has been removed, causing the test suite to fail with:
AttributeError: module 'numpy' has no attribute 'in1d'
The issue can be fixed by replacing np.in1d with np.isin, which provides the same functionality.
--- a/skopt/learning/gbrt.py
+++ b/skopt/learning/gbrt.py
@@ -116,7 +116,7 @@ class GradientBoostingQuantileRegressor(RegressorMixin, BaseEstimator):
if return_std:
std_quantiles = [0.16, 0.84]
- is_present_mask = np.in1d(std_quantiles, self.quantiles)
+ is_present_mask = np.isin(std_quantiles, self.quantiles)
if not np.all(is_present_mask):
raise ValueError(
"return_std works only if the quantiles during "
This change restores compatibility with NumPy 2.x while preserving the existing behavior.
Hi,
With NumPy 2.x,
np.in1dhas been removed, causing the test suite to fail with:The issue can be fixed by replacing
np.in1dwithnp.isin, which provides the same functionality.This change restores compatibility with NumPy 2.x while preserving the existing behavior.