markov-chain-attribution icon indicating copy to clipboard operation
markov-chain-attribution copied to clipboard

KeyError: 'null' - when paths do not include a null value

Open xbourretsicotte opened this issue 4 years ago • 0 comments

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

xbourretsicotte avatar Jan 17 '21 15:01 xbourretsicotte