Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
GardevoirX committed Aug 7, 2024
1 parent 65c9636 commit 24b93c4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
32 changes: 18 additions & 14 deletions examples/neighbors/pamm.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# %%
# Probabilistic Analysis of Molecular Motifs (PAMM)
# -------------------------------------------------
#
#!/usr/bin/env python
# coding: utf-8

"""
Probabilistic Analysis of Molecular Motifs (PAMM)
================================================
Probabilistic analysis of molecular motifs (`PAMM <https://doi.org/10.1063/1.4900655>`_)
is a method identifying molecular patterns based on an analysis of the probability
distribution of fragments observed in an atomistic simulation. With the help of sparse
KDE, it can be easily conducted.
Here we define some functions to help us. `quick_shift_refinement` is used to refine the
clusters generated by `QuickShift` by merging outlier clusters into their nearest
neighbours. `generate_probability_model` is to interpret the quick shift results into
a probability model. `cluster_distribution_3D` is to plot the probability model
of the H-bond motif.
"""

# %%
# Probabilistic analysis of molecular motifs is a method identifying molecular patterns
# based on an analysis of the probability distribution of fragments observed in an
# atomistic simulation. With the help of sparse KDE, it can be easily conducted. Here
# we define some functions to help us. `quick_shift_refinement` is used to refine the
# clusters generated by `QuickShift` by merging outlier clusters into their nearest
# neighbours. `generate_probability_model` is to interpret the quick shift results into
# a probability model. `cluster_distribution_3D` is to plot the probability model
# of the H-bond motif.
#

# %%
from typing import Callable, Union
Expand Down
7 changes: 3 additions & 4 deletions src/skmatter/neighbors/_sparsekde.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ class SparseKDE(BaseEstimator):
This class is used to build a sparse kernel density estimator.
It takes a set of descriptors and a set of weights as input,
and fit the KDE model on the sampled point (e.g. the grid point
selected by FPS). First, the probability density is estimated for
each sampled point. Then, quick shift clustering is applied to the
grid points. Finally, a kernel density estimator is built based on
the clustering results.
selected by FPS).
.. note::
Currently only the Gaussian kernel is supported.
Expand Down Expand Up @@ -55,6 +52,8 @@ class SparseKDE(BaseEstimator):
fpoints : float, default=0.15
The fractional number of points in the voronoi cell of each grid points. Use
this when each cell has a similar number of points.
kernel : str, default=gaussian
The kernel used here. Now only the gaussian kernel is available.
verbose : bool, default=False
Whether to print progress.
Expand Down

0 comments on commit 24b93c4

Please sign in to comment.