Transformers¶
Module of transformers.
A transformer transforms time series to extract useful information.

class
adtk.transformer.
ClassicSeasonalDecomposition
(freq=None, trend=False)[source]¶ Transformer that performs classic seasonal decomposition to the time series, and returns residual series.
Classic seasonal decomposition assumes time series is the sum of trend, seasonal pattern, and noise (residual). This transformer calculates and removes trend component with moving average, extracts seasonal pattern by taking average over seasonal periods of the detrended series, and returns residual series.
The fit method fits seasonal frequency (if not specified) and seasonal pattern with the training series. The transform (or its alias predict) method extracts the trend by moving average, but will NOT recalucate the seasonal pattern. Instead, it uses the trained seasonal pattern and extracts it from the detrended series to obtain the residual series. This implicitly assumes the seasonal property does not change over time.
 Parameters
freq (int, optional) – Length of a seasonal cycle as the number of time points in a cycle. If None, the model will determine based on autocorrelation of the training series. Default: None.
trend (bool, optional) – Whether to extract and remove trend of the series with moving average. If False, the time series will be assumed the sum of seasonal pattern and residual. Default: False.
 Return type
None

freq_
¶ Length of seasonal cycle. Equal to parameter freq if it is given. Otherwise, calculated based on autocorrelation of the training series.
 Type
int

seasonal_
¶ Seasonal pattern extracted from training series.
 Type
pandas.Series

fit
(ts)¶ Train the transformer with given time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be used to train the transformer. If a DataFrame with k columns, k univariate transformers will be trained independently.
 Return type
None

fit_predict
(ts)¶ Train the transformer, and tranform the time series used for training.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be used for training and be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series, and k univariate transformers will be trained and applied to each series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

fit_transform
(ts)¶ Train the transformer, and tranform the time series used for training.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be used for training and be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series, and k univariate transformers will be trained and applied to each series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) –
Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series.
If the transformer was trained with a Series, the transformer will be applied to each univariate series independently;
If the transformer was trained with a DataFrame, i.e. the transformer is essentially k transformers, those transformers will be applied to each univariate series respectively.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) –
Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series.
If the transformer was trained with a Series, the transformer will be applied to each univariate series independently;
If the transformer was trained with a DataFrame, i.e. the transformer is essentially k transformers, those transformers will be applied to each univariate series respectively.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

class
adtk.transformer.
CustomizedTransformer1D
(transform_func, transform_func_params=None, fit_func=None, fit_func_params=None)[source]¶ Univariate transformer derived from a usergiven function and parameters.
 Parameters
transform_func (function) –
A function transforming univariate time series.
The first input argument must be a pandas Series, optional input argument may be accepted through parameter transform_func_params and the output of fit_func, and the output must be a pandas Series or DataFrame with the same index as input.
transform_func_params (dict, optional) – Parameters of transform_func. Default: None.
fit_func (function, optional) –
A function training parameters of transform_func with univariate time series.
The first input argument must be a pandas Series, optional input argument may be accepted through parameter fit_func_params, and the output must be a dict that can be used by transform_func as parameters. Default: None.
fit_func_params (dict, optional) – Parameters of fit_func. Default: None.
 Return type
None

fit
(ts)¶ Train the transformer with given time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be used to train the transformer. If a DataFrame with k columns, k univariate transformers will be trained independently.
 Return type
None

fit_predict
(ts)¶ Train the transformer, and tranform the time series used for training.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be used for training and be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series, and k univariate transformers will be trained and applied to each series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

fit_transform
(ts)¶ Train the transformer, and tranform the time series used for training.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be used for training and be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series, and k univariate transformers will be trained and applied to each series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) –
Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series.
If the transformer was trained with a Series, the transformer will be applied to each univariate series independently;
If the transformer was trained with a DataFrame, i.e. the transformer is essentially k transformers, those transformers will be applied to each univariate series respectively.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) –
Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series.
If the transformer was trained with a Series, the transformer will be applied to each univariate series independently;
If the transformer was trained with a DataFrame, i.e. the transformer is essentially k transformers, those transformers will be applied to each univariate series respectively.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

class
adtk.transformer.
DoubleRollingAggregate
(window, agg='mean', agg_params=None, center=True, min_periods=None, diff='l1')[source]¶ Transformer that rolls two sliding windows sidebyside along a time series, aggregates using a usergiven operation, and calcuates the difference of aggregated metrics between two sliding windows.
 Parameters
window (int or str, or 2tuple of int or str) –
Size of the rolling time window.
If int, it is the number of time point in this time window.
If str, it must be able to be converted into a pandas Timedelta object.
If tuple, it defines the size of left and right window respectively.
agg (str or function, or 2tuple of str or function) –
Aggregation method applied to series. If str, must be one of supported builtin methods:
’mean’: mean of all values in a rolling window.
’median’: median of all values in a rolling window.
’sum’: summation of all values in a rolling window.
’min’: minimum of all values in a rolling window.
’max’: maximum of all values in a rolling window.
’std’: sample standard deviation of all values in a rolling window.
’var’: sample variance of all values in a rolling window.
’skew’: skewness of all values in a rolling window.
’kurt’: kurtosis of all values in a rolling window.
’count’: number of nonnan values in a rolling window.
’nnz’: number of nonzero values in a rolling window.
’nunique’: number of unique values in a rolling window.
’quantile’: quantile of all values in a rolling window. Require percentile parameter q in in parameter agg_params, which is a float or a list of float between 0 and 1 inclusive.
’iqr’: interquartile range, i.e. difference between 75% and 25% quantiles.
’idr’: interdecile range, i.e. difference between 90% and 10% quantiles.
’hist’: histogram of all values in a rolling window. Require parameter bins in parameter agg_params to define the bins. bins is either a list of floats, b1, …, bn, which defines n1 bins [b1, b2), [b2, b3), …, [b{n2}, b{n1}), [b{n1}, bn], or an integer that defines the number of equalwidth bins in the range of input series.
If function, it should accept a rolling window in form of a pandas Series, and return either a scalar or a 1D numpy array. To specify names of outputs, specify a list of strings as a parameter names in parameter agg_params.
If tuple, elements correspond left and right window respectively.
Default: ‘mean’
agg_params (dict or 2tuple of dict, optional) – Parameters of aggregation function. If tuple, elements correspond left and right window respectively. Default: None.
center (bool, optional) – If True, the current point is the right edge of right window; Otherwise, it is the right edge of left window. Default: True.
min_periods (int or 2tuple of int, optional) – Minimum number of observations in window required to have a value. If tuple, elements correspond left and right window respectively. Default: None, i.e. all observations must have values.
diff (str or function, optional) –
Difference method applied between aggregated metrics from the two sliding windows. If str, choose from supported builtin methods:
’diff’: Difference between values of aggregated metric (right minus left). Only applicable if the aggregated metric is scalar.
’rel_diff’: Relative difference between values of aggregated metric (right minus left divided left). Only applicable if the aggregated metric is scalar.
’abs_rel_diff’: Absolute relative difference between values of aggregated metric (right minus left divided left). Only applicable if the aggregated metric is scalar.
’l1’: Absolute difference if aggregated metric is scalar, or sum of elementwise absolute difference if it is a vector.
’l2’: Square root of sum of elementwise squared difference.
If function, it accepts two input arguments that are the two outputs of applying aggregation method to the two windows, and returns a float number measuring the difference.
Default: ‘l1’
 Return type
None

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series and the transformer will be applied to each univariate series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series and the transformer will be applied to each univariate series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

class
adtk.transformer.
Retrospect
(n_steps=1, step_size=1, till=0)[source]¶ Transformer that returns dataframe with retrospective values, i.e. a row at time t includes value at (tk)’s where k’s are specified by user.
This transformer may be useful for cases where lagging effect should be taken in account. For example, a change of control u may not be reflected in outcome y within 2 minutes, and its effect may last for another 3 minutes. In this case, a dataframe where each row include u_[t3], u_[t4], u_[t5], and a series y_t are needed to learn the relationship between control and outcome.
 Parameters
n_steps (int, optional) – Number of retrospective steps to take. Default: 1.
step_size (int, optional) – Length of a retrospective step. Default: 1.
till (int, optional) – Nearest retrospective step. Default: 0, i.e. the current time step.
 Return type
None
Examples
>>> s = pd.Series( np.arange(10), index=pd.date_range( start='201711', periods=10, freq='D')) 20170101 0 20170102 1 20170103 2 20170104 3 20170105 4 20170106 5 20170107 6 20170108 7 20170109 8 20170110 9 >>> Retrospect(n_steps=3, step_size=2, till=1).transform(s) t1 t3 t5 20170101 NaN NaN NaN 20170102 0.0 NaN NaN 20170103 1.0 NaN NaN 20170104 2.0 0.0 NaN 20170105 3.0 1.0 NaN 20170106 4.0 2.0 0.0 20170107 5.0 3.0 1.0 20170108 6.0 4.0 2.0 20170109 7.0 5.0 3.0 20170110 8.0 6.0 4.0

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series and the transformer will be applied to each univariate series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series and the transformer will be applied to each univariate series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

class
adtk.transformer.
RollingAggregate
(window, agg='mean', agg_params=None, center=False, min_periods=None)[source]¶ Transformer that rolls a sliding window along a time series, and aggregates using a userselected operation.
 Parameters
window (int or str) –
Size of the rolling time window.
If int, it is the number of time point in this time window.
If str, it must be able to be converted into a pandas Timedelta object.
agg (str or function) –
Aggregation method applied to series. If str, must be one of supported builtin methods:
’mean’: mean of all values in a rolling window.
’median’: median of all values in a rolling window.
’sum’: summation of all values in a rolling window.
’min’: minimum of all values in a rolling window.
’max’: maximum of all values in a rolling window.
’std’: sample standard deviation of all values in a rolling window.
’var’: sample variance of all values in a rolling window.
’skew’: skewness of all values in a rolling window.
’kurt’: kurtosis of all values in a rolling window.
’count’: number of nonnan values in a rolling window.
’nnz’: number of nonzero values in a rolling window.
’nunique’: number of unique values in a rolling window.
’quantile’: quantile of all values in a rolling window. Require percentile parameter q in in parameter agg_params, which is a float or a list of float between 0 and 1 inclusive.
’iqr’: interquartile range, i.e. difference between 75% and 25% quantiles.
’idr’: interdecile range, i.e. difference between 90% and 10% quantiles.
’hist’: histogram of all values in a rolling window. Require parameter bins in parameter agg_params to define the bins. bins is either a list of floats, b1, …, bn, which defines n1 bins [b1, b2), [b2, b3), …, [b{n2}, b{n1}), [b{n1}, bn], or an integer that defines the number of equalwidth bins in the range of input series.
If function, it should accept a rolling window in form of a pandas Series, and return either a scalar or a 1D numpy array. To specify names of outputs, specify a list of strings as a parameter names in parameter agg_params.
Default: ‘mean’
agg_params (dict, optional) – Parameters of aggregation function. Default: None.
center (bool, optional) – Whether the calculation is at the center of time window or on the right edge. Default: False.
min_periods (int, optional) – Minimum number of observations in window required to have a value. Default: None, i.e. all observations must have values.
 Return type
None

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series and the transformer will be applied to each univariate series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series and the transformer will be applied to each univariate series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

class
adtk.transformer.
StandardScale
[source]¶ Transformer that scales time series such that mean is equal to 0 and standard deviation is equal to 1.
 Return type
None

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series and the transformer will be applied to each univariate series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(ts)¶ Transform time series.
 Parameters
ts (pandas.Series or pandas.DataFrame) – Time series to be transformed. If a DataFrame with k columns, it is treated as k independent univariate time series and the transformer will be applied to each univariate series independently.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

class
adtk.transformer.
CustomizedTransformerHD
(transform_func, transform_func_params=None, fit_func=None, fit_func_params=None)[source]¶ Multivariate transformer derived from a usergiven function and parameters.
 Parameters
transform_func (function) –
A function transforming multivariate time series.
The first input argument must be a pandas DataFrame, optional input argument may be accepted through parameter transform_func_params and the output of fit_func, and the output must be a pandas Series or DataFrame with the same index as input.
transform_func_params (dict, optional) – Parameters of transform_func. Default: None.
fit_func (function, optional) –
A function training parameters of transform_func with multivariate time series.
The first input argument must be a pandas DataFrame, optional input argument may be accepted through parameter fit_func_params, and the output must be a dict that can be used by transform_func as parameters. Default: None.
fit_func_params (dict, optional) – Parameters of fit_func. Default: None.
 Return type
None

fit
(df)¶ Train the transformer with given time series.
 Parameters
df (pandas.DataFrame) – Time series to be used to train the transformer.
 Return type
None

fit_predict
(df)¶ Train the transformer, and tranform the time series used for training.
 Parameters
df (pandas.DataFrame) – Time series to be used for training and be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

fit_transform
(df)¶ Train the transformer, and tranform the time series used for training.
 Parameters
df (pandas.DataFrame) – Time series to be used for training and be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

class
adtk.transformer.
PcaProjection
(k=1)[source]¶ Transformer that performs principal component analysis (PCA) to the multivariate time series (every time point is treated as a point in high dimensional space), and represents those points with their projection on the first k principal components.
 Parameters
k (int, optional) – Number of principal components to use. Default: 1.
 Return type
None

fit
(df)¶ Train the transformer with given time series.
 Parameters
df (pandas.DataFrame) – Time series to be used to train the transformer.
 Return type
None

fit_predict
(df)¶ Train the transformer, and tranform the time series used for training.
 Parameters
df (pandas.DataFrame) – Time series to be used for training and be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

fit_transform
(df)¶ Train the transformer, and tranform the time series used for training.
 Parameters
df (pandas.DataFrame) – Time series to be used for training and be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

class
adtk.transformer.
PcaReconstruction
(k=1)[source]¶ Transformer that performs principal component analysis (PCA) to the multivariate time series (every time point is treated as a point in high dimensional space), and reconstructs those points with the first k principal components.
 Parameters
k (int, optional) – Number of principal components to use. Default: 1.
 Return type
None

fit
(df)¶ Train the transformer with given time series.
 Parameters
df (pandas.DataFrame) – Time series to be used to train the transformer.
 Return type
None

fit_predict
(df)¶ Train the transformer, and tranform the time series used for training.
 Parameters
df (pandas.DataFrame) – Time series to be used for training and be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

fit_transform
(df)¶ Train the transformer, and tranform the time series used for training.
 Parameters
df (pandas.DataFrame) – Time series to be used for training and be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

class
adtk.transformer.
PcaReconstructionError
(k=1)[source]¶ Transformer that performs principal component analysis (PCA) to the multivariate time series (every time point is treated as a point in high dimensional space), reconstruct those points with the first k principal components, and returns the reconstruction error (i.e. squared distance bewteen the reconstructed point and original point).
 Parameters
k (int, optional) – Number of principal components to use. Default: 1.
 Return type
None

fit
(df)¶ Train the transformer with given time series.
 Parameters
df (pandas.DataFrame) – Time series to be used to train the transformer.
 Return type
None

fit_predict
(df)¶ Train the transformer, and tranform the time series used for training.
 Parameters
df (pandas.DataFrame) – Time series to be used for training and be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

fit_transform
(df)¶ Train the transformer, and tranform the time series used for training.
 Parameters
df (pandas.DataFrame) – Time series to be used for training and be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

class
adtk.transformer.
RegressionResidual
(regressor, target)[source]¶ Transformer that performs regression to build relationship between a target series and the rest of series, and returns regression residual series.
 Parameters
regressor (object) – Regressor to be used. Same as a scikitlearn regressor, it should minimally have fit and predict methods.
target (str, optional) – Name of the column to be regarded as target variable.
 Return type
None

fit
(df)¶ Train the transformer with given time series.
 Parameters
df (pandas.DataFrame) – Time series to be used to train the transformer.
 Return type
None

fit_predict
(df)¶ Train the transformer, and tranform the time series used for training.
 Parameters
df (pandas.DataFrame) – Time series to be used for training and be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

fit_transform
(df)¶ Train the transformer, and tranform the time series used for training.
 Parameters
df (pandas.DataFrame) – Time series to be used for training and be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

class
adtk.transformer.
SumAll
[source]¶ Transformer that returns the sum all series as one series.
 Return type
None

get_params
()¶ Get the parameters of this model.
 Returns
Model parameters.
 Return type
dict

predict
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame

set_params
(**params)¶ Set the parameters of this model.
 Parameters
**params – Model parameters to set.
params (Any) –
 Return type
None

transform
(df)¶ Transform time series.
 Parameters
df (pandas.DataFrame) – Time series to be transformed.
 Returns
Transformed time series.
 Return type
pandas.Series or pandas.DataFrame