Skip to main content

CLV prediction

Project description

SocraCLV

Group project within the scope of the course DS223 – Marketing Analytics

The project aims to develop a Python package for predicting a customer's Lifetime Value (CLV) for an Internet package provider that can be applied to similar-scope companies in general. As the name suggests, the package is not just about analytics but involves a philosophically flavoured approach to understanding and predicting Customer Lifetime Value to gain meaningful insights about the long-term relationships between the company and customers.

SetUp

To get started, run

python -m clv.db.schema to create the schema

python basic_clv.py to load the data in the root of the repo

python calculate_clv.py To calculate CLV and put into dataset OR python -m clv.db.schema && python basic_clv.py && python calculate_clv.py and python -m clv.api.fast to run the api

To check the db follow the link https://inloop.github.io/sqlite-viewer/

POST example of clv prediction table

curl -X 'GET' \
  'http://127.0.0.1:8000/clv/2' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json'
curl -X 'POST' \
  'http://127.0.0.1:8000/clv/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
"prediction_id": 9999,
"customer_id": 1,
"clv" :200,
"predicted_customer_type": "Lost Cause",
"is_campaign1_success": true,
"is_campaign2_success": true

}  '

PUT example of clv prediction table

curl -X 'PUT' \
  'http://127.0.0.1:8000/clv/10' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
"clv" :200,
"predicted_customer_type": "Vulnerable Customer",
"is_campaign1_success": true,
"is_campaign2_success": true
}'

DELETE example data from clv prediction table

curl -X 'DELETE' \
  'http://127.0.0.1:8000/clv/2' \
  -H 'accept: application/json'

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

SocraCLV-0.9.9.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

SocraCLV-0.9.9-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file SocraCLV-0.9.9.tar.gz.

File metadata

  • Download URL: SocraCLV-0.9.9.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for SocraCLV-0.9.9.tar.gz
Algorithm Hash digest
SHA256 f5bfc016e4138be0547b4c4e5746b2cd422045388b594aedcb29c4730402a444
MD5 6f063f914afb4bbe4ada66b069d56b44
BLAKE2b-256 4a601e63c847b50f059a71dc18bc268a3031b4227c65adc0c811a144cfc21f36

See more details on using hashes here.

File details

Details for the file SocraCLV-0.9.9-py3-none-any.whl.

File metadata

  • Download URL: SocraCLV-0.9.9-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for SocraCLV-0.9.9-py3-none-any.whl
Algorithm Hash digest
SHA256 da48e7f3dc79f65eae9f445ca15c6063035b73b18d21082c3b8b5cccfa9dc4e5
MD5 014bf3e5627cc3015bff3268e09f9154
BLAKE2b-256 f9e207a541ef866be50b193a29967a46e839b9e628957aed118e35dd49d66464

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