def METHOD_NAME(data_type, make_data_type):
    X = np.array([[i] for i in range(1000)])
    y = np.array([0] * 150 + [1] * 850)
    X = make_data_type(data_type, X)
    y = make_data_type(data_type, y)
    sampling_ratio = 0.25
    undersampler = Undersampler(sampling_ratio=sampling_ratio)
    fit_transformed_X, fit_transformed_y = undersampler.fit_transform(X, y)
    assert len(fit_transformed_X) == 750
    assert len(fit_transformed_y) == 750
    value_counts = fit_transformed_y.value_counts()
    assert value_counts.values[1] / value_counts.values[0] == sampling_ratio
    pd.testing.assert_series_equal(
        value_counts,
        pd.Series([600, 150], index=[1, 0], name="count"),
        check_dtype=False,
        check_names=False,
    )
    undersampler = Undersampler(sampling_ratio=sampling_ratio)
    undersampler.fit(X, y)
    transformed_X, transformed_y = undersampler.transform(X, y)
    assert_frame_equal(transformed_X, fit_transformed_X)
    assert_series_equal(transformed_y, fit_transformed_y)