def test_linear_svc_2(): """Ensure that the TPOT LinearSVC outputs the same as the sklearn LinearSVC when C == 0.0""" tpot_obj = TPOT() result = tpot_obj._linear_svc(training_testing_data, 0.0, 0, True) result = result[result['group'] == 'testing'] lsvc = LinearSVC(C=0.0001, penalty='l1', dual=False, random_state=42) lsvc.fit(training_features, training_classes) assert np.array_equal(result['guess'].values, lsvc.predict(testing_features))
def test_linear_svc(): """Ensure that the TPOT LinearSVC outputs the same as the sklearn LinearSVC""" tpot_obj = TPOT() result = tpot_obj._linear_svc(training_testing_data, 1.0, 0, 0) result = result[result['group'] == 'testing'] lsvc = LinearSVC(C=1.0, loss='hinge', fit_intercept=True, random_state=42) lsvc.fit(training_features, training_classes) assert np.array_equal(result['guess'].values, lsvc.predict(testing_features))
def test_linear_svc(): """Ensure that the TPOT LinearSVC outputs the same as the sklearn LinearSVC""" tpot_obj = TPOT() result = tpot_obj._linear_svc(training_testing_data, 1.0, 0, True) result = result[result['group'] == 'testing'] lsvc = LinearSVC(C=1.0, loss='hinge', fit_intercept=True, random_state=42) lsvc.fit(training_features, training_classes) assert np.array_equal(result['guess'].values, lsvc.predict(testing_features))