From 12a3590b6d3a647f5c5dc0e0467d9def0fb12ff2 Mon Sep 17 00:00:00 2001 From: Qianjun Xu <92628709+GardevoirX@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:08:30 +0800 Subject: [PATCH 1/9] Update examples/neighbors/sparse-kde.py Co-authored-by: Alexander Goscinski --- examples/neighbors/sparse-kde.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/neighbors/sparse-kde.py b/examples/neighbors/sparse-kde.py index 8557681c7..7d4494da6 100644 --- a/examples/neighbors/sparse-kde.py +++ b/examples/neighbors/sparse-kde.py @@ -8,7 +8,7 @@ Example for the usage of the :class:`skmatter.neighbors.SparseKDE` class. This class is specifically designed for conducting pobabilistic analysis of molecular motifs (`PAMM `_), -which is quiet useful for analyzing motifs like H-bonds, coordination polyhedra, and +which is quite useful for analyzing motifs like H-bonds, coordination polyhedra, and protein secondary structure. Here we show how to use the sparse KDE model to fit the probability distribution based From a049505b7a5bebdd3b6bfacc3efda6cc5eace725 Mon Sep 17 00:00:00 2001 From: Qianjun Xu <92628709+GardevoirX@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:11:20 +0800 Subject: [PATCH 2/9] Update examples/neighbors/sparse-kde.py Co-authored-by: Alexander Goscinski --- examples/neighbors/sparse-kde.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/neighbors/sparse-kde.py b/examples/neighbors/sparse-kde.py index 7d4494da6..fb3f60956 100644 --- a/examples/neighbors/sparse-kde.py +++ b/examples/neighbors/sparse-kde.py @@ -60,7 +60,7 @@ plt.show() # %% -# The perquisite of conducting sparse KDE is to partition the sample set. Here, we use +# Sparse KDE requires a discretization of the sample space. Here, we use # the FPS method to generate grid points in the sample space: # # From f0c774184f52eeabe4805a60bf236de3c637352c Mon Sep 17 00:00:00 2001 From: Qianjun Xu <92628709+GardevoirX@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:14:15 +0800 Subject: [PATCH 3/9] Update docs/src/references/neighbors.rst Co-authored-by: Alexander Goscinski --- docs/src/references/neighbors.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/src/references/neighbors.rst b/docs/src/references/neighbors.rst index 73d5af9c4..e96df5fcc 100644 --- a/docs/src/references/neighbors.rst +++ b/docs/src/references/neighbors.rst @@ -9,3 +9,8 @@ Sparse Kernel Density Estimation -------------------------------- .. autoclass:: skmatter.neighbors.SparseKDE + :show-inheritance: + + .. automethod:: fit + .. automethod:: score_samples + .. automethod:: score From 33f09bf44be43ef8490158b6dc3969ee8500f00f Mon Sep 17 00:00:00 2001 From: Qianjun Xu <92628709+GardevoirX@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:14:34 +0800 Subject: [PATCH 4/9] Update examples/neighbors/pamm.py Co-authored-by: Alexander Goscinski --- examples/neighbors/pamm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/neighbors/pamm.py b/examples/neighbors/pamm.py index e2ea7b579..fa93d1be1 100644 --- a/examples/neighbors/pamm.py +++ b/examples/neighbors/pamm.py @@ -386,7 +386,7 @@ def cluster_distribution_3D( # %% # The final result shows seven (meta-)stable states of hydrogen bond. Here we also show -# the reference hydrogen bond descriptor. The gaussian with the largest weight locates +# the reference hydrogen bond descriptor. The Gaussian with the largest weight locates # closest to the reference point. This result shows that, with the help of the # `SparseKDE` and `QuickShift` algorithm, we can easily identify the (meta-)stable # states of the system objectively and without any prior knowledge about the system. From 041083291d31027a3783f9b7d76bb8895b65df3d Mon Sep 17 00:00:00 2001 From: Qianjun Xu <92628709+GardevoirX@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:14:43 +0800 Subject: [PATCH 5/9] Update examples/neighbors/pamm.py Co-authored-by: Alexander Goscinski --- examples/neighbors/pamm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/neighbors/pamm.py b/examples/neighbors/pamm.py index fa93d1be1..2da9115da 100644 --- a/examples/neighbors/pamm.py +++ b/examples/neighbors/pamm.py @@ -402,4 +402,4 @@ def cluster_distribution_3D( ax.scatter(REF_HB[0], REF_HB[1], REF_HB[2], marker="+", color="red", s=1000) # %% -f"The gaussian with the highest probability is {np.argmax(cluster_weights) + 1}" +f"The Gaussian with the highest probability is {np.argmax(cluster_weights) + 1}" From 284360a79b2fc0fb3407868151c0b7adda8b0086 Mon Sep 17 00:00:00 2001 From: Qianjun Xu <92628709+GardevoirX@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:14:55 +0800 Subject: [PATCH 6/9] Update examples/neighbors/pamm.py Co-authored-by: Alexander Goscinski --- examples/neighbors/pamm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/neighbors/pamm.py b/examples/neighbors/pamm.py index 2da9115da..c659527c4 100644 --- a/examples/neighbors/pamm.py +++ b/examples/neighbors/pamm.py @@ -341,7 +341,7 @@ def cluster_distribution_3D( # %% # We need to estimate the probability at each grid point to do quick shift, which can -# further partition the set of grid points in to several clusters. The resulting +# further partition the set of grid points into several clusters. The resulting # clusters can be interpreted as (meta-)stable states of the system. # # From 5b59abdce23a3c8a6b7f20bce3d0f2116f787e0c Mon Sep 17 00:00:00 2001 From: Qianjun Xu <92628709+GardevoirX@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:31:18 +0800 Subject: [PATCH 7/9] Update src/skmatter/neighbors/_sparsekde.py Co-authored-by: Alexander Goscinski --- src/skmatter/neighbors/_sparsekde.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skmatter/neighbors/_sparsekde.py b/src/skmatter/neighbors/_sparsekde.py index 7bac666b9..e2a2ed601 100644 --- a/src/skmatter/neighbors/_sparsekde.py +++ b/src/skmatter/neighbors/_sparsekde.py @@ -53,7 +53,7 @@ class SparseKDE(BaseEstimator): 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. + The kernel used here. Now only the Gaussian kernel is available. verbose : bool, default=False Whether to print progress. From 7dff19f346ec52e571bfcfee5cbc27b8fcb9e01a Mon Sep 17 00:00:00 2001 From: Qianjun Xu <92628709+GardevoirX@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:31:43 +0800 Subject: [PATCH 8/9] Update src/skmatter/neighbors/_sparsekde.py Co-authored-by: Alexander Goscinski --- src/skmatter/neighbors/_sparsekde.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skmatter/neighbors/_sparsekde.py b/src/skmatter/neighbors/_sparsekde.py index e2a2ed601..69072ff2a 100644 --- a/src/skmatter/neighbors/_sparsekde.py +++ b/src/skmatter/neighbors/_sparsekde.py @@ -79,7 +79,7 @@ class SparseKDE(BaseEstimator): >>> np.random.seed(0) >>> n_samples = 10_000 - To create two gaussians with different means and covariance and sample from them + To create two Gaussians with different means and covariance and sample from them >>> cov1 = [[1, 0.5], [0.5, 1]] >>> cov2 = [[1, 0.5], [0.5, 0.5]] From 9d8ad9b3f61445c5908bce78de9f746d19f6a2be Mon Sep 17 00:00:00 2001 From: Qianjun Xu <92628709+GardevoirX@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:32:04 +0800 Subject: [PATCH 9/9] Update examples/neighbors/pamm.py Co-authored-by: Alexander Goscinski --- examples/neighbors/pamm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/neighbors/pamm.py b/examples/neighbors/pamm.py index c659527c4..41b41fb95 100644 --- a/examples/neighbors/pamm.py +++ b/examples/neighbors/pamm.py @@ -368,7 +368,7 @@ def cluster_distribution_3D( ) # %% -# Based on the results, the gaussian mixture model of the system can be generated: +# Based on the results, the Gaussian mixture model of the system can be generated: # #