Skip to content

Commit 2b778a0

Browse files
authored
Merge pull request #2 from J-Fabila/main
FLCore added
2 parents d79528f + 9069a0a commit 2b778a0

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

docs/flcore/index.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# FLCore
2+
3+
This library provides a flexible and extensible framework for running experiments in a federated learning environment, enabling the training and evaluation of different machine learning models across distributed datasets.
4+
5+
![AI Dahboard - FLCore Description (Screenshot)](../assets/images/ai-dashboard_2_openvre_flcore.png)
6+
7+
The following methods are currently implemented along with the flwr aggregation method used and the code used for selecting a specific method.
8+
9+
| Model | Aggregation method (Flwr) | Code |
10+
| ------------------- | --------------------------- | ------------------------ |
11+
| Logistic Regression | Federated Average | `logistic_regression` |
12+
| SGD Classifier | Federated Average | `lsvc` |
13+
| Elastic Net | Federated Average | `elastic_net` |
14+
| Random Forest | Custom | `weighted_random_forest` |
15+
| Deep Learning | Federated Average | `neural_network` |
16+
17+
18+
Parameters are provided using a command line interface and are organized by category and include their name, type, default value, and a brief explanation. These arguments can be modified at runtime to customize data handling, model configuration, training setup, and infrastructure details. The next table summarizes the variables needed for the client.
19+
20+
| Parameter | Type | Default value | Description |
21+
| ------------------------------- | ----------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
22+
| `--dataset` | `str` | `None` | Nombre del dataloader a usar. |
23+
| `--data_id` | `str` | `None` | Identificador del archivo del dataset. |
24+
| `--normalization_method` | `str` | `IQR` | Método de normalización. Opciones: `IQR`, `STD`, `MIN_MAX`. |
25+
| `--train_labels` | `list[str]` | `None` | Etiquetas usadas para entrenamiento. |
26+
| `--target_label` | `list[str]` | `None` | Etiqueta(s) objetivo para predicción. |
27+
| `--train_size` | `float` | `0.8` | Fracción del dataset usada para entrenamiento. Debe estar en `[0,1)`. |
28+
| `--num_clients` | `int` | `1` | Número de clientes en el escenario federado. |
29+
| `--model` | `str` | `random_forest` | Modelo base a entrenar. |
30+
| `--num_rounds` | `int` | `50` | Número de rondas de entrenamiento federado. |
31+
| `--checkpoint_selection_metric` | `str` | `precision` | Métrica usada para selección de checkpoints. |
32+
| `--dropout_method` | `str` | `None` | Método de dropout aplicado en el entrenamiento. |
33+
| `--smooth_method` | `str` | `None` | Método de suavizado de pesos. |
34+
| `--random_forest` | `json` | `{"balanced_rf": "true"}` | Parámetros para Random Forest. La bandera `balanced_rf` indica balanceo de pesos de clase. |
35+
| `--weighted_random_forest` | `json` | `{"balanced_rf": "true", "levelOfDetail": "DecisionTree"}` | Parámetros para Weighted Random Forest. Incluye `balanced_rf` y `levelOfDetail` para granularidad de árboles. |
36+
| `--neural_network` | `json` | `{"dropout_p": 0.2, "device": "cpu", "local_epochs": 10}` | Configuración para redes neuronales: probabilidad de dropout, dispositivo (`cpu` o `cuda`), y épocas locales. |
37+
| `--T` | `int` | `20` | Número de muestras Monte Carlo para dropout bayesiano. |
38+
| `--linear_models` | `json` | `{"n_features": 9}` | Número de características de entrada esperadas por el modelo lineal. |
39+
| `--sandbox_path` | `str` | `/sandbox` | Directorio sandbox para ejecución aislada o almacenamiento temporal. |
40+
| `--certs_path` | `str` | `/certs` | Directorio con certificados para comunicación federada segura. |
41+
| `--data_path` | `str` | `/data` | Ruta principal del dataset. |
42+
43+
44+
The following table summarizes the variables required for the server command line.
45+
46+
| Parameter | Type | Default value | Description |
47+
| ------------------------------- | ------ | --------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
48+
| `--num_clients` | `int` | `1` | Número de clientes en el entrenamiento federado. |
49+
| `--num_rounds` | `int` | `50` | Número de rondas de entrenamiento federado. |
50+
| `--model` | `str` | `random_forest` | Modelo a entrenar (`random_forest`, `weighted_random_forest`, `neural_network`, etc.). |
51+
| `--random_forest` | `json` | `{"balanced_rf": "true"}` | Parámetros de Random Forest, incluyendo balanceo de clases. |
52+
| `--experiment` | `json` | `{"name": "experiment_1", "log_path": "logs", "debug": "true"}` | Configuración del experimento: nombre, directorio de logs, modo debug. |
53+
| `--local_port` | `int` | `8081` | Puerto local para comunicación/servidor. |
54+
| `--production_mode` | `str` | `True!` | Activa el modo producción (modifica logging y ejecución). |
55+
| `--checkpoint_selection_metric` | `str` | `precision` | Métrica usada para selección de checkpoints. |
56+
| `--weighted_random_forest` | `json` | `{"balanced_rf": "true", "levelOfDetail": "DecisionTree"}` | Configuración del Weighted Random Forest. |
57+
| `--dropout` | `json` | `{"percentage_drop": 0}` | Parámetros de dropout (fracción de pesos/nodos eliminados). |
58+
| `--smoothWeights` | `json` | `{"smoothing_strenght": 0.5}` | Parámetros del método de suavizado. |
59+
| `--certs_path` | `str` | `./` | Ruta a certificados para comunicación segura. |
60+
| `--sandbox_path` | `str` | `./` | Directorio sandbox para pruebas/archivos temporales. |
61+
| `--dataset` | `str` | `dt4h_format` | Nombre del dataset o dataloader. |

docs/flcore/test

Whitespace-only changes.

0 commit comments

Comments
 (0)