-
Notifications
You must be signed in to change notification settings - Fork 0
Home
🇬🇧 English first · 🇪🇸 Español más abajo.
A logistic-regression classifier that flags which subscription customers are about to cancel — and, through its coefficients, says why. The results are exported as JSON and rendered in an interactive dashboard.
Repo: mindset-code/project-churn-analysis Live: proyectos-mindset-code.web.app/churn
- Modelo de ML — model, split and metrics
- Datos y features — how the dataset is generated and which features feed the model
- Dashboard interactivo — the JSON contract and the components that consume it
flowchart LR
A["generate_data.py<br/>2.000 synthetic customers"] --> B["churn_data.csv"]
B --> C["One-hot on SubscriptionType"]
C --> D["Stratified split 75/25"]
D --> E["StandardScaler"]
E --> F["LogisticRegression<br/>class_weight='balanced'"]
F --> G["Metrics + coefficients"]
G --> H["7 JSON files in data/"]
H --> I["React dashboard<br/>in project-portfolio"]
The two halves live in different repositories on purpose: this repo holds the analysis
(two Python scripts, no framework), and project-portfolio
holds the React app that reads the JSON files under public/data/churn/.
| Layer | Technology |
|---|---|
| Data | Python · NumPy · pandas — the dataset is generated, not downloaded |
| ML | scikit-learn — LogisticRegression, StandardScaler, train_test_split
|
| Evaluation | accuracy · precision · recall · F1 · AUC-ROC · confusion matrix |
| Charts | seaborn + matplotlib (PNG) · Recharts (web) |
| Hosting | Firebase Hosting, served by project-portfolio
|
The goal is not to squeeze out the last point of accuracy: it is to be able to say which lever moves churn. A logistic regression gives one coefficient per feature, with a sign and a magnitude, on comparable scales because the features are standardised first. A gradient boosting would probably score higher and would not answer the question the project exists to answer.
class_weight='balanced' is there because the classes are not even: without it the
model gets a good accuracy by rarely predicting churn, which is precisely the case
that matters.
Un clasificador de regresión logística que señala qué clientes de suscripción están a punto de cancelar y, a través de sus coeficientes, dice por qué. Los resultados se exportan como JSON y se pintan en un cuadro de mando interactivo.
Repo: mindset-code/project-churn-analysis Live: proyectos-mindset-code.web.app/churn
- Modelo de ML — modelo, partición y métricas
- Datos y features — cómo se genera el dataset y qué features entran al modelo
- Dashboard interactivo — el contrato JSON y los componentes que lo consumen
Ver el diagrama de arriba. En texto: generate_data.py crea 2.000 clientes
sintéticos y los deja en churn_data.csv; churn_analysis.py convierte el tipo de
suscripción en variables ficticias, parte los datos en 75/25 de forma
estratificada, estandariza, entrena la regresión logística y escribe siete ficheros
JSON en data/. El cuadro de mando de React los lee desde otro repositorio.
Las dos mitades viven en repositorios distintos a propósito: aquí está el análisis
(dos scripts de Python, sin framework) y en
project-portfolio está la
aplicación de React que lee los JSON de public/data/churn/.
| Capa | Tecnología |
|---|---|
| Datos | Python · NumPy · pandas — el dataset se genera, no se descarga |
| ML | scikit-learn — LogisticRegression, StandardScaler, train_test_split
|
| Evaluación | accuracy · precisión · recall · F1 · AUC-ROC · matriz de confusión |
| Gráficos | seaborn + matplotlib (PNG) · Recharts (web) |
| Hosting | Firebase Hosting, servido por project-portfolio
|
El objetivo no es exprimir el último punto de acierto: es poder decir qué palanca mueve la cancelación. Una regresión logística da un coeficiente por variable, con signo y magnitud, en escalas comparables porque antes se estandarizan las variables. Un gradient boosting probablemente puntuaría más alto y no respondería a la pregunta por la que existe el proyecto.
class_weight='balanced' está porque las clases no están igualadas: sin eso el
modelo saca buen acierto global sin apenas predecir cancelaciones, que es
justamente el caso que importa.