Skip to content

Commit

Permalink
Merge pull request scikit-learn#3695 from dougalsutherland/kde-docs
Browse files Browse the repository at this point in the history
DOC clarify KernelDensity.score{,_samples} docstrings
  • Loading branch information
larsmans committed Sep 25, 2014
2 parents d1ae779 + f7af204 commit cd3c2db
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sklearn/neighbors/kde.py
Expand Up @@ -141,8 +141,8 @@ def score_samples(self, X):
Returns
-------
density : ndarray
The array of log(density) evaluations. This has shape X.shape[:-1]
density : ndarray, shape (n_samples,)
The array of log(density) evaluations.
"""
# The returned density is normalized to the number of points.
# For it to be a probability, we must scale it. For this reason
Expand All @@ -157,7 +157,7 @@ def score_samples(self, X):
return log_density

def score(self, X):
"""Compute the log probability under the model.
"""Compute the total log probability under the model.
Parameters
----------
Expand All @@ -167,8 +167,8 @@ def score(self, X):
Returns
-------
logprob : array_like, shape (n_samples,)
Log probabilities of each data point in X.
logprob : float
Total log-likelihood of the data in X.
"""
return np.sum(self.score_samples(X))

Expand Down

0 comments on commit cd3c2db

Please sign in to comment.