def client_decrypt_prediction_multiclass()

in src/ppxgboost/PPBooster.py [0:0]


def client_decrypt_prediction_multiclass(private_key, predictions):
    """
    Client calls this function to compute the multi-class prediction -- i.e. it outputs the most probable class for the
    predicted class.
    This methods first decrypts the aggregated predictions using @private_key@,
    then calls the client_side_multiclass_compute() function.
    :param private_key: the private key to decrypt the values.
    :param predictions: encrypted list of predictions (each entry of the list is a list of encrypted scores.)
    :return: the results as numpy.ndarray()
    """
    decrypted_pred_list = []
    for enc_pred in predictions:
        decrypted_scores = []
        for enc_scores in enc_pred:
            # decrypts the encrypted scores.
            decrypted_scores.append(paillier.decrypt(private_key, enc_scores))
        decrypted_pred_list.append(decrypted_scores)
    result = client_side_multiclass_compute(decrypted_pred_list)
    return np.array(result)