示例#1
0
def test_predict_pred(reg_dataset):
    x_train = reg_dataset[0]
    y_train = reg_dataset[1]
    x_cal = reg_dataset[2]
    y_cal = reg_dataset[3]
    x_test = reg_dataset[4]
    adapt_model = Adapt_to_CP(RandomForestRegressor(n_estimators=10), True)
    adapt_model.fit(x_train, y_train)
    adapt_model.calibrate(x_cal, y_cal)
    pred = adapt_model.predict(x_test, 0.8)
    assert type(pred[1]) == np.ndarray
示例#2
0
def test_calibrate(reg_dataset):
    x_train = reg_dataset[0]
    y_train = reg_dataset[1]
    x_cal = reg_dataset[2]
    y_cal = reg_dataset[3]
    adapt_model = Adapt_to_CP(RandomForestRegressor(n_estimators=10), True)
    adapt_model.fit(x_train, y_train)
    assert adapt_model.calibrate(x_cal, y_cal) == None