Ejemplo n.º 1
0
def test_default_fit_transform_no_selected_variables():
    selection_criteria = {"quality_score": {"min": 0.99}}
    process = BinningProcess(variable_names,
                             selection_criteria=selection_criteria)

    X_transform = process.fit_transform(X, y, metric="event_rate")
    assert X_transform == approx(np.empty(0).reshape((X.shape[0], 0)))
Ejemplo n.º 2
0
def test_default_fit_transform():
    process = BinningProcess(variable_names)
    X_transform = process.fit_transform(X, y, metric="event_rate")

    optb = OptimalBinning()
    x = X[:, 5]
    optb.fit(x, y)

    assert optb.transform(x, metric="event_rate") == approx(X_transform[:, 5],
                                                            rel=1e-6)