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

Issue/35/quantilespacing #38

Merged
merged 1 commit into from
Dec 9, 2016
Merged

Conversation

aimalz
Copy link
Owner

@aimalz aimalz commented Dec 8, 2016

As per #35 I added in support for custom quantile spacing and demonstrated its use in the demo notebook.

Even though I'm already making this pull request, I'm still considering revising the demo notebook to not alter the original example (as I did for this quick and dirty hacked in function) but instead to add it as a new example at the end before recomputing the KLD.

self.vals = (1.0/(len(self.quantiles)+1))/self.difs
#self.difs = self.quantiles[0][1:]-self.quantiles[0][:-1]
#self.mids = (self.quantiles[0][1:]+self.quantiles[0][:-1])/2.
self.mids = self.quantiles[0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much neater! Feel free to remove the commented out parts, they're in the history.

"""
Computes an array of evenly-spaced quantiles from the truth.

Parameters
----------
quants: ndarray, float
array of quantile locations as decimals
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see - you are punting the choice of quantpoints to the user. Fine! It would be good to come up with a good algorithm for setting the quantpoints, though.

@drphilmarshall drphilmarshall merged commit 35523c6 into master Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants