Registry / data / marketing-attribution-models

marketing-attribution-models

JSON →
library1.0.10pypypiunverified

A library for marketing attribution modeling, providing implementations of popular attribution methods such as first-click, last-click, linear, time-decay, position-based, and Markov chain models. Current version 1.0.11, with an active maintenance cadence on GitHub. Requires Python >=3.5.

pip install marketing-attribution-models
INSTALL
IMPORT
SIG · MARKETING-ATTRIBUT
M
marketing-attribution-models
datapythonv1.0.10
Install
12.0s avg
Import
Disk
257MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 254.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 12.0s · import 0.000s · 243MB
257MB installed
● package 257MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AttributionModel
from marketing_attribution_models import AttributionModel
from marketing_attribution_models import AttributionModel

Create a HeuristicAttribution model with the 'linear' method and fit it to sample journey data.

import pandas as pd from marketing_attribution_models import HeuristicAttribution # Sample journey data journeys = pd.DataFrame({ 'path': ['A > B > C', 'A > C > B'], 'conversion': [1, 0], 'revenue': [100, 0] }) model = HeuristicAttribution(method='linear') result = model.attribution(journeys) print(result)
Debug
Known issues
breakingIn v1.0.9, the method 'first_click' was renamed to 'first-click' to conform with other method names. Code using 'first_click' will break.
fix
Use 'first-click' instead of 'first_click' as the method argument.
affects: >=1.0.9
deprecatedThe 'attribution' method on HeuristicAttribution and MarkovChainAttribution now requires a DataFrame instead of a CSV file path. Passing a file path is deprecated.
fix
Read the CSV into a DataFrame with pd.read_csv before calling attribution.
affects: >=1.0.9
gotchaThe 'path' column must use ' > ' (space-greater than-space) as separator. Other delimiters like '>>' or '->' will cause incorrect parsing.
fix
Ensure the path column uses ' > ' as the separator between touchpoints.
affects: all
Upgrade
Version history
1.0.10latest on PyPI · released Jul 11, 2022
Audit
Dependencies
pandasrequiredRequired for data manipulation and DataFrame operations
numpyrequiredUsed for numerical computations
matplotliboptionalUsed for plotting attribution results
Agent activity
2 hits · last 30 days
node
2
Resources
marketing-attribution-models — pip install marketing-attribution-models · libregistry