def get_shap_values(model_manager, direct_id, target=None):
    """Get the SHAP values of features.

    Args:
        model_manager: ModelManager, an object containing all prediction models
        direct_id: the identifier of the patient's related entry in the target entity
                (e.g., the admission id).
        target: the identifier of the prediction target

    Returns:
        A dict mapping prediction target to features' SHAP values for this prediction.
    """
    shap_values = model_manager.explain(id=direct_id, target=target)
    if target is None:
        return {target: sv.loc[0].to_dict() for target, sv in shap_values.items()}
    else:
        return shap_values.loc[0].to_dict()