clumpi


Nameclumpi JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/jniimi/clumpi
SummaryCalculate Clumpiness index by Zhang, Bradlow and Small (2015)
upload_time2023-09-02 13:08:56
maintainer
docs_urlNone
authorjniimi
requires_python
licenseMIT
keywords rfmc clumpiness marketing crm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # clumpi [klˈʌmpάɪ]
![sample data in pandas DataFrame](images/sample1.png)
## Overview
A simple python package to calculate Clumpiness for RMFC analysis by Zhang, Bradlow & Small (2015).
Easy use with `clumpi.get_RFC()`

## Requirements
- Python
- pandas
- numpy

works well with Google Colab.

## Installation
```bash
pip install git+https://github.com/jniimi/clumpi.git
```
## Dataset
Use your time-series event data with ID and time. 
- Create DataFrame that records only the point in time when the event occurred in the time series data. 
- The name of the variables can be anything.

| user_id | t       |
|:--------|--------:|
| Ava     | 1       |
| Ava     | 4       |
| ...     | ...     |
| Jack    | 3       |
| Jack    | 10      |
| ...     | ...     |

Check out our sample dataset for further details.
```python
df = clumpi.load_sample_data()
display(df)
```
![sample data in pandas DataFrame](images/sample2.png)

## Usage
### Log to Clumpiness
Use the function `clumpi.get_RFC()` to calculate. Specify following information for the arguments.
- `id`: a var name in df indicating user
- `t`: a var name in df indicating time
- `N`: total number of events can occur during the period
- `M` (optional): a number of iterations for the simulation to calculate threshold (3000 for default)
- `alpha` (optional): significance probability for the test of regularity (0.05 for default)

### Simply Calculate H0
Use the function `clumpi.calc_threshold()` to calculate upper `alpha` % point in `M` times simulation. 

All you need to specify are `N`, `M`, and `alpha` (See `clumpi.get_RFC`).

# Acknoledgement
The simulation in this package is based on Appendix B by Zhang et al. (2015).

Zhang, Y., Bradlow, E. T., & Small, D. S. (2015). Predicting customer value using clumpiness: From RFM to RFMC. Marketing Science, 34(2), 195-208.
https://doi.org/10.1287/mksc.2014.0873

# Author
jniimi ([@JvckAndersen](https://twitter.com/JvckAndersen))

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jniimi/clumpi",
    "name": "clumpi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "RFMC Clumpiness marketing CRM",
    "author": "jniimi",
    "author_email": "jniimi@meijo-u.ac.jp",
    "download_url": "https://files.pythonhosted.org/packages/c2/38/88f37b26f3415baaa6594ca74b03342c970cfabe4a622acb17d484d7d208/clumpi-0.0.1.tar.gz",
    "platform": null,
    "description": "# clumpi [kl\u02c8\u028cmp\u03ac\u026a]\n![sample data in pandas DataFrame](images/sample1.png)\n## Overview\nA simple python package to calculate Clumpiness for RMFC analysis by Zhang, Bradlow & Small (2015).\nEasy use with `clumpi.get_RFC()`\n\n## Requirements\n- Python\n- pandas\n- numpy\n\nworks well with Google Colab.\n\n## Installation\n```bash\npip install git+https://github.com/jniimi/clumpi.git\n```\n## Dataset\nUse your time-series event data with ID and time. \n- Create DataFrame that records only the point in time when the event occurred in the time series data. \n- The name of the variables can be anything.\n\n| user_id | t       |\n|:--------|--------:|\n| Ava     | 1       |\n| Ava     | 4       |\n| ...     | ...     |\n| Jack    | 3       |\n| Jack    | 10      |\n| ...     | ...     |\n\nCheck out our sample dataset for further details.\n```python\ndf = clumpi.load_sample_data()\ndisplay(df)\n```\n![sample data in pandas DataFrame](images/sample2.png)\n\n## Usage\n### Log to Clumpiness\nUse the function `clumpi.get_RFC()` to calculate. Specify following information for the arguments.\n- `id`: a var name in df indicating user\n- `t`: a var name in df indicating time\n- `N`: total number of events can occur during the period\n- `M` (optional): a number of iterations for the simulation to calculate threshold (3000 for default)\n- `alpha` (optional): significance probability for the test of regularity (0.05 for default)\n\n### Simply Calculate H0\nUse the function `clumpi.calc_threshold()` to calculate upper `alpha` % point in `M` times simulation. \n\nAll you need to specify are `N`, `M`, and `alpha` (See `clumpi.get_RFC`).\n\n# Acknoledgement\nThe simulation in this package is based on Appendix B by Zhang et al. (2015).\n\nZhang, Y., Bradlow, E. T., & Small, D. S. (2015). Predicting customer value using clumpiness: From RFM to RFMC. Marketing Science, 34(2), 195-208.\nhttps://doi.org/10.1287/mksc.2014.0873\n\n# Author\njniimi ([@JvckAndersen](https://twitter.com/JvckAndersen))\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Calculate Clumpiness index by Zhang, Bradlow and Small (2015)",
    "version": "0.0.1",
    "project_urls": {
        "Download": "https://github.com/jniimi/clumpi",
        "Homepage": "https://github.com/jniimi/clumpi"
    },
    "split_keywords": [
        "rfmc",
        "clumpiness",
        "marketing",
        "crm"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c23888f37b26f3415baaa6594ca74b03342c970cfabe4a622acb17d484d7d208",
                "md5": "2070ed20aed9cdea9a8aadff04759983",
                "sha256": "31d2745f185797551581931fb1bb0cee7ad01be18ade7ee845ba19b8e2f0e94d"
            },
            "downloads": -1,
            "filename": "clumpi-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2070ed20aed9cdea9a8aadff04759983",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4229,
            "upload_time": "2023-09-02T13:08:56",
            "upload_time_iso_8601": "2023-09-02T13:08:56.672048Z",
            "url": "https://files.pythonhosted.org/packages/c2/38/88f37b26f3415baaa6594ca74b03342c970cfabe4a622acb17d484d7d208/clumpi-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-02 13:08:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jniimi",
    "github_project": "clumpi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "clumpi"
}
        
Elapsed time: 0.11975s