Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates command-line workflows for dataset/model configuration, adds base-format dataset loading, and expands model saving/explainability support across several federated model clients.
Changes:
- Adds CLI/config options for checkpoint saving, survival inputs, and base-format dataset loading.
- Adds model checkpoint metadata saving and SHAP-style explainability hooks for several models.
- Updates Docker/dependency setup and XGBoost federated aggregation logic, while removing prior test/package tooling and sample datasets.
Reviewed changes
Copilot reviewed 34 out of 41 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
client_cmd.py |
Adds CLI defaults/options and logging changes for client startup. |
server_cmd.py |
Updates logging and result compilation placement. |
flcore/datasets.py |
Adds base_format, rewrites DT4H/survival loading, and changes partition helpers. |
flcore/utils.py |
Updates config validation and metadata-derived output sizing. |
flcore/metrics.py |
Adjusts metric tensor shaping by task. |
flcore/models/xgb/server.py |
Replaces XGBoost strategy/aggregation implementation. |
flcore/models/xgb/client.py |
Refactors XGBoost client config and model saving. |
flcore/models/random_forest/client.py |
Adds periodic model/metadata saving and partition task handling. |
flcore/models/linear_models/client.py |
Adjusts evaluation and adds model/metadata saving. |
flcore/models/logistic_regression/client.py |
Adds model/metadata saving hooks. |
flcore/models/nn/client.py |
Adds periodic NN checkpoint/metadata saving. |
flcore/models/nn/FedCustomAggregator.py |
Removes debug entropy logging. |
flcore/models/cox/* |
Adds strategy client counts, save hooks, and explainability API. |
flcore/models/rsf/* |
Adds strategy client counts, save hooks, and explainability API. |
flcore/models/gbs/* |
Adds strategy client counts, save hooks, and explainability API. |
requirements.txt |
Updates Flower/PyYAML versions and adds setuptools. |
Dockerfile |
Switches to python:3.11-slim and revises package installation. |
tutorial.md |
Adds command-line argument reference documentation. |
pruebas.md |
Adds example command table. |
muestras |
Adds dataset metadata/sample notes. |
tox.ini |
Removes tox test/lint configuration. |
pyproject.toml |
Removes package/build metadata. |
tests/test_models.py |
Removes existing model tests. |
repeated.py |
Removes repeated experiment helper script. |
dataset/maggic/metadata.json |
Removes bundled MAGGIC metadata sample. |
dataset/kaggle_hf.csv |
Removes bundled Kaggle HF sample dataset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RUN pip3 install -r /home/requirements.txt | ||
| RUN ln -s /usr/bin/python3 /usr/bin/python | ||
| RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
| iputils-ping curl wget \ |
Comment on lines
+669
to
+672
| with open("dataset_description.json", 'r') as file: | ||
| metadata = json.load(file) | ||
|
|
||
| data_file = Path(config['data_file']) | ||
| dat = pd.read_parquet(data_file) | ||
|
|
||
| dat = pd.read_csv("data.csv") |
| target_labels = config["target_labels"] | ||
| train_labels = config["train_labels"] | ||
|
|
||
| split_idx = int(dat_len * config["train_size"]) |
| sss = get_stratifiedPartitions(n_splits,test_size, random_state) | ||
| splits_nested = (sss.split(X_data, y_data)) | ||
| return splits_nested | ||
| def split_partitions(n_splits, test_size, random_state, X_data, y_data, task): |
| self.config = config | ||
| self.local_data = local_data | ||
| self.saving_path = Path(saving_path) | ||
| self.saving_path = config["experiment_dir"] |
Comment on lines
+57
to
+58
| if self.round % self.config["save_every_n_rounds"] == 0: | ||
| self.save_model() |
| """ | ||
| Generate SHAP values for the CoxPH model. | ||
| """ | ||
| import shap |
| """ | ||
| Generate SHAP values for the GBS model (FPBoost). | ||
| """ | ||
| import shap |
| """ | ||
| Generate SHAP values for the RandomSurvivalForest model. | ||
| """ | ||
| import shap |
Comment on lines
+679
to
+689
| label_to_int = {v: int(k) for k, v in categories.items()} | ||
| label_to_int.update({int(k): int(k) for k in categories}) | ||
| label_to_int.update({k: int(k) for k in categories}) | ||
| cat_map[col] = label_to_int | ||
| for col, mapa in cat_map.items(): | ||
| dat[col] = dat[col].map(mapa) | ||
|
|
||
| for feat in metadata: | ||
| if feat["type"] == "continuous": | ||
| # Should we normalize? | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
load base format