Skip to content

Add Churn Explorer Streamlit app, Docker image and CI - #3

Merged
Martinoor merged 2 commits into
mainfrom
feature/streamlit-app
Sep 16, 2026
Merged

Martinoor merged 2 commits into
mainfrom
feature/streamlit-app

Conversation

@Martinoor

Copy link
Copy Markdown
Owner

Summary

  • src/churn_app: an installable package for loading event logs (parquet/CSV from a path, bytes or upload; batched reads with date-range and deterministic user sampling), schema validation, PII dropping, filtering (EventFilter), churn labels (ever / competition horizon), leakage-safe user features, and sklearn models with the threshold tuned for balanced accuracy.
  • app/streamlit_app.py: Overview, Segments, User drill-down, Churn model and Data tabs. Runs on a deterministic synthetic sample, or on the real Kaggle files when they are mounted at /data or uploaded.
  • Tests: 103 tests, 98% branch coverage. They include detailed tests of the import and filtering functions, plus headless AppTest end-to-end runs.
  • Container: multi-stage Dockerfile with digest-pinned bases, uv.lock --frozen, a non-root user and a healthcheck. docker-compose.yml is included.
  • CI: lockfile check, ruff, pytest on 3.12/3.13, then image build and container smoke test. On main and tags it pushes a multi-arch image to ghcr.io/martinoor/churn-explorer.
  • Dependabot, pre-commit, Makefile, README docs. The research code is untouched.

Test plan

  • make lint and make test pass locally (103 passed)
  • docker build works; the container turns healthy, runs as UID 10001 and reads a parquet file mounted at /data
  • Every tab checked in the browser, including model training
  • CI green on this PR

🤖 Generated with Claude Code

Martinoor and others added 2 commits September 16, 2026 15:53
- src/churn_app: batched parquet/csv loading (path, bytes, upload) with
  date-range and deterministic user sampling, schema validation, PII
  dropping, normalisation, EventFilter, ever/horizon churn labels,
  leakage-safe user features, sklearn models with balanced-accuracy
  threshold tuning, deterministic synthetic data generator (+ CLI)
- app/streamlit_app.py: overview, segments, user drill-down, churn
  model and data tabs
- tests: 103 unit and headless AppTest end-to-end tests, 98% coverage
- uv.lock + .python-version, digest-pinned multi-stage non-root
  Dockerfile with healthcheck, docker-compose
- GitHub Actions: lockfile check, ruff, pytest on 3.12/3.13, image
  build + container smoke test, multi-arch push to GHCR on main/tags
- Dependabot, pre-commit, Makefile, README documentation

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Martinoor
Martinoor merged commit cbbd5b2 into main Sep 16, 2026
4 checks passed
@Martinoor
Martinoor deleted the feature/streamlit-app branch September 16, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant