add sample weights function to utils for later usage

This commit is contained in:
René Knaebel 2017-09-17 10:23:23 +02:00
parent f2845e635e
commit 6a47b5f245
1 changed files with 4 additions and 0 deletions

View File

@ -16,3 +16,7 @@ def get_custom_class_weights(client, server):
"client": client_class_weight,
"server": server_class_weight
}
def get_custom_sample_weights(client, server):
return class_weight.compute_sample_weight("balanced", np.vstack((client, server)).T)