diff --git a/examples/neighbors/sparse-kde.py b/examples/neighbors/sparse-kde.py index 976dad855..a8148d42a 100644 --- a/examples/neighbors/sparse-kde.py +++ b/examples/neighbors/sparse-kde.py @@ -202,7 +202,7 @@ def rij(period: np.ndarray, xi: np.ndarray, xj: np.ndarray) -> np.ndarray: print(f"RMSE_kde = {RMSE_kde:.2e}") # %% -# We can see that the fitted model can perfectly capture the original one. Even though we -# have not specified the number of the Gaussians, it can still perform well. This +# We can see that the fitted model can perfectly capture the original one. Even though +# we have not specified the number of the Gaussians, it can still perform well. This # allows us to fit distributions of the data automatically at a comparable quality # within a much shorter time than scipy. diff --git a/src/skmatter/neighbors/_sparsekde.py b/src/skmatter/neighbors/_sparsekde.py index 6a51c923a..b98c6a9e1 100644 --- a/src/skmatter/neighbors/_sparsekde.py +++ b/src/skmatter/neighbors/_sparsekde.py @@ -199,6 +199,7 @@ def fit(self, X, y=None, sample_weight=None): self : object Returns the instance itself. """ + # Initialize/reset the cached properties, _bandwidth_inv and _normkernels self._bandwidth_inv_ = None self._normkernels_ = None self._check_dimension(X)