StreamAD Utilities#

Dataset#

UnivariateDS#

class streamad.util.UnivariateDS[source]#

Bases: streamad.util.dataset.DS

Load univariate dataset.


MultivariateDS#

class streamad.util.MultivariateDS(has_names=False)[source]#

Bases: streamad.util.dataset.DS

Load multivariate dataset.


Generator#

StreamGenerator#

class streamad.util.StreamGenerator(X)[source]#

Bases: object

Load static dataset and generate observation once a time.

__init__(X)[source]#

Initialize a StreamGenerator.

Parameters

X (np.ndarray) – Origin static dataset.

Raises

TypeError – Unexpected input data type.

iter_item()[source]#

Iterate item once a time from the dataset.

Yields

Generator – One observation from the dataset.

Return type

Generator


Math toolkit#

Statistic#

class streamad.util.StreamStatistic[source]#

Bases: object

Data statistics for the streaming data.

__init__()[source]#

Statistic for stream data We support max, min, sum, mean, sum of squares, var, std and standard scaler for streaming data.

get_max()[source]#

Get max stattistic.

get_mean()[source]#

Get mean stattistic.

get_min()[source]#

Get min stattistic.

get_std()[source]#

Get max stattistic.

get_sum()[source]#

Get sum stattistic.

get_var()[source]#

Get var stattistic.

update(X)[source]#

Update a pd.Series to stream

Parameters

X (np.ndarray) – An item from StreamGenerator


Evaluation#

AUCMetric#

class streamad.util.AUCMetric[source]#

Bases: streamad.base.metrics.BaseMetrics

ROC_AUC score for evaluation.


Visualization#

Plot#

class streamad.util.plot(data, label, date, scores, features)[source]#

Bases: