Skip to content

Instantly share code, notes, and snippets.

View mansiparashar's full-sized avatar

Mansi Parashar mansiparashar

  • India
View GitHub Profile
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