Skip to content

Cmd line#61

Open
J-Fabila wants to merge 64 commits into
mainfrom
cmd_line
Open

Cmd line#61
J-Fabila wants to merge 64 commits into
mainfrom
cmd_line

Conversation

@J-Fabila
Copy link
Copy Markdown
Collaborator

load base format

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Dockerfile
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 thread flcore/datasets.py
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")
Comment thread flcore/datasets.py
target_labels = config["target_labels"]
train_labels = config["train_labels"]

split_idx = int(dat_len * config["train_size"])
Comment thread flcore/datasets.py
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 thread flcore/datasets.py
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants