// the find
DP6/Marketing-Attribution-Models
Python Class created to address problems regarding Digital Marketing Attribution.
A Python class implementing multi-channel marketing attribution models — both heuristic (last click, first click, linear, time decay, position-based) and algorithmic (Shapley value, Markov chains). Aimed at digital marketing analysts who want to move beyond Google Analytics' default last-click attribution without building the math themselves. Installable via pip with a pandas-centric API.
The Markov chain implementation returns the full transition matrix and removal effect table, not just the final attribution numbers — useful for actually understanding channel dependencies. The `conversion_value_as_frequency` parameter for Markov is a practical fix for the memory blowup that hits anyone working with real-scale clickstream data. The random DataFrame generator makes it easy to try the models before wiring in real data. Built-in `group_by_channels_models` accumulates results across model runs, so side-by-side comparison is one `.plot()` call away.
The entire library lives in a single 1000+ line file (MAM.py) with no internal modularity — debugging the Shapley implementation means scrolling through everything else. The Shapley `size` parameter silently truncates journey length, which can significantly distort results for long funnels; the README mentions this but doesn't quantify the error. No support for fractional or revenue-weighted conversion values in the heuristic models without workarounds. Last meaningful commit activity suggests maintenance is stagnant — open issues and PRs appear to sit unaddressed, which matters if you hit an edge case with your data format.