Skip to content

Commit 53ebdfe

Browse files
committed
Fixed an issue preventing the splitter copy
1 parent 5ae8bc4 commit 53ebdfe

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mplc/doc/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ There are 2 ways to select a dataset. You can either choose a pre-implemented da
252252
from clusters they all share data samples from
253253
- `'specific'`: each partner with option `'specific'` receives data samples picked
254254
from cluster(s) it is the only one to receive from
255-
Example: `samples_split_option='advanced', samples_split_configuration=[[7, 'shared'], [6, 'shared'], [2, 'specific'], [1, 'specific']]]`
255+
Example: `samples_split_option='advanced', samples_split_configuration=[[7, 'shared'], [6, 'shared'], [2, 'specific'], [1, 'specific']]`
256256

257257
- `FlexibleSplitter`: in other cases one might want to specify in detail the split among partners (partner per partner and class per class). For that the `FlexibleSplitter` can be used. It is configured by indicating, for each partner in sequence, a list of the percentage of samples for each class: `[[% for class 1, ..., % for class n]]`. As above, it can be instantiated separately and then passed to the `Scenario` instance. Or the string identifier `'flexible'` can be used for the parameter `samples_split_option`, coupled with the split configuration passed to the keyword argument `samples_split_configuration`. String identified: `'flexible'`.
258258
Example: `samples_split_option='flexible', samples_split_configuration=[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 1.0, 1.0, 1.0, 0.5, 0.5, 0.5, 0.0]]` (this corresponds to 50% of the last 3 classes for partner 1, and 50% or 100% of each of the first 9 classes for partner 2).

mplc/splitter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def __init__(self, amounts_per_partner, configuration, **kwargs):
106106
"per partner from the samples_split_configuration provided.")
107107

108108
# First we re-assemble the split configuration per cluster
109+
self.configuration = configuration
109110
self.split_configuration = configuration
110111
self.samples_split_grouped_by_cluster = list(zip(*configuration))
111112

@@ -204,6 +205,7 @@ class AdvancedSplitter(Splitter):
204205
name = 'Advanced Splitter'
205206

206207
def __init__(self, amounts_per_partner, configuration, **kwargs):
208+
self.configuration = configuration
207209
self.num_clusters, self.specific_shared = list(zip(*configuration))
208210
super().__init__(amounts_per_partner, **kwargs)
209211

0 commit comments

Comments
 (0)