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

propagate radius kwarg up to Discover() class #146

Merged
merged 3 commits into from
Feb 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mat_discover/mat_discover_.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def __init__(
plotting: bool = False,
pdf: bool = True,
n_peak_neighbors: int = 10,
radius = None,
verbose: bool = True,
dummy_run: bool = False,
Scaler=RobustScaler,
Expand Down Expand Up @@ -390,6 +391,7 @@ def __init__(
self.plotting = plotting
self.pdf = pdf
self.n_peak_neighbors = n_peak_neighbors
self.radius = radius
self.verbose = verbose
self.dummy_run = dummy_run
if dummy_run:
Expand Down Expand Up @@ -768,7 +770,7 @@ def predict(
# compound-wise scores (i.e. individual compounds)
with self.Timer("nearest-neighbor-properties"):
self.rad_neigh_avg_targ, self.k_neigh_avg_targ = nearest_neigh_props(
self.dm, pred, n_neighbors=self.n_peak_neighbors
self.dm, pred, n_neighbors=self.n_peak_neighbors, radius=self.radius
)
self.val_rad_neigh_avg = self.rad_neigh_avg_targ[val_ids]
self.val_k_neigh_avg = self.k_neigh_avg_targ[val_ids]
Expand Down