Skip to content

Preprocessing

Data preprocessing utilities, used to load deconvoluted data into the model and reshape them into appropriate data formats.

Import as:

from covvfit import preprocess

covvfit.preprocess.TimeScaler

Scales a list of time series, so that the values are normalized.

fit(self, ts)

Fit the scaler parameters to the provided time series.

Parameters:

Name Type Description Default
ts list

list of timeseries, i.e., ts[i] is an array of some length n_timepoints[i].

required

fit_transform(self, ts)

Fits the model and returns scaled values.

Parameters:

Name Type Description Default
ts list

list of timeseries, i.e., ts[i] is an array of some length n_timepoints[i].

required

Returns:

Type Description
list

list of exactly the same format as ts

Note

This function is equivalent to calling first fit method and then transform.

transform(self, ts)

Returns scaled values.

Parameters:

Name Type Description Default
ts list

list of timeseries, i.e., ts[i] is an array of some length n_timepoints[i].

required

Returns:

Type Description
list

list of exactly the same format as ts

Note

The model has to be fitted first.