def gcv_score(fit_measure, n_samples, df):
    """
    Computes the generalized cross-validation score. See Section 5.6 of (Fan et al., 2020).

    Parameters
    ----------    
    fit_measure: float
       A measure of model fit, e.g. deviance, sum of squared Pearson, or Anscombe Residuals.

    n_samples: int
       Number of samples.
       
    df: float
        An estimate of the effective degrees of freedom for the estimated coefficient.

    Output
    ------
    gcv: float
        Generalized cross-validation score.

    References
    ----------
    Fan, J., Li, R., Zhang, C.H. and Zou, H., 2020. Statistical foundations of data science. Chapman and Hall/CRC.
    """
    return (1/n_samples) * fit_measure / (1 - (df/n_samples))**2