Beispiel #1
0
def test_linear_svr_warm_start():
    reg = LinearSVR(C=1e-3, random_state=0, warm_start=True)
    reg.fit(reg_dense, reg_target)
    assert_greater(reg.score(reg_dense, reg_target), 0.96)

    reg.C = 1
    reg.fit(reg_dense, reg_target)
    assert_greater(reg.score(reg_dense, reg_target), 0.99)
Beispiel #2
0
def test_linear_svr_warm_start():
    reg = LinearSVR(C=1e-3, random_state=0, warm_start=True)
    reg.fit(reg_dense, reg_target)
    assert_greater(reg.score(reg_dense, reg_target), 0.96)

    reg.C = 1
    reg.fit(reg_dense, reg_target)
    assert_greater(reg.score(reg_dense, reg_target), 0.99)
Beispiel #3
0
def test_linear_svr_l2():
    reg = LinearSVR(loss="l2", random_state=0)
    reg.fit(reg_dense, reg_target)
    assert_greater(reg.score(reg_dense, reg_target), 0.99)
Beispiel #4
0
def test_linear_svr_fit_intercept():
    reg = LinearSVR(random_state=0, fit_intercept=True)
    reg.fit(reg_dense, reg_target)
    assert_greater(reg.score(reg_dense, reg_target), 0.99)
def test_linear_svr_warm_start(reg_train_data, C, warm_start):
    reg_dense, reg_target = reg_train_data
    reg = LinearSVR(C=C, random_state=0, warm_start=warm_start)
    reg.fit(reg_dense, reg_target)
    target_score = 0.99 if C == 1 else 0.96
    assert reg.score(reg_dense, reg_target) > target_score
def test_linear_svr(reg_train_data, fit_intercept, loss):
    reg_dense, reg_target = reg_train_data
    reg = LinearSVR(random_state=0, fit_intercept=fit_intercept, loss=loss)
    reg.fit(reg_dense, reg_target)
    assert reg.score(reg_dense, reg_target) > 0.99
Beispiel #7
0
def test_linear_svr_l2():
    reg = LinearSVR(loss="l2", random_state=0)
    reg.fit(reg_dense, reg_target)
    assert_greater(reg.score(reg_dense, reg_target), 0.99)
Beispiel #8
0
def test_linear_svr_fit_intercept():
    reg = LinearSVR(random_state=0, fit_intercept=True)
    reg.fit(reg_dense, reg_target)
    assert_greater(reg.score(reg_dense, reg_target), 0.99)
def test_linear_svr():
    reg = LinearSVR(random_state=0)
    reg.fit(reg_dense, reg_target)
    assert reg.score(reg_dense, reg_target) > 0.99