Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyuting committed Sep 23, 2024
1 parent fb83a60 commit 22f9b46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions obsidian/parameters/param_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ def search_space(self) -> pd.DataFrame:
X_search_t = pd.concat([X_search_t, cont_bounds], axis=1)

# For discrete, encode the available categories, then log the min-max of encoded columns
elif isinstance(param, Param_Discrete) and (not isinstance(param, (Param_Ordinal,Param_Discrete_Numeric))):
elif isinstance(param, Param_Discrete) and (not isinstance(param, (Param_Ordinal, Param_Discrete_Numeric))):
# Discrete parameter bounds aren't actually handled here; they are handled in optimizer._fixed_features())
cat_e = param.encode(param.search_categories)
disc_bounds = pd.DataFrame(np.vstack([[0]*cat_e.shape[-1], cat_e.max().values]),
columns=cat_e.columns)
X_search_t = pd.concat([X_search_t, disc_bounds], axis=1)
elif isinstance(param, (Param_Ordinal,Param_Discrete_Numeric)):
elif isinstance(param, (Param_Ordinal, Param_Discrete_Numeric)):
cat_e = param.encode(param.search_categories)
cont_bounds = pd.DataFrame([min(cat_e), max(cat_e)], columns=[param.name])
X_search_t = pd.concat([X_search_t, cont_bounds], axis=1)
Expand Down

0 comments on commit 22f9b46

Please sign in to comment.