Skip to main content

Propensity to buy marketing model measurement

Project description

Author: Dhivya Nagasubramanian

Purpose:

The purpose of this package is to provide an efficient method for calculating and analyzing cumulative event rates, cumulative non-event rates, and the Kolmogorov-Smirnov (KS) statistic in datasets. It is particularly useful for evaluating the performance of predictive models in fields like credit scoring, risk analysis, and marketing campaigns, where distinguishing between "events" (e.g., defaults, purchases, etc.) and "non-events" is essential.

This package automates the following key calculations:

Cumulative Event and Non-Event Rates: It computes cumulative event and non-event rates over time or samples. These rates are critical for evaluating the predictive model's ability to distinguish between events and non-events.

Cumulative Random Rate: It tracks the cumulative rate of random events, allowing for comparison between actual events and a random baseline.

Kolmogorov-Smirnov (KS) Statistic: The package computes the KS statistic, which measures the maximum difference between the cumulative event rate and the cumulative non-event rate. This statistic is a key indicator of model discrimination, with higher values indicating better model performance.

Lift: The Lift metric measures the improvement in predictive accuracy over random selection. It quantifies how much more likely an event is to occur in a given segment of a population compared to the average likelihood across the entire population. Lift is crucial for evaluating the effectiveness of predictive models in targeting high-probability events.

Population Stability Index (PSI): PSI is a tool to monitor the stability of model distributions over time or between different segments. It quantifies shifts in the distribution of a target variable (e.g., predicted probabilities) between different time periods or groups, helping analysts assess whether the model remains relevant or if recalibration is necessary.

---------------------------------------------------------------------------------------------------------------------------------------------

Requirements packages:

NumPy - Adds support for large, multi-dimensional arrays, matrices and high-level mathematical functions to operate on these arrays.
random - generate random numbers with in the set limits.
pandas - Dataframe utility.

---------------------------------------------------------------------------------------------------------------------------------------------

Installation Instructions:

pip install marketing-measure

---------------------------------------------------------------------------------------------------------------------------------------------
How to use it :

There are two main functions of this framework.

1. generate_propensity_score_dataset()

2. marketing_measure(data,prob,ID,target, i_percent,bins)

---------------------------------------------------------------------------------------------------------------------------------------------

How to test the package with out data ?

Step1 - Run with "generate_propensity_score_dataset"

eg: df_example = generate_random_data().

Step2 - Run marketing_measure(data,prob,ID,target, i_percent,bins)

eg: dfresult = marketing_measure(data,propensity_score,customer_id,target, 0.1,10)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marketing_measure-0.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

marketing_measure-0.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file marketing_measure-0.0.1.tar.gz.

File metadata

  • Download URL: marketing_measure-0.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for marketing_measure-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b89bb3f78fccc855ad42b6369f094ffad619df33f85e7fa590805a7cfca666f7
MD5 f8ec56356e2062415f8e4049142a2a99
BLAKE2b-256 565d1cd36c778cdca3feaaf5a1aca327b548da34cd7a97dcc173f50e01c84bfc

See more details on using hashes here.

File details

Details for the file marketing_measure-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for marketing_measure-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 504987f44af472ebe6607fe641eb160ceb9167bcf44bef69b417899723809005
MD5 221a82863e311f1f27659a2225982867
BLAKE2b-256 6057f7d7366fcf189c1f72599fd38f46811f3ab92a44d5a6d0cfbde81b533688

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page