Skip to content

Commit

Permalink
Merge pull request #16 from MSDLLCpapers/main
Browse files Browse the repository at this point in the history
Fix testing failure for surface plot
  • Loading branch information
kstone40 authored Aug 13, 2024
2 parents 4eb8837 + 45e3a7f commit c35c5e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Modified
- Renamed aq_func hyperparmeter "Xi_f" to "inflate"
- Moved default aq_func choices for single/multi into aq_defaults of acquisition.config
- Fixed and improved campaign analysis methods

## [0.7.11]
### Added
Expand Down
17 changes: 10 additions & 7 deletions obsidian/plotting/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,16 @@ def surface_plot(optimizer: Optimizer,
if plot_data:
# Use a marker size which is larger if closer to the "other" values of the surface
# Smaller markers mean there are other variables pulling it away from the surface plot
X_t_train_ex = optimizer.X_t_train.copy().drop(columns=[X0_name, X1_name]).values
X_t_test_ex = optimizer.X_space.encode(X_test.copy().drop(columns=[X0_name, X1_name]).drop_duplicates()).values

if X_t_train_ex.shape[0] > 1:
X_t_dist = np.linalg.norm(X_t_train_ex-X_t_test_ex, ord=2, axis=1)
X_t_dist_scaled = (X_t_dist - X_t_dist.min())/(X_t_dist.max()-X_t_dist.min())
dist_scaled = 15-10*X_t_dist_scaled
if len(optimizer.X_space) != 2:
X_t_train_ex = optimizer.X_t_train.copy().drop(columns=[X0_name, X1_name]).values
X_t_test_ex = optimizer.X_space.encode(X_test.copy().drop(columns=[X0_name, X1_name]).drop_duplicates()).values

if X_t_train_ex.shape[0] > 1:
X_t_dist = np.linalg.norm(X_t_train_ex-X_t_test_ex, ord=2, axis=1)
X_t_dist_scaled = (X_t_dist - X_t_dist.min())/(X_t_dist.max()-X_t_dist.min())
dist_scaled = 15-10*X_t_dist_scaled
else:
dist_scaled = 10
else:
dist_scaled = 10

Expand Down

0 comments on commit c35c5e5

Please sign in to comment.