Skip to content

Instantly share code, notes, and snippets.

@lucdangelis
Last active February 13, 2020 17:06
Show Gist options
  • Save lucdangelis/93204817276c192b3cd51d5f1050a097 to your computer and use it in GitHub Desktop.
Save lucdangelis/93204817276c192b3cd51d5f1050a097 to your computer and use it in GitHub Desktop.
import pandas as pd
import numpy as np
from lifetimes.utils import *
from lifetimes import BetaGeoFitter
from lifetimes.plotting import plot_probability_alive_matrix, plot_frequency_recency_matrix
from lifetimes.generate_data import beta_geometric_nbd_model
import matplotlib.pyplot as plt
from lifetimes.plotting import plot_calibration_purchases_vs_holdout_purchases, plot_period_transactions,plot_history_alive
bgf = BetaGeoFitter()
bgf.fit(data['frequency'], data['recency'], data['T'])
mbgf.summary
@saman-ghm
Copy link

When I'm trying to execute this part, I'm getting the error related to mbgf, I think it's not declared before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment