Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gridrdf functionality #153

Merged
merged 11 commits into from
Jun 23, 2023
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ repos:
# - id: end-of-file-fixer
# - id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 19.3b0
rev: 23.3.0
hooks:
- id: black
3 changes: 2 additions & 1 deletion examples/crabnet_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# TODO: incorporate CrabNet uncertainty into search
"""
from crabnet.crabnet_ import CrabNet
import pandas as pd

# %% imports
from tqdm import tqdm
Expand Down Expand Up @@ -82,7 +83,7 @@
idx = perf_val_df.pred.idxmax()
# idx = np.where(val_pred == max(val_pred))[0][0]
move_row = perf_val_df.loc[idx]
perf_train_df.append(move_row)
perf_train_df = pd.concat((perf_train_df, move_row))
perf_val_df = perf_val_df.drop(index=idx)
next_experiments.append(move_row.to_dict())
experiment = ad_experiments_metrics(
Expand Down
2 changes: 1 addition & 1 deletion mat_discover/adaptive_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def suggest_next_experiment(
# append compound to train, remove from val, and reset indices
# https://stackoverflow.com/a/12204428/13697228
move_row = self.val_df[self.val_df.index == next_index]
self.train_df = self.train_df.append(move_row)
self.train_df = pd.concat((self.train_df, move_row))
self.val_df = self.val_df[self.val_df.index != next_index]
# self.val_df = self.val_df.drop(index=next_index)

Expand Down
4 changes: 2 additions & 2 deletions mat_discover/mat_discover_.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,8 @@ def predict(
f"self.val_rad_neigh_avg` and `self.val_k_neigh_avg` are being assigned the same values as `val_dens` for compatibility reasons since a non-DiSCoVeR novelty learner was specified: {self.novelty_learner}."
)
# composition-based featurization
X_train: Union[pd.DataFrame, np.ndarray, List] = []
X_val: Union[pd.DataFrame, np.ndarray, List] = []
X_train: Union[np.ndarray, List] = []
X_val: Union[np.ndarray, List] = []
assert self.train_inputs is not None
if self.novelty_prop == "mod_petti":
assert isinstance(X_train, list)
Expand Down
4 changes: 2 additions & 2 deletions mat_discover/utils/extraordinary.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def extraordinary_split(
):
# set aside high-performing candidates
if val_df is not None:
train_val_df = train_df.append(val_df)
train_val_df = pd.concat((train_df, val_df))
else:
train_val_df = train_df

Expand All @@ -31,7 +31,7 @@ def extraordinary_split(
train_df, val_df = train_test_split(
train_val_df, train_size=train_size, random_state=random_state
)
val_df = val_df.append(extraordinary_df)
val_df = pd.concat((val_df, extraordinary_df))

return train_df, val_df, extraordinary_thresh

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies = [
"umap-learn",
"dill",
"crabnet >=2.0.5,<3.0.0",
"torch <2",
"chem_wasserstein >=1.0.8,<2.0.0",
"composition_based_feature_vector",
"matbench_genmetrics >= 0.6.1",
Expand Down