def _predict_proba_json_tree(json_tree, sample):
    """
    Recursively follow the path of a sample through the JSON tree and return the resulting leaf's value.
    """
    if "leaf" in json_tree:
        return json_tree["leaf"]

    if sample[json_tree["split"]] <= json_tree["split_condition"]:
        next_node_id = json_tree["yes"]
    else:
        next_node_id = json_tree["no"]

    for sub_tree in json_tree["children"]:
        if sub_tree["nodeid"] == next_node_id:
            return _predict_proba_json_tree(sub_tree, sample)