def test_v_fracs(nn, pp, bb, frac):
    X, y, coef_ols, _ = make_data(nn, pp, bb)
    FR = FracRidgeRegressor(fracs=frac)
    FR.fit(X, y)
    assert np.all(
        np.abs(frac -
               vec_len(FR.coef_, axis=0) / vec_len(coef_ols, axis=0)) < 0.01)
def test_fracridge_fracs(frac, nn, pp, bb):
    X, y, coef_ols, _ = make_data(nn, pp, bb)
    # Make sure that you get the fraction you asked for
    coef, _ = fracridge(X, y, fracs=np.array([frac]))
    assert np.all(
        np.abs(frac -
               vec_len(coef, axis=0) / vec_len(coef_ols, axis=0)) < 0.01)