def decode_scoring_configuration(scoring_configuration):
    """
    Decode a scoring configuration from grpc

    Parameters
    ----------
    scoring_configuration: core_pb2.ScoringConfiguration
        A grpc ScoringConfiguration message.

    Returns
    -------
    configuration: dict
        A dictionary with the scoring configuration.
    """
    method = scoring_configuration.method
    configuration = {
        'method': method,
        'train_score_ratio': str(scoring_configuration.train_test_ratio),
        'stratified': str(scoring_configuration.stratified).lower(),
        'shuffle': str(scoring_configuration.shuffle).lower(),
        'randomSeed': str(scoring_configuration.random_seed),
    }
    if method == 'K_FOLD':
        configuration['number_of_folds'] = str(scoring_configuration.folds)
    return configuration