# tdiprima/applied-ml architecture

> Architecture diagram of the GitHub repository tdiprima/applied-ml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tdiprima/applied-ml
- Repository: https://github.com/tdiprima/applied-ml

## Overview

This repository is a collection of seven standalone applied-ML examples, not a single end-to-end service. Each script reads its own CSV, trains or fits a model, and presents task-specific predictions, evaluations, summaries, or forecast/anomaly artifacts. The graph preserves the documented classification, segmentation, forecasting, anomaly-detection, and regression projects. Source was sampled for all seven scripts; links show only their documented or directly visible data and execution flow.

Main entry points: [`src/rf-lead-qualification/train_model.py`](https://github.com/tdiprima/applied-ml/blob/main/src/rf-lead-qualification/train_model.py) (Lead qualification), [`src/logreg-ticket-classifier/classifier.py`](https://github.com/tdiprima/applied-ml/blob/main/src/logreg-ticket-classifier/classifier.py) (Ticket classifier), [`src/nb-spam-filter/email_classifier.py`](https://github.com/tdiprima/applied-ml/blob/main/src/nb-spam-filter/email_classifier.py) (Spam filter), [`src/kmeans-customer-segmentation/segment_customers.py`](https://github.com/tdiprima/applied-ml/blob/main/src/kmeans-customer-segmentation/segment_customers.py) (Customer segmentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_classification["Classification"]
  node_ticket_data["Support tickets"]
  node_ticket_classifier["Ticket classifier<br/>[classifier.py]"]
  node_lead_train["Training leads<br/>[leads_train.csv]"]
  node_lead_test["Test leads<br/>[leads_test.csv]"]
  node_lead_model["Lead qualification<br/>[train_model.py]"]
  node_email_data["Email examples<br/>[emails.csv]"]
  node_spam_filter["Spam filter"]
end

subgraph group_segmentation["Segmentation"]
  node_customer_data["Customer records<br/>[customers.csv]"]
  node_customer_segments["Customer segmentation"]
end

subgraph group_forecasting["Forecasting"]
  node_task_data["Task history<br/>[task_volumes.csv]"]
  node_task_forecaster["Task volume forecast"]
  node_revenue_data["Revenue history<br/>[revenue_data.csv]"]
  node_revenue_predictor["Revenue prediction"]
end

subgraph group_prediction["Prediction"]
  node_metrics_data["System metrics<br/>[system_metrics.csv]"]
  node_anomaly_detector["Anomaly detection"]
end

node_user(("Analyst"))

node_user -->|"runs"| node_ticket_classifier
node_ticket_data -->|"loads"| node_ticket_classifier
node_ticket_classifier -->|"classifies tickets"| node_user
node_user -->|"runs"| node_lead_model
node_lead_train -->|"loads training data"| node_lead_model
node_lead_test -->|"loads test data"| node_lead_model
node_lead_model -->|"reports lead scores"| node_user
node_user -->|"runs"| node_spam_filter
node_email_data -->|"loads"| node_spam_filter
node_spam_filter -->|"classifies email"| node_user
node_user -->|"runs"| node_customer_segments
node_customer_data -->|"loads"| node_customer_segments
node_customer_segments -->|"reports segments"| node_user
node_user -->|"runs"| node_task_forecaster
node_task_data -->|"loads"| node_task_forecaster
node_task_forecaster -->|"reports forecast"| node_user
node_user -->|"runs"| node_revenue_predictor
node_revenue_data -->|"loads"| node_revenue_predictor
node_revenue_predictor -->|"reports predictions"| node_user
node_user -->|"runs"| node_anomaly_detector
node_metrics_data -->|"loads"| node_anomaly_detector
node_anomaly_detector -->|"reports anomalies"| node_user

click node_ticket_data "https://github.com/tdiprima/applied-ml/blob/main/src/logreg-ticket-classifier/support_tickets.csv"
click node_ticket_classifier "https://github.com/tdiprima/applied-ml/blob/main/src/logreg-ticket-classifier/classifier.py"
click node_lead_train "https://github.com/tdiprima/applied-ml/blob/main/src/rf-lead-qualification/leads_train.csv"
click node_lead_test "https://github.com/tdiprima/applied-ml/blob/main/src/rf-lead-qualification/leads_test.csv"
click node_lead_model "https://github.com/tdiprima/applied-ml/blob/main/src/rf-lead-qualification/train_model.py"
click node_email_data "https://github.com/tdiprima/applied-ml/blob/main/src/nb-spam-filter/data/emails.csv"
click node_spam_filter "https://github.com/tdiprima/applied-ml/blob/main/src/nb-spam-filter/email_classifier.py"
click node_customer_data "https://github.com/tdiprima/applied-ml/blob/main/src/kmeans-customer-segmentation/customers.csv"
click node_customer_segments "https://github.com/tdiprima/applied-ml/blob/main/src/kmeans-customer-segmentation/segment_customers.py"
click node_task_data "https://github.com/tdiprima/applied-ml/blob/main/src/prophet-task-forecaster/task_volumes.csv"
click node_task_forecaster "https://github.com/tdiprima/applied-ml/blob/main/src/prophet-task-forecaster/prophet_forecaster.py"
click node_revenue_data "https://github.com/tdiprima/applied-ml/blob/main/src/lr-revenue-forecaster/data/revenue_data.csv"
click node_revenue_predictor "https://github.com/tdiprima/applied-ml/blob/main/src/lr-revenue-forecaster/revenue_predictor.py"
click node_metrics_data "https://github.com/tdiprima/applied-ml/blob/main/src/isolation-forest-system-anomaly/system_metrics.csv"
click node_anomaly_detector "https://github.com/tdiprima/applied-ml/blob/main/src/isolation-forest-system-anomaly/anomaly_detector.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ticket_data,node_ticket_classifier,node_lead_train,node_lead_test,node_lead_model,node_email_data,node_spam_filter toneBlue
class node_customer_data,node_customer_segments toneAmber
class node_task_data,node_task_forecaster,node_revenue_data,node_revenue_predictor toneMint
class node_metrics_data,node_anomaly_detector toneRose
class node_user toneIndigo
```

## Components

### Classification

- [Support tickets](https://github.com/tdiprima/applied-ml/blob/main/src/logreg-ticket-classifier/support_tickets.csv): `src/logreg-ticket-classifier/support_tickets.csv`
- [Ticket classifier](https://github.com/tdiprima/applied-ml/blob/main/src/logreg-ticket-classifier/classifier.py): `src/logreg-ticket-classifier/classifier.py`
- [Training leads](https://github.com/tdiprima/applied-ml/blob/main/src/rf-lead-qualification/leads_train.csv): `src/rf-lead-qualification/leads_train.csv`
- [Test leads](https://github.com/tdiprima/applied-ml/blob/main/src/rf-lead-qualification/leads_test.csv): `src/rf-lead-qualification/leads_test.csv`
- [Lead qualification](https://github.com/tdiprima/applied-ml/blob/main/src/rf-lead-qualification/train_model.py): `src/rf-lead-qualification/train_model.py`
- [Email examples](https://github.com/tdiprima/applied-ml/blob/main/src/nb-spam-filter/data/emails.csv): `src/nb-spam-filter/data/emails.csv`
- [Spam filter](https://github.com/tdiprima/applied-ml/blob/main/src/nb-spam-filter/email_classifier.py): `src/nb-spam-filter/email_classifier.py`

### Segmentation

- [Customer records](https://github.com/tdiprima/applied-ml/blob/main/src/kmeans-customer-segmentation/customers.csv): `src/kmeans-customer-segmentation/customers.csv`
- [Customer segmentation](https://github.com/tdiprima/applied-ml/blob/main/src/kmeans-customer-segmentation/segment_customers.py): `src/kmeans-customer-segmentation/segment_customers.py`

### Forecasting

- [Task history](https://github.com/tdiprima/applied-ml/blob/main/src/prophet-task-forecaster/task_volumes.csv): `src/prophet-task-forecaster/task_volumes.csv`
- [Task volume forecast](https://github.com/tdiprima/applied-ml/blob/main/src/prophet-task-forecaster/prophet_forecaster.py): `src/prophet-task-forecaster/prophet_forecaster.py`
- [Revenue history](https://github.com/tdiprima/applied-ml/blob/main/src/lr-revenue-forecaster/data/revenue_data.csv): `src/lr-revenue-forecaster/data/revenue_data.csv`
- [Revenue prediction](https://github.com/tdiprima/applied-ml/blob/main/src/lr-revenue-forecaster/revenue_predictor.py): `src/lr-revenue-forecaster/revenue_predictor.py`

### Prediction

- [System metrics](https://github.com/tdiprima/applied-ml/blob/main/src/isolation-forest-system-anomaly/system_metrics.csv): `src/isolation-forest-system-anomaly/system_metrics.csv`
- [Anomaly detection](https://github.com/tdiprima/applied-ml/blob/main/src/isolation-forest-system-anomaly/anomaly_detector.py): `src/isolation-forest-system-anomaly/anomaly_detector.py`

### Other components

- **Analyst**

## Connections

- Analyst → Ticket classifier: runs
- Support tickets → Ticket classifier: loads
- Ticket classifier → Analyst: classifies tickets
- Analyst → Lead qualification: runs
- Training leads → Lead qualification: loads training data
- Test leads → Lead qualification: loads test data
- Lead qualification → Analyst: reports lead scores
- Analyst → Spam filter: runs
- Email examples → Spam filter: loads
- Spam filter → Analyst: classifies email
- Analyst → Customer segmentation: runs
- Customer records → Customer segmentation: loads
- Customer segmentation → Analyst: reports segments
- Analyst → Task volume forecast: runs
- Task history → Task volume forecast: loads
- Task volume forecast → Analyst: reports forecast
- Analyst → Revenue prediction: runs
- Revenue history → Revenue prediction: loads
- Revenue prediction → Analyst: reports predictions
- Analyst → Anomaly detection: runs
- System metrics → Anomaly detection: loads
- Anomaly detection → Analyst: reports anomalies
