reservoir_computing.utils

Functions

compute_test_scores(pred_class, Yte)

Wrapper to compute classification accuracy and F1 score

make_forecasting_dataset(X, horizon[, test_percent, ...])

This function does the following:

Module Contents

reservoir_computing.utils.compute_test_scores(pred_class, Yte)

Wrapper to compute classification accuracy and F1 score

Parameters:

pred_classnp.ndarray

Predicted class labels

Ytenp.ndarray

True class labels

Returns:

accuracyfloat

Classification accuracy

f1float

F1 score

reservoir_computing.utils.make_forecasting_dataset(X, horizon, test_percent=0.15, val_percent=0.0, scaler=None)

This function does the following:

  1. Splits the dataset in training, validation and test sets

  2. Shift the target data by ‘horizon’ to create the forecasting problem

  3. Normalizes the data

Parameters:

Xnp.ndarray

Input data

horizonint

Forecasting horizon

test_percentfloat

Percentage of the data to be used for testing

val_percentfloat

Percentage of the data to be used for validation If 0, no validation set is created

scalera scaler object from sklearn.preprocessing

Scaler object to normalize the data If None, a StandardScaler is created

Returns:

Xtrnp.ndarray

Training input data

Ytrnp.ndarray

Training target data

Xtenp.ndarray

Test input data

Ytenp.ndarray

Test target data

scalera scaler object from sklearn.preprocessing

Scaler object used to normalize the data

Xvalnp.ndarray (optional)

Validation input data

Yvalnp.ndarray (optional)

Validation target data