def test_ihdp_dataprovider():
    """ Tests the new IHDP dataprovider"""
    ihdp = load_ihdp()
    assert ihdp is not None
    assert ihdp.data is not None
    assert ihdp.covariate_names is not None
    all_true = np.all(np.isin(ihdp.covariate_names, list(ihdp.data.columns)))
    assert all_true

    rep = ihdp.data.loc[ihdp.data["rep"] == 0]
    assert len(rep) == 747  # number of samples in rep
    assert len(ihdp.data.groupby("rep")) == 1000  # number of reps
    assert ihdp.has_test
    assert len(rep.loc[rep["test"]]) == 75  # number of test samples in rep
def ihdp_data():
    return load_ihdp()
示例#3
0
def ihdp_data():
    # Limit the replications for better runtime in tests
    return load_ihdp(select_rep=[0, 1])
示例#4
0
def ihdp_data_full():
    return load_ihdp()