# aditiib/ai-memory-pressure architecture

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

- Interactive diagram: https://gitdiagram.com/aditiib/ai-memory-pressure
- Repository: https://github.com/aditiib/ai-memory-pressure

## Overview

This repository is a Linux memory-pressure prediction project: it collects system metrics, labels pressure-onset examples, prepares data, trains classifiers, saves a Random Forest model, and predicts pressure from manually entered values. Separate scripts analyze and plot dataset or model results. The excerpts show the collector writing one CSV and the labeler producing another, but do not establish how those datasets were obtained or how the preprocessing input relates to them; those links are therefore omitted.

Main entry points: [`ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/memory_cleaned.csv`](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/memory_cleaned.csv) (Cleaned dataset), [`ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/data/memory_dataset_labeled.csv`](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/data/memory_dataset_labeled.csv) (Labeled dataset), [`ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/label_data.py`](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/label_data.py) (Pressure labeler), [`ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/save_model.py`](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/save_model.py) (Model persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Metrics collection"]
  node_collector["System collector<br/>[collector.py]"]
  node_raw_csv["Collected metrics<br/>[memory_data.csv]"]
end

subgraph group_data["Dataset preparation"]
  node_labeler["Pressure labeler<br/>[label_data.py]"]
  node_test_csvs["Experiment CSVs"]
  node_labeled_csv["Labeled dataset"]
  node_preprocess["Data cleaning<br/>[preprocess.py]"]
  node_clean_csv["Cleaned dataset<br/>[memory_cleaned.csv]"]
end

subgraph group_models["Modeling and prediction"]
  node_logistic["Logistic regression<br/>[train.py]"]
  node_decision_tree["Decision tree"]
  node_random_forest["Random forest"]
  node_lstm["LSTM model<br/>[train_lstm.py]"]
  node_save_model["Model persistence<br/>[save_model.py]"]
  node_model_file["Saved model<br/>[memory_model.pkl]"]
  node_predict["Interactive prediction<br/>[predict.py]"]
end

subgraph group_analysis["Analysis and visualization"]
  node_analyzer["Dataset analysis<br/>[analyze_data.py]"]
  node_pressure_plot["Pressure plot<br/>[plot_pressure.py]"]
  node_model_graphs["Model comparison charts<br/>[graphs.py]"]
end

node_operator(("System operator"))

node_operator -->|"starts collection"| node_collector
node_collector -->|"writes metrics"| node_raw_csv
node_labeler -->|"reads experiments"| node_test_csvs
node_labeler -->|"writes labels"| node_labeled_csv
node_preprocess -->|"writes cleaned data"| node_clean_csv
node_logistic -->|"reads training data"| node_clean_csv
node_decision_tree -->|"reads training data"| node_clean_csv
node_random_forest -->|"reads training data"| node_clean_csv
node_lstm -->|"reads training data"| node_clean_csv
node_save_model -->|"reads training data"| node_clean_csv
node_save_model -->|"saves model"| node_model_file
node_predict -->|"loads model"| node_model_file
node_operator -->|"enters metrics"| node_predict
node_analyzer -->|"reads labeled data"| node_labeled_csv
node_pressure_plot -->|"reads labeled data"| node_labeled_csv

click node_collector "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/collector.py"
click node_raw_csv "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/data/memory_data.csv"
click node_labeler "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/label_data.py"
click node_test_csvs "https://github.com/aditiib/ai-memory-pressure/tree/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/data"
click node_labeled_csv "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/data/memory_dataset_labeled.csv"
click node_preprocess "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/preprocess.py"
click node_clean_csv "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/memory_cleaned.csv"
click node_logistic "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train.py"
click node_decision_tree "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_decision_tree.py"
click node_random_forest "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_random_forest.py"
click node_lstm "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_lstm.py"
click node_save_model "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/save_model.py"
click node_model_file "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/memory_model.pkl"
click node_predict "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/predict.py"
click node_analyzer "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/analyze_data.py"
click node_pressure_plot "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/plot_pressure.py"
click node_model_graphs "https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/graphs.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_collector,node_raw_csv toneBlue
class node_labeler,node_test_csvs,node_labeled_csv,node_preprocess,node_clean_csv toneAmber
class node_logistic,node_decision_tree,node_random_forest,node_lstm,node_save_model,node_model_file,node_predict toneMint
class node_analyzer,node_pressure_plot,node_model_graphs toneRose
class node_operator toneIndigo
```

## Components

### Metrics collection

- [System collector](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/collector.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/collector.py`
- [Collected metrics](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/data/memory_data.csv): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/data/memory_data.csv`

### Dataset preparation

- [Pressure labeler](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/label_data.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/label_data.py`
- [Experiment CSVs](https://github.com/aditiib/ai-memory-pressure/tree/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/data): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/data`
- [Labeled dataset](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/data/memory_dataset_labeled.csv): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/data/memory_dataset_labeled.csv`
- [Data cleaning](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/preprocess.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/preprocess.py`
- [Cleaned dataset](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/memory_cleaned.csv): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/memory_cleaned.csv`

### Modeling and prediction

- [Logistic regression](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train.py`
- [Decision tree](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_decision_tree.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_decision_tree.py`
- [Random forest](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_random_forest.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_random_forest.py`
- [LSTM model](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_lstm.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_lstm.py`
- [Model persistence](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/save_model.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/save_model.py`
- [Saved model](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/memory_model.pkl): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/memory_model.pkl`
- [Interactive prediction](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/predict.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/predict.py`

### Analysis and visualization

- [Dataset analysis](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/analyze_data.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/analyze_data.py`
- [Pressure plot](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/plot_pressure.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/plot_pressure.py`
- [Model comparison charts](https://github.com/aditiib/ai-memory-pressure/blob/main/ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/graphs.py): `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/graphs.py`

### Other components

- **System operator**

## Connections

- System operator → System collector: starts collection (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/collector.py`)
- System collector → Collected metrics: writes metrics (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/collector.py`)
- Pressure labeler → Experiment CSVs: reads experiments (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/label_data.py`)
- Pressure labeler → Labeled dataset: writes labels (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/label_data.py`)
- Data cleaning → Cleaned dataset: writes cleaned data (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/preprocess.py`)
- Logistic regression → Cleaned dataset: reads training data (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train.py`)
- Decision tree → Cleaned dataset: reads training data (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_decision_tree.py`)
- Random forest → Cleaned dataset: reads training data (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_random_forest.py`)
- LSTM model → Cleaned dataset: reads training data (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/train_lstm.py`)
- Model persistence → Cleaned dataset: reads training data (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/save_model.py`)
- Model persistence → Saved model: saves model (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/save_model.py`)
- Interactive prediction → Saved model: loads model (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/predict.py`)
- System operator → Interactive prediction: enters metrics (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/predict.py`)
- Dataset analysis → Labeled dataset: reads labeled data (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/analyze_data.py`)
- Pressure plot → Labeled dataset: reads labeled data (evidence: `ai-memory-pressure-prediction-anshika-ml(1)/ai-memory-pressure-prediction-anshika-ml/collector/plot_pressure.py`)
