Esempio n. 1
0
"""
Hyperparameters overview
"""
import numpy as np
import matplotlib.pyplot as plt
import helper as h
import csm

np.set_printoptions(precision=3)
p = 0.05

# Select streams and methods
streams = h.streams()
clfs = h.clfs()

# Stream Variables
drift_types = ["incremental", "sudden"]
ldistributions = [[0.1, 0.9], [0.2, 0.8], [0.3, 0.7], [0.4, 0.6]]
random_states = [1337, 666, 42]
label_noises = [0.0, 0.1, 0.2, 0.3]

# Prepare storage for results
chunk_size = next(iter(streams.values())).chunk_size
n_chunks = next(iter(streams.values())).n_chunks
score_points = list(range(chunk_size, chunk_size * n_chunks, chunk_size))


def gather_and_present(title, filename, streams, what, e):
    results_hypercube = np.zeros((len(streams), len(clfs), n_chunks - 1))
    for i, stream_n in enumerate(streams):
        results = np.load("results/experiment_%i/%s.npy" % (e, stream_n))
Esempio n. 2
0
                              specificity)
import sys
from sklearn.base import clone
from sklearn.tree import DecisionTreeClassifier
from skmultiflow.trees import HoeffdingTree

if len(sys.argv) != 2:
    print("PODAJ RS")
    exit()
else:
    random_state = int(sys.argv[1])

print(random_state)

# Select streams and methods
streams = h.streams(random_state)

print(len(streams))

ob = OnlineBagging(n_estimators=20, base_estimator=GaussianNB())
oob = OOB(n_estimators=20, base_estimator=GaussianNB())
uob = UOB(n_estimators=20, base_estimator=GaussianNB())
ros_knorau2 = SEA(base_estimator=StratifiedBagging(base_estimator=GaussianNB(),
                                                   random_state=42,
                                                   oversampler="ROS"),
                  oversampled="ROS",
                  des="KNORAU2")
cnn_knorau2 = SEA(base_estimator=StratifiedBagging(base_estimator=GaussianNB(),
                                                   random_state=42,
                                                   oversampler="CNN"),
                  oversampled="CNN",