def faithful(return_X_y=True):
    """old-faithful dataset

    Parameters
    ----------
    return_X_y : bool,
        if True, returns a model-ready tuple of data (X, y)
        otherwise, returns a Pandas DataFrame

    Returns
    -------
    model-ready tuple of data (X, y)
        OR
    Pandas DataFrame

    Notes
    -----
    The (X, y) tuple is a processed version of the otherwise raw DataFrame.

    A histogram of 200 bins has been computed describing the wating time between eruptions.

    X contains the midpoints of histogram bins.
    y contains the count in each histogram bin.

    Source:
    https://vincentarelbundock.github.io/Rdatasets/doc/datasets/faithful.html
    """
    # y is counts
    # recommend PoissonGAM
    faithful = pd.read_csv(PATH + '/faithful.csv', index_col=0)
    if return_X_y:
        y, x = np.histogram(faithful['eruptions'], bins=200)
        X = x[:-1] + np.diff(x)/2 # get midpoints of bins
        return _clean_X_y(X, y)
    return faithful
def faithful ( return_X_y = True ) : faithful = pd . read_csv ( PATH + '/faithful.csv' , index_col = 0 ) if return_X_y : y , x = np . histogram ( faithful [ 'eruptions' ] , bins = 200 ) X = x [ : - 1 ] + np . diff ( x ) / 2 return _clean_X_y ( X , y ) return faithful
old-faithful dataset

    Parameters
    ----------
    return_X_y : bool,
        if True, returns a model-ready tuple of data (X, y)
        otherwise, returns a Pandas DataFrame

    Returns
    -------
    model-ready tuple of data (X, y)
        OR
    Pandas DataFrame

    Notes
    -----
    The (X, y) tuple is a processed version of the otherwise raw DataFrame.

    A histogram of 200 bins has been computed describing the wating time between eruptions.

    X contains the midpoints of histogram bins.
    y contains the count in each histogram bin.

    Source:
    https://vincentarelbundock.github.io/Rdatasets/doc/datasets/faithful.html