Beispiel #1
0
def test_correct_feature_importances_for_svc_w_linear_kernel(trained_models):
    feature_importances = get_feature_importances(
        trained_models['SVC_w_linear_kernel'])
    assert feature_importances.shape == (30, )
Beispiel #2
0
def test_correct_feature_importances_for_lr(trained_models):
    feature_importances = get_feature_importances(trained_models['LR'])

    ## It returns the intercept, too
    assert feature_importances.shape == (30, )
Beispiel #3
0
def test_correct_feature_importances_for_rf(trained_models):
    feature_importances = get_feature_importances(trained_models['RF'])
    assert feature_importances.shape == (30, )
Beispiel #4
0
def test_throwing_warning_if_SVC_wo_linear_kernel(trained_models):
    with pytest.warns(UserWarning):
        get_feature_importances(trained_models['SVC_wo_linear_kernel'])
Beispiel #5
0
def test_throwing_warning_if_dummyclassifier(trained_models):
    with pytest.warns(UserWarning):
        get_feature_importances(trained_models['Dummy'])
Beispiel #6
0
def test_throwing_warning_if_lr(trained_models):
    with pytest.warns(UserWarning):
        get_feature_importances(trained_models['LR'])
Beispiel #7
0
def test_correct_feature_importances_for_dummy(trained_models):
    feature_importances = get_feature_importances(trained_models["Dummy"])
    assert feature_importances is None
Beispiel #8
0
def test_correct_feature_importances_for_svc_wo_linear_kernel(trained_models):
    feature_importances = get_feature_importances(
        trained_models["SVC_wo_linear_kernel"])
    assert feature_importances is None