markov-chain-attribution
markov-chain-attribution copied to clipboard
KeyError: 'null' - when paths do not include a null value
Taking the simple example given here: https://www.channelattribution.net/assets/files/ChannelAttributionWhitePaper-0536c269c4725179d4a0d8b8ec2f0fac.pdf
#generate a sample dataset
#paths = ['A > B > A > B > B > A','A > B > B > A > A','A > A']
import markov_model_attribution as mma
df = pd.DataFrame({'Paths':['start > A > B > A > B > B > A > conv',
'start > A > B > B > A > A > conv',
'start > A > A > conv']})
model = mma.run_model(paths=df)
Returns KeyError: 'null'
Presumable from test_df.loc['null']['null'] = 1.0