def test_individual_boss_on_gunpoint(): # load gunpoint data X_train, y_train = load_gunpoint(split="train", return_X_y=True) X_test, y_test = load_gunpoint(split="test", return_X_y=True) indices = np.random.RandomState(0).permutation(10) # train IndividualBOSS indiv_boss = IndividualBOSS(random_state=0) indiv_boss.fit(X_train.iloc[indices], y_train[indices]) # assert probabilities are the same probas = indiv_boss.predict_proba(X_test.iloc[indices]) testing.assert_array_equal(probas, individual_boss_gunpoint_probas)
def test_individual_boss_on_unit_test(): """Test of IndividualBOSS on unit test data.""" # load unit test data X_train, y_train = load_unit_test(split="train") X_test, y_test = load_unit_test(split="test") indices = np.random.RandomState(0).choice(len(y_train), 10, replace=False) # train IndividualBOSS indiv_boss = IndividualBOSS(random_state=0) indiv_boss.fit(X_train, y_train) # assert probabilities are the same probas = indiv_boss.predict_proba(X_test.iloc[indices]) testing.assert_array_almost_equal(probas, individual_boss_unit_test_probas, decimal=2)