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

clarify KernelDensity.score{,_samples} docstrings #3695

Merged
merged 1 commit into from
Sep 25, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions sklearn/neighbors/kde.py
Original file line number Diff line number Diff line change
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