Exemple #1
0
def test_rocket_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 ROCKET
    rocket = ROCKETClassifier(num_kernels=1000, random_state=0)
    rocket.fit(X_train.iloc[indices], y_train[indices])

    # assert probabilities are the same
    probas = rocket.predict_proba(X_test.iloc[indices])
    testing.assert_array_equal(probas, rocket_gunpoint_probas)
Exemple #2
0
def test_rocket_ensemble_on_gunpoint(n_jobs, ensemble_config):
    ensemble_size, ensemble, n_estimators = ensemble_config

    # 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 ROCKET ensemble
    rocket_e = ROCKETClassifier(
        num_kernels=1000,
        ensemble_size=ensemble_size,
        ensemble=ensemble,
        n_estimators=n_estimators,
        random_state=0,
        n_jobs=n_jobs,
    )
    rocket_e.fit(X_train.iloc[indices], y_train[indices])

    # assert probabilities are the same
    probas = rocket_e.predict_proba(X_test.iloc[indices])
    testing.assert_array_equal(probas, rocket_e_gunpoint_probas)