Esempio n. 1
0
def get_sample_source(prob_label):
    """Return a (SampleSource, n) representing the problem"""

    if prob_label not in label2fname:
        raise ValueError('Unknown problem label. Need to be one of %s'%str(label2fname.keys()) )
    fname = label2fname[prob_label]
    tst_data, n = load_nips_TSTData(fname)
    ss = data.SSResample(tst_data)
    return ss, n
Esempio n. 2
0
def get_sample_source(prob_label):
    """Return a (SampleSource, n) representing the problem"""

    if prob_label not in label2fname:
        raise ValueError('Unknown problem label. Need to be one of %s' %
                         str(label2fname.keys()))

    if prob_label == 'crop48_h0':
        one_sample = glo.load_data_file(label2fname[prob_label])
        n_max = one_sample.shape[0] / 2
        return data.SSNullResample(one_sample), n_max

    fname = label2fname[prob_label]
    tst_data = glo.load_data_file(fname)
    n = tst_data.X.shape[0]
    ss = data.SSResample(tst_data)
    return ss, n