# casellajr/fed2rc architecture

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

- Interactive diagram: https://gitdiagram.com/casellajr/fed2rc
- Repository: https://github.com/casellajr/fed2rc

## Overview

This repository implements and reproduces experiments for Fed2RC, Fed2RC+, MiniFed2RC, and time-series-classification baselines. The main workflow loads UCR time series, distributes data across clients, selects Rocket features, and fits a ridge classifier through federated updates; optional protocol stages tune regularization and reduce communication, followed by evaluation and recorded metrics. The fluke and standalone implementations are separate experiment paths. The README documents the algorithm and reported results; sampled source shows selected implementation details, so some documented relationships are represented at the capability level.

Main entry points: [`code/fed2rc.py`](https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py) (Fed2RC runs), [`code/fed2rc_no_fluke.py`](https://github.com/casellajr/fed2rc/blob/main/code/fed2rc_no_fluke.py) (Standalone runs), [`code/DAMI/fed2rc_with_voting_classifiers.py`](https://github.com/casellajr/fed2rc/blob/main/code/DAMI/fed2rc_with_voting_classifiers.py) (Voting variants), [`code/utils.py`](https://github.com/casellajr/fed2rc/blob/main/code/utils.py) (Client partitioning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experiments["Experiments"]
  node_fluke_runs["Fed2RC runs<br/>[fed2rc.py]"]
  node_standalone_runs["Standalone runs<br/>[fed2rc_no_fluke.py]"]
  node_plus_runs["Voting variants"]
  node_mini_runs["MiniFed2RC variants<br/>[mini_fed2rc.py]"]
  node_fluke_voting["Fluke voting variant"]
  node_fluke_mini["Fluke MiniFed2RC"]
  node_config["Experiment settings"]
end

subgraph group_data["Data preparation"]
  node_ucr[("UCR dataset")]
  node_ucr_loader["UCR loader<br/>[mydata.py]"]
  node_partition["Client partitioning<br/>[utils.py]"]
end

subgraph group_federated["Federated algorithms"]
  node_rocket["Rocket transforms<br/>[utils.py]"]
  node_client_select["Kernel selection<br/>[fed2rc.py]"]
  node_ridge_updates["Ridge updates<br/>[fed2rc.py]"]
  node_lambda_tuning["Lambda selection<br/>[fed2rc.py]"]
  node_factorization["Update factorization<br/>[fed2rc.py]"]
  node_classifier["Classifier model<br/>[fed2rc.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_baselines["Classification baselines<br/>[mynets.py]"]
  node_metrics["Accuracy and F1"]
end

node_researcher(("Experiment runner"))
node_wandb(("Weights &amp; Biases"))

node_researcher -->|"runs"| node_fluke_runs
node_researcher -->|"runs"| node_standalone_runs
node_researcher -->|"runs"| node_plus_runs
node_researcher -->|"runs"| node_mini_runs
node_fluke_runs -.->|"uses settings"| node_config
node_fluke_runs -.->|"loads data"| node_ucr_loader
node_ucr -->|"provides files"| node_ucr_loader
node_ucr_loader -.->|"supplies samples"| node_partition
node_standalone_runs -->|"partitions data"| node_partition
node_standalone_runs -->|"transforms series"| node_rocket
node_standalone_runs -->|"fits ridge"| node_ridge_updates
node_plus_runs -->|"partitions data"| node_partition
node_plus_runs -->|"transforms series"| node_rocket
node_plus_runs -->|"fits ridge"| node_ridge_updates
node_mini_runs -->|"partitions data"| node_partition
node_fluke_runs -->|"selects kernels"| node_client_select
node_client_select -->|"feeds selected features"| node_ridge_updates
node_ridge_updates -->|"fits parameters"| node_classifier
node_fluke_runs -->|"tunes regularization"| node_lambda_tuning
node_fluke_runs -->|"factors updates"| node_factorization
node_fluke_runs -->|"compares against"| node_baselines
node_fluke_runs -->|"reports results"| node_metrics
node_standalone_runs -->|"tracks metrics"| node_wandb
node_fluke_voting -.->|"uses voting"| node_client_select
node_fluke_mini -.->|"fits MiniRocket model"| node_classifier

click node_fluke_runs "https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py"
click node_standalone_runs "https://github.com/casellajr/fed2rc/blob/main/code/fed2rc_no_fluke.py"
click node_plus_runs "https://github.com/casellajr/fed2rc/blob/main/code/DAMI/fed2rc_with_voting_classifiers.py"
click node_mini_runs "https://github.com/casellajr/fed2rc/blob/main/code/DAMI/mini_fed2rc.py"
click node_fluke_voting "https://github.com/casellajr/fed2rc/blob/main/code/DAMI/fed2rc_with_voting_classifiers_fluke_version.py"
click node_fluke_mini "https://github.com/casellajr/fed2rc/blob/main/code/DAMI/minifed2rc_fluke_version.py"
click node_config "https://github.com/casellajr/fed2rc/tree/main/code/configs"
click node_ucr_loader "https://github.com/casellajr/fed2rc/blob/main/code/mydata.py"
click node_partition "https://github.com/casellajr/fed2rc/blob/main/code/utils.py"
click node_rocket "https://github.com/casellajr/fed2rc/blob/main/code/utils.py"
click node_client_select "https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py"
click node_ridge_updates "https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py"
click node_lambda_tuning "https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py"
click node_factorization "https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py"
click node_classifier "https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py"
click node_baselines "https://github.com/casellajr/fed2rc/blob/main/code/mynets.py"
click node_metrics "https://github.com/casellajr/fed2rc/tree/main/results"

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_fluke_runs,node_standalone_runs,node_plus_runs,node_mini_runs,node_fluke_voting,node_fluke_mini,node_config toneBlue
class node_ucr,node_ucr_loader,node_partition toneAmber
class node_rocket,node_client_select,node_ridge_updates,node_lambda_tuning,node_factorization,node_classifier toneMint
class node_baselines,node_metrics toneRose
class node_researcher,node_wandb toneIndigo
```

## Components

### Experiments

- [Fed2RC runs](https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py): `code/fed2rc.py`
- [Standalone runs](https://github.com/casellajr/fed2rc/blob/main/code/fed2rc_no_fluke.py): `code/fed2rc_no_fluke.py`
- [Voting variants](https://github.com/casellajr/fed2rc/blob/main/code/DAMI/fed2rc_with_voting_classifiers.py): `code/DAMI/fed2rc_with_voting_classifiers.py`
- [MiniFed2RC variants](https://github.com/casellajr/fed2rc/blob/main/code/DAMI/mini_fed2rc.py): `code/DAMI/mini_fed2rc.py`
- [Fluke voting variant](https://github.com/casellajr/fed2rc/blob/main/code/DAMI/fed2rc_with_voting_classifiers_fluke_version.py): `code/DAMI/fed2rc_with_voting_classifiers_fluke_version.py`
- [Fluke MiniFed2RC](https://github.com/casellajr/fed2rc/blob/main/code/DAMI/minifed2rc_fluke_version.py): `code/DAMI/minifed2rc_fluke_version.py`
- [Experiment settings](https://github.com/casellajr/fed2rc/tree/main/code/configs): `code/configs`

### Data preparation

- **UCR dataset**
- [UCR loader](https://github.com/casellajr/fed2rc/blob/main/code/mydata.py): `code/mydata.py`
- [Client partitioning](https://github.com/casellajr/fed2rc/blob/main/code/utils.py): `code/utils.py`

### Federated algorithms

- [Rocket transforms](https://github.com/casellajr/fed2rc/blob/main/code/utils.py): `code/utils.py`
- [Kernel selection](https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py): `code/fed2rc.py`
- [Ridge updates](https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py): `code/fed2rc.py`
- [Lambda selection](https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py): `code/fed2rc.py`
- [Update factorization](https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py): `code/fed2rc.py`
- [Classifier model](https://github.com/casellajr/fed2rc/blob/main/code/fed2rc.py): `code/fed2rc.py`

### Evaluation

- [Classification baselines](https://github.com/casellajr/fed2rc/blob/main/code/mynets.py): `code/mynets.py`
- [Accuracy and F1](https://github.com/casellajr/fed2rc/tree/main/results): `results`

### Other components

- **Experiment runner**
- **Weights & Biases**

## Connections

- Experiment runner → Fed2RC runs: runs (evidence: `README.md`)
- Experiment runner → Standalone runs: runs (evidence: `README.md`)
- Experiment runner → Voting variants: runs (evidence: `README.md`)
- Experiment runner → MiniFed2RC variants: runs (evidence: `README.md`)
- Fed2RC runs → Experiment settings: uses settings
- Fed2RC runs → UCR loader: loads data
- UCR dataset → UCR loader: provides files (evidence: `README.md`)
- UCR loader → Client partitioning: supplies samples
- Standalone runs → Client partitioning: partitions data (evidence: `code/fed2rc_no_fluke.py`)
- Standalone runs → Rocket transforms: transforms series (evidence: `code/fed2rc_no_fluke.py`)
- Standalone runs → Ridge updates: fits ridge (evidence: `code/fed2rc_no_fluke.py`)
- Voting variants → Client partitioning: partitions data (evidence: `code/DAMI/fed2rc_with_voting_classifiers.py`)
- Voting variants → Rocket transforms: transforms series (evidence: `code/DAMI/fed2rc_with_voting_classifiers.py`)
- Voting variants → Ridge updates: fits ridge (evidence: `code/DAMI/fed2rc_with_voting_classifiers.py`)
- MiniFed2RC variants → Client partitioning: partitions data (evidence: `code/DAMI/mini_fed2rc.py`)
- Fed2RC runs → Kernel selection: selects kernels (evidence: `README.md`)
- Kernel selection → Ridge updates: feeds selected features (evidence: `README.md`)
- Ridge updates → Classifier model: fits parameters (evidence: `README.md`)
- Fed2RC runs → Lambda selection: tunes regularization (evidence: `README.md`)
- Fed2RC runs → Update factorization: factors updates (evidence: `README.md`)
- Fed2RC runs → Classification baselines: compares against (evidence: `README.md`)
- Fed2RC runs → Accuracy and F1: reports results (evidence: `README.md`)
- Standalone runs → Weights & Biases: tracks metrics (evidence: `code/fed2rc_no_fluke.py`)
- Fluke voting variant → Kernel selection: uses voting
- Fluke MiniFed2RC → Classifier model: fits MiniRocket model
