MEDfl 2.0.10.dev13__tar.gz → 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/client.py +7 -2
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/params_optimiser.py +4 -4
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/server.py +7 -2
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/shap/aggregation.py +1 -1
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/strategy.py +3 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/xgboost/strategy.py +3 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/client.py +4 -4
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/strategy.py +40 -30
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/xgboost/strategy.py +3 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/PKG-INFO +2 -2
- {medfl-2.0.10.dev13 → medfl-2.1.0}/README.md +1 -1
- {medfl-2.0.10.dev13 → medfl-2.1.0}/medfl.egg-info/PKG-INFO +2 -2
- {medfl-2.0.10.dev13 → medfl-2.1.0}/setup.py +1 -1
- {medfl-2.0.10.dev13 → medfl-2.1.0}/LICENSE +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/__init__.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/dp.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/dynamicModal.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/federated_dataset.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/flpipeline.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/model.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/params.yaml +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/plot.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/shap/__init__.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/shap/config.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/shap/explainer.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/shap/xgboost_explainer.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/utils.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/xgboost/__init__.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/xgboost/client.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/xgboost/config.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/xgboost/data.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/xgboost/metrics.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/xgboost/serialization.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/LearningManager/xgboost/server.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/NetManager/__init__.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/NetManager/database_connector.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/NetManager/dataset.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/NetManager/flsetup.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/NetManager/net_helper.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/NetManager/net_manager_queries.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/NetManager/network.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/NetManager/node.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/__init__.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/__init__.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/holdout.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/identity.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/model.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/server.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/xgboost/__init__.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/xgboost/client.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/xgboost/config.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/xgboost/data.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/xgboost/metrics.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/rw/xgboost/serialization.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/scripts/__init__.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/scripts/base.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/MEDfl/scripts/create_db.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/alembic/__init__.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/alembic/env.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/medfl.egg-info/SOURCES.txt +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/medfl.egg-info/dependency_links.txt +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/medfl.egg-info/requires.txt +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/medfl.egg-info/top_level.txt +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/setup.cfg +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/tests/test_dataset.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/tests/test_federated_dataset.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/tests/test_flpipeline.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/tests/test_flsetup.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/tests/test_network.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/tests/test_node.py +0 -0
- {medfl-2.0.10.dev13 → medfl-2.1.0}/tests/test_rw_holdout.py +0 -0
|
@@ -50,8 +50,11 @@ class FlowerClient(fl.client.NumPyClient):
|
|
|
50
50
|
valloader: DataLoader,
|
|
51
51
|
diff_priv: bool = params["diff_privacy"],
|
|
52
52
|
dp_config: Optional[DPConfig] = None,
|
|
53
|
+
local_epochs: Optional[int] = None,
|
|
53
54
|
):
|
|
54
55
|
self.cid = cid
|
|
56
|
+
# number of local training epochs per round; None = train_epochs of params.yaml
|
|
57
|
+
self.local_epochs = int(local_epochs) if local_epochs is not None else int(params["train_epochs"])
|
|
55
58
|
self.local_model = local_model
|
|
56
59
|
self.trainloader = trainloader
|
|
57
60
|
self.valloader = valloader
|
|
@@ -87,7 +90,7 @@ class FlowerClient(fl.client.NumPyClient):
|
|
|
87
90
|
module=self.local_model.model.train(),
|
|
88
91
|
optimizer=self.local_model.optimizer,
|
|
89
92
|
data_loader=self.trainloader,
|
|
90
|
-
epochs=
|
|
93
|
+
epochs=self.local_epochs,
|
|
91
94
|
target_epsilon=float(params["EPSILON"]),
|
|
92
95
|
target_delta=float(params["DELTA"]),
|
|
93
96
|
max_grad_norm=params["MAX_GRAD_NORM"],
|
|
@@ -109,6 +112,8 @@ class FlowerClient(fl.client.NumPyClient):
|
|
|
109
112
|
raise TypeError("valloader argument must be a torch.utils.data.dataloader")
|
|
110
113
|
if not isinstance(self.diff_priv, bool):
|
|
111
114
|
raise TypeError("diff_priv argument must be a bool")
|
|
115
|
+
if self.local_epochs <= 0:
|
|
116
|
+
raise ValueError("local_epochs argument must be greater than 0")
|
|
112
117
|
|
|
113
118
|
# ------------------------------------------------------------------
|
|
114
119
|
def get_parameters(self, config):
|
|
@@ -123,7 +128,7 @@ class FlowerClient(fl.client.NumPyClient):
|
|
|
123
128
|
|
|
124
129
|
epoch_losses, epoch_metrics = [], []
|
|
125
130
|
|
|
126
|
-
for ep in range(
|
|
131
|
+
for ep in range(self.local_epochs):
|
|
127
132
|
epsilon, tr_loss, tr_metric = self.local_model.train(
|
|
128
133
|
self.trainloader,
|
|
129
134
|
epoch=ep,
|
|
@@ -75,7 +75,7 @@ class CustomPyTorchClassifier(BaseEstimator):
|
|
|
75
75
|
for inputs, labels in train_loader:
|
|
76
76
|
optimizer.zero_grad()
|
|
77
77
|
outputs = self.model(inputs)
|
|
78
|
-
loss = criterion(outputs.
|
|
78
|
+
loss = criterion(outputs.view(-1), labels)
|
|
79
79
|
loss.backward()
|
|
80
80
|
optimizer.step()
|
|
81
81
|
return self
|
|
@@ -87,7 +87,7 @@ class CustomPyTorchClassifier(BaseEstimator):
|
|
|
87
87
|
self.model.eval()
|
|
88
88
|
with torch.no_grad():
|
|
89
89
|
outputs = self.model(torch.from_numpy(X).float())
|
|
90
|
-
predictions = (outputs.
|
|
90
|
+
predictions = (outputs.view(-1) > self.th).float().numpy()
|
|
91
91
|
return predictions
|
|
92
92
|
|
|
93
93
|
def score(self, X, y):
|
|
@@ -219,7 +219,7 @@ class ParamsOptimiser:
|
|
|
219
219
|
for batch_X, batch_y in train_loader:
|
|
220
220
|
optimizer.zero_grad()
|
|
221
221
|
outputs = model(batch_X)
|
|
222
|
-
loss = criterion(outputs.
|
|
222
|
+
loss = criterion(outputs.view(-1), batch_y)
|
|
223
223
|
loss.backward()
|
|
224
224
|
optimizer.step()
|
|
225
225
|
|
|
@@ -281,7 +281,7 @@ class ParamsOptimiser:
|
|
|
281
281
|
for batch_X, batch_y in train_loader:
|
|
282
282
|
final_optimizer.zero_grad()
|
|
283
283
|
outputs = final_model(batch_X)
|
|
284
|
-
loss = final_criterion(outputs.
|
|
284
|
+
loss = final_criterion(outputs.view(-1), batch_y)
|
|
285
285
|
loss.backward()
|
|
286
286
|
final_optimizer.step()
|
|
287
287
|
|
|
@@ -77,6 +77,7 @@ class FlowerServer:
|
|
|
77
77
|
SHAPConfig
|
|
78
78
|
] = None,
|
|
79
79
|
dp_config: Optional[DPConfig] = None,
|
|
80
|
+
local_epochs: Optional[int] = None,
|
|
80
81
|
) -> None:
|
|
81
82
|
|
|
82
83
|
self.device = torch.device("cpu")
|
|
@@ -88,6 +89,8 @@ class FlowerServer:
|
|
|
88
89
|
self.fed_dataset = fed_dataset
|
|
89
90
|
self.strategy = strategy
|
|
90
91
|
self.client_resources = client_resources
|
|
92
|
+
# number of local training epochs per round; None = train_epochs of params.yaml
|
|
93
|
+
self.local_epochs = int(local_epochs) if local_epochs is not None else int(default_params["train_epochs"])
|
|
91
94
|
|
|
92
95
|
self.shap_config = (
|
|
93
96
|
shap_config
|
|
@@ -116,7 +119,7 @@ class FlowerServer:
|
|
|
116
119
|
calibration = calibrate_clients(
|
|
117
120
|
dp_config,
|
|
118
121
|
num_batches={str(index): len(loader) for index, loader in enumerate(self.fed_dataset.trainloaders)},
|
|
119
|
-
local_epochs=
|
|
122
|
+
local_epochs=self.local_epochs,
|
|
120
123
|
num_rounds=int(self.num_rounds),
|
|
121
124
|
)
|
|
122
125
|
self.dp_clients = calibration["clients"]
|
|
@@ -477,6 +480,8 @@ class FlowerServer:
|
|
|
477
480
|
raise TypeError("num_clients argument must be an int")
|
|
478
481
|
if not isinstance(self.num_rounds, int):
|
|
479
482
|
raise TypeError("num_rounds argument must be an int")
|
|
483
|
+
if self.local_epochs <= 0:
|
|
484
|
+
raise ValueError("local_epochs argument must be greater than 0")
|
|
480
485
|
if not isinstance(self.diff_priv, bool):
|
|
481
486
|
raise TypeError("diff_priv argument must be a bool")
|
|
482
487
|
|
|
@@ -495,7 +500,7 @@ class FlowerServer:
|
|
|
495
500
|
valloader = self.fed_dataset.valloaders[int(cid)]
|
|
496
501
|
|
|
497
502
|
client_model = copy.deepcopy(self.global_model)
|
|
498
|
-
client = FlowerClient(cid, client_model, trainloader, valloader, self.diff_priv, dp_config=self.dp_clients.get(str(cid)))
|
|
503
|
+
client = FlowerClient(cid, client_model, trainloader, valloader, self.diff_priv, dp_config=self.dp_clients.get(str(cid)), local_epochs=self.local_epochs)
|
|
499
504
|
self.flower_clients.append(client)
|
|
500
505
|
return client
|
|
501
506
|
|
|
@@ -65,7 +65,7 @@ def aggregate_federated_shap(
|
|
|
65
65
|
"""
|
|
66
66
|
Aggregate additive local SHAP statistics.
|
|
67
67
|
|
|
68
|
-
The global mean absolute SHAP is equivalent to calculating
|
|
68
|
+
The global mean absolute SHAP is equivalent to calculating::
|
|
69
69
|
|
|
70
70
|
sum of all |SHAP values| / number of all explained samples
|
|
71
71
|
"""
|
|
@@ -8,9 +8,12 @@ This file provides a Strategy factory that wraps any Flower server strategy
|
|
|
8
8
|
- Per-client fit/eval history with round + num_examples (+ loss for eval)
|
|
9
9
|
- Per-round server summary history (results/failures, cids, example stats)
|
|
10
10
|
- Global-weights fingerprints after aggregation:
|
|
11
|
+
|
|
11
12
|
* w_norm, delta_norm, cos_sim_prev, nan_or_inf
|
|
13
|
+
|
|
12
14
|
- Uses Flower logging (NOT print) so logs show up reliably in simulation
|
|
13
15
|
- Optional metrics aggregation functions to remove:
|
|
16
|
+
|
|
14
17
|
"No fit_metrics_aggregation_fn provided" warning
|
|
15
18
|
|
|
16
19
|
Usage (server side):
|
|
@@ -22,16 +22,19 @@ class XGBoostSimulationStrategy:
|
|
|
22
22
|
|
|
23
23
|
This class follows the same high-level contract as the existing MEDfl
|
|
24
24
|
Strategy wrapper:
|
|
25
|
+
|
|
25
26
|
- it exposes create_strategy();
|
|
26
27
|
- it stores the Flower strategy in self.strategy_object;
|
|
27
28
|
- it can be passed directly into FederatedServer.
|
|
28
29
|
|
|
29
30
|
First supported mode:
|
|
31
|
+
|
|
30
32
|
- bagging-style federated XGBoost using Flower strategy hooks.
|
|
31
33
|
|
|
32
34
|
Notes
|
|
33
35
|
-----
|
|
34
36
|
This implementation is conservative and non-invasive:
|
|
37
|
+
|
|
35
38
|
- It does not modify the existing PyTorch FedAvg/FedAdam/FedYogi path.
|
|
36
39
|
- It uses Flower Parameters containing serialized XGBoost boosters.
|
|
37
40
|
- It saves XGBoost models as .ubj files instead of .npz files.
|
|
@@ -493,7 +493,7 @@ class FlowerClient(fl.client.NumPyClient):
|
|
|
493
493
|
for X_batch, y_batch in self.train_loader:
|
|
494
494
|
self.optimizer.zero_grad()
|
|
495
495
|
outputs = self.model(X_batch)
|
|
496
|
-
loss = self.criterion(outputs.
|
|
496
|
+
loss = self.criterion(outputs.view(-1), y_batch)
|
|
497
497
|
loss.backward()
|
|
498
498
|
self.optimizer.step()
|
|
499
499
|
total_loss += loss.item() * X_batch.size(0)
|
|
@@ -501,7 +501,7 @@ class FlowerClient(fl.client.NumPyClient):
|
|
|
501
501
|
avg_loss = total_loss / (len(self.train_loader.dataset) * local_epochs)
|
|
502
502
|
|
|
503
503
|
with torch.no_grad():
|
|
504
|
-
logits = self.model(self.X_tensor).
|
|
504
|
+
logits = self.model(self.X_tensor).view(-1)
|
|
505
505
|
probs = torch.sigmoid(logits).cpu().numpy()
|
|
506
506
|
y_true = self.y_tensor.cpu().numpy()
|
|
507
507
|
binary_preds = (probs >= 0.5).astype(int)
|
|
@@ -539,9 +539,9 @@ class FlowerClient(fl.client.NumPyClient):
|
|
|
539
539
|
with torch.no_grad():
|
|
540
540
|
for X_batch, y_batch in self.test_loader:
|
|
541
541
|
outputs = self.model(X_batch)
|
|
542
|
-
loss = self.criterion(outputs.
|
|
542
|
+
loss = self.criterion(outputs.view(-1), y_batch)
|
|
543
543
|
total_loss += loss.item() * X_batch.size(0)
|
|
544
|
-
probs = torch.sigmoid(outputs.
|
|
544
|
+
probs = torch.sigmoid(outputs.view(-1)).cpu().numpy()
|
|
545
545
|
all_probs.extend(probs.tolist())
|
|
546
546
|
all_true.extend(y_batch.cpu().numpy().tolist())
|
|
547
547
|
|
|
@@ -38,36 +38,46 @@ def aggregate_eval_metrics(results):
|
|
|
38
38
|
# ===================================================
|
|
39
39
|
class Strategy:
|
|
40
40
|
"""
|
|
41
|
-
Flower
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
41
|
+
Flower strategy wrapper for MEDfl real-world pipelines.
|
|
42
|
+
|
|
43
|
+
It wraps any strategy of ``flwr.server.strategy`` (selected by ``name``) and adds:
|
|
44
|
+
|
|
45
|
+
- the experiment configuration (schema, splits, hyperparameters) pushed to the
|
|
46
|
+
clients at every round;
|
|
47
|
+
- custom metric aggregation, and per-client and aggregated metric logging;
|
|
48
|
+
- inspection of the client properties before each training round;
|
|
49
|
+
- checkpoints of the global parameters every ``saveOnRounds`` rounds;
|
|
50
|
+
- final-round federated SHAP and federated holdout test.
|
|
51
|
+
|
|
52
|
+
Parameters
|
|
53
|
+
----------
|
|
54
|
+
name : str
|
|
55
|
+
Name of a Flower strategy class, e.g. ``"FedAvg"``, ``"FedAdam"``, ``"FedProx"``.
|
|
56
|
+
features : str
|
|
57
|
+
Comma-separated feature columns enforced on every client. Empty: all columns
|
|
58
|
+
except the target.
|
|
59
|
+
target : str
|
|
60
|
+
Target column. Empty: the last column of each client CSV.
|
|
61
|
+
val_fraction, test_fraction : float
|
|
62
|
+
Default validation and test fractions on each client.
|
|
63
|
+
split_mode : str
|
|
64
|
+
``"global"``: every client uses ``val_fraction`` / ``test_fraction``.
|
|
65
|
+
``"per_client"``: a client listed in ``client_fractions`` uses its own settings.
|
|
66
|
+
client_fractions : dict, optional
|
|
67
|
+
Per-client split settings keyed by client name (hostname, or ``MEDFL_AGENT_ID``),
|
|
68
|
+
e.g. ``{"hospital-a": {"val_fraction": 0.1, "test_ids": [1, 2, 3]}}``. Allowed keys:
|
|
69
|
+
``val_fraction``, ``test_fraction``, ``test_ids`` (list or ``"1,2,3"``). When
|
|
70
|
+
``test_ids`` is given, that client's ``test_fraction`` is ignored.
|
|
71
|
+
id_col : str
|
|
72
|
+
Client column matched against ``test_ids``.
|
|
73
|
+
savingPath : str
|
|
74
|
+
Checkpoint directory. Empty: no checkpoint.
|
|
75
|
+
saveOnRounds : int
|
|
76
|
+
Save the global model every N rounds (and at the last round).
|
|
77
|
+
shap_config : SHAPConfig, optional
|
|
78
|
+
Final-round federated SHAP configuration.
|
|
79
|
+
holdout_config : HoldoutConfig, optional
|
|
80
|
+
Final-round federated holdout test configuration.
|
|
71
81
|
"""
|
|
72
82
|
|
|
73
83
|
def __init__(
|
|
@@ -33,16 +33,19 @@ class XGBoostStrategy:
|
|
|
33
33
|
|
|
34
34
|
This class follows the same high-level contract as the existing MEDfl
|
|
35
35
|
Strategy wrapper:
|
|
36
|
+
|
|
36
37
|
- it exposes create_strategy();
|
|
37
38
|
- it stores the Flower strategy in self.strategy_object;
|
|
38
39
|
- it can be passed directly into FederatedServer.
|
|
39
40
|
|
|
40
41
|
First supported mode:
|
|
42
|
+
|
|
41
43
|
- bagging-style federated XGBoost using Flower strategy hooks.
|
|
42
44
|
|
|
43
45
|
Notes
|
|
44
46
|
-----
|
|
45
47
|
This implementation is conservative and non-invasive:
|
|
48
|
+
|
|
46
49
|
- It does not modify the existing PyTorch FedAvg/FedAdam/FedYogi path.
|
|
47
50
|
- It uses Flower Parameters containing serialized XGBoost boosters.
|
|
48
51
|
- It saves XGBoost models as .ubj files instead of .npz files.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: medfl
|
|
3
|
-
Version: 2.0
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: Python Open-source package for simulating federated learning and differential privacy
|
|
5
5
|
Home-page: https://github.com/MEDomics-UdeS/MEDfl
|
|
6
6
|
Author: MEDomics consortium
|
|
@@ -303,7 +303,7 @@ FlowerClient(server_address="SERVER_IP:8080",
|
|
|
303
303
|
holdout_path="data/site_holdout.csv").start()
|
|
304
304
|
```
|
|
305
305
|
|
|
306
|
-
**Optimized threshold.** With `threshold_source="optimized"`, clients also send score histograms of their whole learning set (train + validation + test). The server selects the threshold on these pooled histograms (Youden's J or the
|
|
306
|
+
**Optimized threshold.** With `threshold_source="optimized"`, clients also send score histograms of their whole learning set (train + validation + test). The server selects the threshold on these pooled histograms (Youden's J, or the highest threshold that still reaches a target sensitivity), then reports holdout metrics at that threshold. The holdout data is **never** used to choose the threshold, so holdout results remain an unbiased estimate.
|
|
307
307
|
|
|
308
308
|
Holdout testing works for both the PyTorch and the XGBoost real-world backends (binary classification).
|
|
309
309
|
|
|
@@ -283,7 +283,7 @@ FlowerClient(server_address="SERVER_IP:8080",
|
|
|
283
283
|
holdout_path="data/site_holdout.csv").start()
|
|
284
284
|
```
|
|
285
285
|
|
|
286
|
-
**Optimized threshold.** With `threshold_source="optimized"`, clients also send score histograms of their whole learning set (train + validation + test). The server selects the threshold on these pooled histograms (Youden's J or the
|
|
286
|
+
**Optimized threshold.** With `threshold_source="optimized"`, clients also send score histograms of their whole learning set (train + validation + test). The server selects the threshold on these pooled histograms (Youden's J, or the highest threshold that still reaches a target sensitivity), then reports holdout metrics at that threshold. The holdout data is **never** used to choose the threshold, so holdout results remain an unbiased estimate.
|
|
287
287
|
|
|
288
288
|
Holdout testing works for both the PyTorch and the XGBoost real-world backends (binary classification).
|
|
289
289
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: medfl
|
|
3
|
-
Version: 2.0
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: Python Open-source package for simulating federated learning and differential privacy
|
|
5
5
|
Home-page: https://github.com/MEDomics-UdeS/MEDfl
|
|
6
6
|
Author: MEDomics consortium
|
|
@@ -303,7 +303,7 @@ FlowerClient(server_address="SERVER_IP:8080",
|
|
|
303
303
|
holdout_path="data/site_holdout.csv").start()
|
|
304
304
|
```
|
|
305
305
|
|
|
306
|
-
**Optimized threshold.** With `threshold_source="optimized"`, clients also send score histograms of their whole learning set (train + validation + test). The server selects the threshold on these pooled histograms (Youden's J or the
|
|
306
|
+
**Optimized threshold.** With `threshold_source="optimized"`, clients also send score histograms of their whole learning set (train + validation + test). The server selects the threshold on these pooled histograms (Youden's J, or the highest threshold that still reaches a target sensitivity), then reports holdout metrics at that threshold. The holdout data is **never** used to choose the threshold, so holdout results remain an unbiased estimate.
|
|
307
307
|
|
|
308
308
|
Holdout testing works for both the PyTorch and the XGBoost real-world backends (binary classification).
|
|
309
309
|
|
|
@@ -14,7 +14,7 @@ with open('requirements.txt') as f:
|
|
|
14
14
|
|
|
15
15
|
setup(
|
|
16
16
|
name="medfl",
|
|
17
|
-
version="2.0
|
|
17
|
+
version="2.1.0",
|
|
18
18
|
author="MEDomics consortium",
|
|
19
19
|
author_email="medomics.info@gmail.com",
|
|
20
20
|
description="Python Open-source package for simulating federated learning and differential privacy",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|