Skip to content

Instantly share code, notes, and snippets.

@thomasaarholt
Created March 29, 2024 19:50
Show Gist options
  • Save thomasaarholt/68e30bfc11e5e9f0cd7534f3b3cb20fb to your computer and use it in GitHub Desktop.
Save thomasaarholt/68e30bfc11e5e9f0cd7534f3b3cb20fb to your computer and use it in GitHub Desktop.
from typing import reveal_type
import bambi as bmb
import pandas as pd
df = pd.read_csv("mtcars.csv")
model = bmb.Model("mpg ~ wt + hp + disp", df)
trace = model.fit()
reveal_type(trace)
trace_vi = model.fit(inference_method="vi")
reveal_type(trace_vi)
trace_laplace = model.fit(inference_method="laplace")
reveal_type(trace_laplace)
foo = model.predict(trace, inplace=False)
reveal_type(foo)
trace_prior = model.prior_predictive()
reveal_type(trace_prior)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment