Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Implement higher order markov chain models #45

Open
taksqth opened this issue Nov 4, 2021 · 2 comments · May be fixed by #50
Open

[NEW] Implement higher order markov chain models #45

taksqth opened this issue Nov 4, 2021 · 2 comments · May be fixed by #50
Assignees
Labels
enhancement New feature or request python Pull requests that update Python code

Comments

@taksqth
Copy link
Contributor

taksqth commented Nov 4, 2021

The Markov Attribution implemented uses a first order markov chain model to compute the removal effects for each channel. This underlying model assumes that the probability of the next future state depends only in the current state and none of the previous. It is reasonable to state that this is not an appropriate assumption for the buyer journey and it would be useful to allow for higher order markov models.

I'm not sure if this is the best way, but one way to accomplish this is to expand the state space to include all the recent states up to the order r we're trying to model, introducing a new null state (not to be confused with the state representing non converting paths) to pad the start of the transition chain. The removal effect algorithm will need to be changed, since there will be multiple states associated with the original one we wanted to remove.

@taksqth taksqth added enhancement New feature or request python Pull requests that update Python code labels Nov 4, 2021
@taksqth
Copy link
Contributor Author

taksqth commented Nov 4, 2021

There is research showing that order 4 worked better in some cases for attribution:
https://www.researchgate.net/publication/322896486_Multichannel_Marketing_Attribution_Using_Markov_Chains

It should also be possible to implement a way to find the best fit automatically using any of the 3 methods here:
https://medium.com/@ph_singer/order-estimation-for-markov-chain-models-6cde3ad2410b

@taksqth taksqth self-assigned this Nov 4, 2021
@taksqth taksqth linked a pull request Nov 23, 2021 that will close this issue
@taksqth
Copy link
Contributor Author

taksqth commented Nov 23, 2021

With this PR I've implemented the parameter order in the mam.attribution_markov method. Passing order=1 is equivalent to current behavior, but other values perform Markov attribution using higher order Markov models. I've also taken liberty in including 3 new parameters for defining the names of the auxiliary states (already present in the current version): start_state_name, conversion_state_name and null_state_name.

If this is merged, we can go further and implement a new parâmeter, tentatively called auto, which would allow the method to evaluate the best value for order in using the method described in the aforementioned articles. This should be a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant