Skip to content

TSData

TSDataSet read data and provides various method for preprocessing data in datasets, including MinMax normalization and Z-score normalization.

There may be some missing values and inconsecutive timestamps in some datasets. We complement the missing timestamps to make it continuous at the possible minimum intervals, meanwhile filling the n/a values using the linear interpolation method.

UTS: AIOPS: 29 curves NAB: 10 curves WSD: 210 curves Yahoo: 367 curves

TSData

TSData(train, valid, test, train_label, test_label, valid_label, info)

TSData contains all information used for training, validation and test, including the dataset values and dataset information. Some typical preprocessing method are provided in class methods.

Attributes:

Name Type Description
train ndarray

The training set in numpy format;

valid ndarray

The validation set in numpy format;

test ndarray

The test set in numpy format;

train_label ndarray

The labels of training set in numpy format;

test_label ndarray

The labels of test set in numpy format;

valid_label ndarray

The labels of validation set in numpy format;

info dict

Some informations about the dataset, which might be useful.

buildfrom classmethod

buildfrom(types, dataset, data_name, train_proportion=1, valid_proportion=0)

Build customized TSDataSet instance from numpy file.

Parameters:

Name Type Description Default
types str

The dataset type. One of "UTS" or "MTS";

required
dataset str

The dataset name where the curve comes from, e.g. "WSD";

required
dataname str

The curve's name (Including the suffix '.npy'), e.g. "1.npy";

required

Returns:

A TSDataSet instance.

min_max_norm

min_max_norm(feature_range=(0, 1))

Function to preprocess one metric using Min Max Normalization and generate training set, validation set and test set according to your settings. Then the datas are cliped to [feature_range.min - 1, feature_range.max + 1]

Params:

feature_range - tuple (min, max), default=(0, 1) Desired range of transformed data.

z_score_norm

z_score_norm()

Function to preprocess one metric using Standard (Z-score) Normalization and generate training set, validation set and test set.