View non_iid_split.py
This file contains 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
def split_image_data_realwd(data, labels, n_clients=100, verbose=True): | |
''' | |
Splits (data, labels) among 'n_clients s.t. every client can holds any number of classes which is trying to simulate real world dataset | |
Input: | |
data : [n_data x shape] | |
labels : [n_data (x 1)] from 0 to n_labels(10) | |
n_clients : number of clients | |
verbose : True/False => True for printing some info, False otherwise | |
Output: | |
clients_split : splitted client data into desired format |