-
Notifications
You must be signed in to change notification settings - Fork 24
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
adding sampling functionality to linearregression model #16
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good addition @jattenberg! Thanks for adding it. Do you plan on adding a unittest for this new method? I think it might also be useful to update the corresponding Jupyter notebook to show how you might use this method.
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. | |||
|
|||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). | |||
|
|||
## [1.1.4] - 2018-07-21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I'm not sure if you're familiar with semantic versioning; the last number is reserved for bug fixes.
This is not a bug fix, so the version should be a minor version change, e.g. 1.2.0
@@ -93,17 +93,17 @@ def fit(self, X, y, inference_type='advi', minibatch_size=None, inference_args=N | |||
|
|||
return self | |||
|
|||
def predict(self, X, return_std=False): | |||
|
|||
def sample(self, X, samples=2000): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about calling this something like sample_posterior
? I think it could help to be a bit more explicit.
@@ -93,17 +93,17 @@ def fit(self, X, y, inference_type='advi', minibatch_size=None, inference_args=N | |||
|
|||
return self | |||
|
|||
def predict(self, X, return_std=False): | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only need one blank line between methods per PEP8.
|
||
Parameters | ||
---------- | ||
X : numpy array, shape [n_samples, n_features] | ||
|
||
return_std : Boolean flag of whether to return standard deviations with mean values. Defaults to False. | ||
samples : number of draws to make for each point |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add in the default value to this docstring? Like I do in the predict method below with return_std
.
|
||
return_std : Boolean flag of whether to return standard deviations with mean values. Defaults to False. | ||
|
||
samples: numberof draws to make for each input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: number of
. Please also add the default value.
If my understanding is correct, the see Bayesian point estimation: https://en.wikipedia.org/wiki/Point_estimation#Bayesian_point_estimation |
@jattenberg Are you still working on this? |
i wanted to be able to sample predictions