# shalinvachheta017/masterarbeit_mlops architecture

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

- Interactive diagram: https://gitdiagram.com/shalinvachheta017/masterarbeit_mlops
- Repository: https://github.com/shalinvachheta017/masterarbeit_mlops

## Overview

This is an offline-first MLOps pipeline for wearable-sensor human activity recognition. Its principal workflow turns accelerometer and gyroscope recordings into validated, transformed windows, predictions, evaluation and monitoring evidence, then a trigger decision. Retraining, registration and baseline updates are a separate approval-gated path; the README says stages 8–10 require human review and are not automatic. The production pipeline orchestrates the runtime stages and passes stage artifacts. The API is an additional inference entry point. Unsampled components are included where documented, but their internal calls are not inferred.

Main entry points: [`src/pipeline/production_pipeline.py`](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/pipeline/production_pipeline.py) (Production orchestrator), [`src/components/model_inference.py`](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/model_inference.py) (Model inference), [`src/components/data_transformation.py`](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/data_transformation.py) (Window transformation), [`src/components/post_inference_monitoring.py`](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/post_inference_monitoring.py) (Post-inference monitoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Inference pipeline"]
  node_orchestrator["Production orchestrator"]
  node_ingestion["Sensor ingestion<br/>[data_ingestion.py]"]
  node_validation["Data validation<br/>[data_validation.py]"]
  node_transformation["Window transformation"]
  node_inference["Model inference<br/>[model_inference.py]"]
  node_evaluation["Prediction evaluation"]
  node_monitoring["Post-inference monitoring"]
  node_drift["Drift analysis<br/>[drift_monitor.py]"]
  node_trigger["Trigger evaluation"]
end

subgraph group_governance["Model governance"]
  node_retraining["Model retraining"]
  node_registration["Model registration"]
  node_rollback["Model rollback<br/>[model_rollback.py]"]
  node_baseline["Baseline update<br/>[baseline_update.py]"]
  node_calibration["Calibration uncertainty"]
end

subgraph group_interfaces["Entry points"]
  node_run_pipeline["Pipeline CLI<br/>[run_pipeline.py]"]
  node_api["Inference API<br/>[app.py]"]
end

subgraph group_internals["Shared internals"]
  node_artifacts["Stage artifacts<br/>[artifact_entity.py]"]
  node_scaler["Scaler integrity<br/>[scaler.py]"]
  node_labels["Activity label mapping<br/>[label_mapping.py]"]
  node_tracking["MLflow tracking<br/>[mlflow_tracking.py]"]
end

node_sensor_data["Sensor recordings"]
node_user(("Pipeline operator"))
node_reviewer(("Human reviewer"))

node_user -->|"starts run"| node_run_pipeline
node_run_pipeline -->|"runs pipeline"| node_orchestrator
node_sensor_data -->|"provides recordings"| node_ingestion
node_orchestrator -->|"runs stage"| node_ingestion
node_ingestion -->|"fused data"| node_validation
node_validation -->|"validated data"| node_transformation
node_transformation -->|"windowed input"| node_inference
node_inference -->|"predictions"| node_evaluation
node_evaluation -->|"evaluation evidence"| node_monitoring
node_monitoring -.->|"analyzes drift"| node_drift
node_monitoring -->|"monitoring evidence"| node_trigger
node_trigger -->|"requests review"| node_reviewer
node_reviewer -->|"approves retraining"| node_retraining
node_retraining -->|"trained model"| node_registration
node_registration -->|"registered model"| node_baseline
node_registration -.->|"rollback support"| node_rollback
node_user -->|"uploads data"| node_api
node_api -.->|"requests inference"| node_inference
node_orchestrator -.->|"optional stage"| node_calibration
node_transformation -->|"uses scaler"| node_scaler
node_inference -->|"uses mappings"| node_labels
node_api -->|"uses mappings"| node_labels
node_orchestrator -->|"passes artifacts"| node_artifacts
node_retraining -.->|"tracks training"| node_tracking

click node_run_pipeline "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/run_pipeline.py"
click node_api "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/api/app.py"
click node_orchestrator "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/pipeline/production_pipeline.py"
click node_ingestion "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/data_ingestion.py"
click node_validation "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/data_validation.py"
click node_transformation "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/data_transformation.py"
click node_inference "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/model_inference.py"
click node_evaluation "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/model_evaluation.py"
click node_monitoring "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/post_inference_monitoring.py"
click node_drift "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/monitoring/drift_monitor.py"
click node_trigger "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/trigger_evaluation.py"
click node_retraining "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/model_retraining.py"
click node_registration "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/model_registration.py"
click node_rollback "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/model_rollback.py"
click node_baseline "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/baseline_update.py"
click node_calibration "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/calibration_uncertainty.py"
click node_artifacts "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/entity/artifact_entity.py"
click node_scaler "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/utils/scaler.py"
click node_labels "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/utils/label_mapping.py"
click node_tracking "https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/mlflow_tracking.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_orchestrator,node_ingestion,node_validation,node_transformation,node_inference,node_evaluation,node_monitoring,node_drift,node_trigger,node_reviewer toneBlue
class node_retraining,node_registration,node_rollback,node_baseline,node_calibration toneAmber
class node_run_pipeline,node_api toneMint
class node_artifacts,node_scaler,node_labels,node_tracking toneRose
class node_sensor_data,node_user toneIndigo
```

## Components

### Inference pipeline

- [Production orchestrator](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/pipeline/production_pipeline.py): `src/pipeline/production_pipeline.py`
- [Sensor ingestion](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/data_ingestion.py): `src/components/data_ingestion.py`
- [Data validation](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/data_validation.py): `src/components/data_validation.py`
- [Window transformation](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/data_transformation.py): `src/components/data_transformation.py`
- [Model inference](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/model_inference.py): `src/components/model_inference.py`
- [Prediction evaluation](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/model_evaluation.py): `src/components/model_evaluation.py`
- [Post-inference monitoring](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/post_inference_monitoring.py): `src/components/post_inference_monitoring.py`
- [Drift analysis](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/monitoring/drift_monitor.py): `src/monitoring/drift_monitor.py`
- [Trigger evaluation](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/trigger_evaluation.py): `src/components/trigger_evaluation.py`

### Model governance

- [Model retraining](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/model_retraining.py): `src/components/model_retraining.py`
- [Model registration](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/model_registration.py): `src/components/model_registration.py`
- [Model rollback](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/model_rollback.py): `src/model_rollback.py`
- [Baseline update](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/baseline_update.py): `src/components/baseline_update.py`
- [Calibration uncertainty](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/components/calibration_uncertainty.py): `src/components/calibration_uncertainty.py`

### Entry points

- [Pipeline CLI](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/run_pipeline.py): `run_pipeline.py`
- [Inference API](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/api/app.py): `src/api/app.py`

### Shared internals

- [Stage artifacts](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/entity/artifact_entity.py): `src/entity/artifact_entity.py`
- [Scaler integrity](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/utils/scaler.py): `src/utils/scaler.py`
- [Activity label mapping](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/utils/label_mapping.py): `src/utils/label_mapping.py`
- [MLflow tracking](https://github.com/shalinvachheta017/masterarbeit_mlops/blob/main/src/mlflow_tracking.py): `src/mlflow_tracking.py`

### Other components

- **Sensor recordings**
- **Pipeline operator**
- **Human reviewer**

## Connections

- Pipeline operator → Pipeline CLI: starts run (evidence: `README.md`)
- Pipeline CLI → Production orchestrator: runs pipeline (evidence: `run_pipeline.py`)
- Sensor recordings → Sensor ingestion: provides recordings (evidence: `README.md`)
- Production orchestrator → Sensor ingestion: runs stage (evidence: `src/pipeline/production_pipeline.py`)
- Sensor ingestion → Data validation: fused data (evidence: `README.md`)
- Data validation → Window transformation: validated data (evidence: `README.md`)
- Window transformation → Model inference: windowed input (evidence: `README.md`)
- Model inference → Prediction evaluation: predictions (evidence: `README.md`)
- Prediction evaluation → Post-inference monitoring: evaluation evidence (evidence: `README.md`)
- Post-inference monitoring → Drift analysis: analyzes drift
- Post-inference monitoring → Trigger evaluation: monitoring evidence (evidence: `README.md`)
- Trigger evaluation → Human reviewer: requests review (evidence: `README.md`)
- Human reviewer → Model retraining: approves retraining (evidence: `README.md`)
- Model retraining → Model registration: trained model (evidence: `README.md`)
- Model registration → Baseline update: registered model (evidence: `README.md`)
- Model registration → Model rollback: rollback support (evidence: `src/components/model_registration.py`)
- Pipeline operator → Inference API: uploads data (evidence: `README.md`)
- Inference API → Model inference: requests inference (evidence: `README.md`)
- Production orchestrator → Calibration uncertainty: optional stage (evidence: `src/pipeline/production_pipeline.py`)
- Window transformation → Scaler integrity: uses scaler (evidence: `src/components/data_transformation.py`)
- Model inference → Activity label mapping: uses mappings (evidence: `src/components/model_inference.py`)
- Inference API → Activity label mapping: uses mappings (evidence: `src/api/app.py`)
- Production orchestrator → Stage artifacts: passes artifacts (evidence: `src/pipeline/production_pipeline.py`)
- Model retraining → MLflow tracking: tracks training
