# cohort-retention

build a monthly cohort retention table from user activity events

- **Space:** data-science-public (https://github.com/Tech-Realm/space-data-science-public/tree/main/cohort-retention)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** python-stdlib; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use data-science-public/cohort-retention` or MCP `get_pack data-science-public/cohort-retention`
- **Files:** CHANGELOG.md, code/cohorts.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/e.csv, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal

Build a monthly cohort retention table from user activity events.

## Steps

1. Export one row per user activity (login, order) with a date.
2. Run cohorts.py.
3. Read down each column: is month-N retention improving for newer cohorts?

## Edge cases

- Users with activity before the export window look like new users.
- Use weekly cohorts for fast-moving products (change the bucketing).

## Don'ts

- Don't mix signup and activity definitions between periods.

## Routes (free first)

1. `python-stdlib`: `code/cohorts.py` (no install).



---

Canonical URL: https://logicpacks.io/packs/data-science-public/cohort-retention

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
