stripe / rainier

Bayesian inference in Scala.
https://rainier.fit
Apache License 2.0
432 stars 51 forks source link

add Prediction #408

Closed avibryant closed 4 years ago

avibryant commented 4 years ago

This is a very quick addition to the Model PR which fleshes out the next step: once you have a Model from doing an observation, you can predict(v) with it, where v is a Real or a Map of Reals or a Generator, etc. You then get an object that is the equivalent of an RVG - you can map/flatMap it as if it were a Generator, to refine your prediction, but it carries the Model state around with it to allow inference later.

codecov-io commented 4 years ago

Codecov Report

Merging #408 into nuke-rv will decrease coverage by 0.09%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           nuke-rv     #408     +/-   ##
==========================================
- Coverage    33.18%   33.09%   -0.1%     
==========================================
  Files           65       66      +1     
  Lines         2534     2538      +4     
  Branches       142      144      +2     
==========================================
- Hits           841      840      -1     
- Misses        1693     1698      +5
Impacted Files Coverage Δ
...in/scala/com/stripe/rainier/core/Categorical.scala 20.63% <ø> (ø) :arrow_up:
...src/main/scala/com/stripe/rainier/core/Model.scala 0% <0%> (ø) :arrow_up:
...ain/scala/com/stripe/rainier/core/Prediction.scala 0% <0%> (ø)
...cala/com/stripe/rainier/compute/Coefficients.scala 90.32% <0%> (-1.62%) :arrow_down:

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 6728893...d32f28c. Read the comment docs.