-
Notifications
You must be signed in to change notification settings - Fork 28
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
Make Chains objects display only information and not statistical eval #307
Open
PaulinaMartin96
wants to merge
6
commits into
TuringLang:master
Choose a base branch
from
PaulinaMartin96:pm/MCMCChains_Display
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
25bc45c
Make Chains objects display only information and not statistical eval…
PaulinaMartin96 e6e760d
Make describe function display summary stats
PaulinaMartin96 21610f6
Bump minor version
PaulinaMartin96 3c68201
Merge branch 'master' into pm/MCMCChains_Display
PaulinaMartin96 fc9b295
Make describe function to display summary stats and quantiles
PaulinaMartin96 41ad4e5
Merge branch 'pm/MCMCChains_Display' of https://github.com/PaulinaMar…
PaulinaMartin96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 only captures the abstract
Vector{ChainDataFrame}
but not any concretely typedVector{<:ChainDataFrame}
. In general, I am a bit worried about changing the display of vectors ofChainDataFrame
s - it seems wrong to completely opt out of the default display mechanism of vectors in Julia (I also wonder if it causes any problems) just to change the way in whichdescribe(chain)
is displayed. Maybe ratherdescribe
should not return a vector ofChainDataFrame
.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.
Yeah, I'm down with this. My understanding of your suggestion is that
describe
should be a pure IO function -- we should makedisplay(io::IO, chn::Chain)
and the output is all the stuff inside theBase.show
definition above.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.
We should not define
display
(it callsshow(io, MIME("text/plain"), x)
which should be implemented), but we should just implementDataAPI.describe(io, chain)
if we want to display the summary statistics in a nice way: https://juliastats.org/StatsBase.jl/latest/scalarstats/#Summary-Statistics-1There 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.
Thank you so much for your help! So, to double check that I'm understanding these suggestions. Instead of returning a
Vector{ChainDataFrame}
,describe
should be an implementation ofStatsBase.describe
and return something like this?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.
I think it's fine if
summarystats
returns different summary statistics (so this method does not have to be changed) but we should make sure thatdescribe
just prints these summary statistics in a pretty way to be consistent with howdescribe
andsummarystats
are defined in StatsBase. I.e., in particulardescribe
should not return anything but only print to IO and it should not print the quantiles if they are not part ofsummarystats
(here it might actually be better to include them insummarystats
as well and return two dataframes, possibly as a named tuple).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.
To clarify maybe a little bit, there's no need to change to this code you've posted:
Basically we want to change the stuff that is currently in
show
todescribe
, so thatdescribe
becomes a pure IO function and not a weirdVector{<:ChainDataFrame}
thing that we have now.Maybe one way is to do something like
which won't actually return anything, it just prints stuff out to the screen. There's probably a way more sane way to do this, but it's a rough sketch to get you started.