cscherrer / Soss.jl

Probabilistic programming via source rewriting
https://cscherrer.github.io/Soss.jl/stable/
MIT License
414 stars 30 forks source link

Predict methods #287

Closed cscherrer closed 3 years ago

cscherrer commented 3 years ago

Some reminders for when this is done:

  1. Talk with @sethaxen when this is done about updated the Arviz quickstart (discussion in https://github.com/arviz-devs/ArviZ.jl/pull/131)
  2. Update TupleVectors so Vector{<:TupleVector} is displayed more cleanly
codecov[bot] commented 3 years ago

Codecov Report

Merging #287 (d1ff082) into master (a17dbe7) will increase coverage by 2.51%. The diff coverage is 77.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #287      +/-   ##
==========================================
+ Coverage   28.00%   30.52%   +2.51%     
==========================================
  Files          50       49       -1     
  Lines        1214     1199      -15     
==========================================
+ Hits          340      366      +26     
+ Misses        874      833      -41     
Impacted Files Coverage Δ
src/Soss.jl 100.00% <ø> (ø)
src/core/models/conditional.jl 45.00% <0.00%> (-5.00%) :arrow_down:
src/transforms/withmeasures.jl 0.00% <0.00%> (ø)
src/transforms/predict.jl 84.21% <84.21%> (+73.68%) :arrow_up:
src/primitives/rand.jl 51.72% <100.00%> (+1.72%) :arrow_up:
src/transforms/basictransforms.jl 100.00% <100.00%> (ø)
src/transforms/utils.jl 84.84% <100.00%> (+2.03%) :arrow_up:
src/primitives/basemeasure.jl 82.35% <0.00%> (+1.10%) :arrow_up:
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a17dbe7...d1ff082. Read the comment docs.

cscherrer commented 3 years ago

@sethaxen with this PR, this now works for the ArviZ quickstart

julia> postpred = predict(rng, param_mod | observed_data, post)
4-element Vector{TupleVectors.TupleVector{NamedTuple{(:y,), Tuple{Vector{Float64}}}, NamedTuple{(:y,), Tuple{ArraysOfArrays.ArrayOfSimilarArrays{Float64, 1, 1, 2, ElasticArrays.ElasticMatrix{Float64, Vector{Float64}}}}}}}:
...