Skip to content

Commit

Permalink
fix(dependency): np.NaN -> np.nan
Browse files Browse the repository at this point in the history
New(er) numpy does not support np.NaN anymore
  • Loading branch information
benjamc committed Jul 16, 2024
1 parent 8ece46d commit 7b2f965
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion smac/model/random_forest/random_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def _predict(
third_dimension = max(max_num_leaf_data, third_dimension)

# Transform list of 2d arrays into a 3d array
preds_as_array = np.zeros((X.shape[0], self._rf_opts.num_trees, third_dimension)) * np.NaN
preds_as_array = np.zeros((X.shape[0], self._rf_opts.num_trees, third_dimension)) * np.nan
for i, preds_per_tree in enumerate(all_preds):
for j, pred in enumerate(preds_per_tree):
preds_as_array[i, j, : len(pred)] = pred
Expand Down
6 changes: 3 additions & 3 deletions smac/runhistory/encoder/abstract_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def __init__(
)

# Learned statistics
self._min_y = np.array([np.NaN] * self._n_objectives)
self._max_y = np.array([np.NaN] * self._n_objectives)
self._percentile = np.array([np.NaN] * self._n_objectives)
self._min_y = np.array([np.nan] * self._n_objectives)
self._max_y = np.array([np.nan] * self._n_objectives)
self._percentile = np.array([np.nan] * self._n_objectives)
self._multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None = None
self._runhistory: RunHistory | None = None

Expand Down

0 comments on commit 7b2f965

Please sign in to comment.