pyFTS.common.transformations package

Module contents

Submodules

pyFTS.common.transformations.adapativeexpectation module

pyFTS.common.transformations.boxcox module

class pyFTS.common.transformations.boxcox.BoxCox(plambda)[source]

Bases: pyFTS.common.transformations.transformation.Transformation

Box-Cox power transformation

y’(t) = log( y(t) ) y(t) = exp( y’(t) )

apply(data, param=None, **kwargs)[source]

Apply the transformation on input data

Parameters
  • data – input data

  • param

  • kwargs

Returns

numpy array with transformed data

inverse(data, param=None, **kwargs)[source]
Parameters
  • data – transformed data

  • param

  • kwargs

Returns

numpy array with inverse transformed data

property parameters

pyFTS.common.transformations.differential module

class pyFTS.common.transformations.differential.Differential(lag)[source]

Bases: pyFTS.common.transformations.transformation.Transformation

Differentiation data transform

y’(t) = y(t) - y(t-1) y(t) = y(t-1) + y’(t)

apply(data, param=None, **kwargs)[source]

Apply the transformation on input data

Parameters
  • data – input data

  • param

  • kwargs

Returns

numpy array with transformed data

inverse(data, param, **kwargs)[source]
Parameters
  • data – transformed data

  • param

  • kwargs

Returns

numpy array with inverse transformed data

property parameters

pyFTS.common.transformations.normalization module

class pyFTS.common.transformations.normalization.Normalization(**kwargs)[source]

Bases: pyFTS.common.transformations.transformation.Transformation

apply(data, param=None, **kwargs)[source]

Apply the transformation on input data

Parameters
  • data – input data

  • param

  • kwargs

Returns

numpy array with transformed data

inverse(data, param=None, **kwargs)[source]
Parameters
  • data – transformed data

  • param

  • kwargs

Returns

numpy array with inverse transformed data

train(data, **kwargs)[source]

pyFTS.common.transformations.roi module

class pyFTS.common.transformations.roi.ROI(**kwargs)[source]

Bases: pyFTS.common.transformations.transformation.Transformation

Return of Investment (ROI) transformation. Retrieved from Sadaei and Lee (2014) - Multilayer Stock Forecasting Model Using Fuzzy Time Series

y’(t) = ( y(t) - y(t-1) ) / y(t-1) y(t) = ( y(t-1) * y’(t) ) + y(t-1)

apply(data, param=None, **kwargs)[source]

Apply the transformation on input data

Parameters
  • data – input data

  • param

  • kwargs

Returns

numpy array with transformed data

inverse(data, param=None, **kwargs)[source]
Parameters
  • data – transformed data

  • param

  • kwargs

Returns

numpy array with inverse transformed data

pyFTS.common.transformations.scale module

class pyFTS.common.transformations.scale.Scale(min=0, max=1)[source]

Bases: pyFTS.common.transformations.transformation.Transformation

Scale data inside a interval [min, max]

apply(data, param=None, **kwargs)[source]

Apply the transformation on input data

Parameters
  • data – input data

  • param

  • kwargs

Returns

numpy array with transformed data

inverse(data, param, **kwargs)[source]
Parameters
  • data – transformed data

  • param

  • kwargs

Returns

numpy array with inverse transformed data

property parameters

pyFTS.common.transformations.smoothing module

class pyFTS.common.transformations.smoothing.ExponentialSmoothing(**kwargs)[source]

Bases: pyFTS.common.transformations.transformation.Transformation

apply(data, param=None, **kwargs)[source]

Apply the transformation on input data

Parameters
  • data – input data

  • param

  • kwargs

Returns

numpy array with transformed data

inverse(data, param=None, **kwargs)[source]
Parameters
  • data – transformed data

  • param

  • kwargs

Returns

numpy array with inverse transformed data

class pyFTS.common.transformations.smoothing.MovingAverage(**kwargs)[source]

Bases: pyFTS.common.transformations.transformation.Transformation

apply(data, param=None, **kwargs)[source]

Apply the transformation on input data

Parameters
  • data – input data

  • param

  • kwargs

Returns

numpy array with transformed data

inverse(data, param=None, **kwargs)[source]
Parameters
  • data – transformed data

  • param

  • kwargs

Returns

numpy array with inverse transformed data

pyFTS.common.transformations.som module

pyFTS.common.transformations.transformation module

class pyFTS.common.transformations.transformation.Transformation(**kwargs)[source]

Bases: object

Data transformation used on pre and post processing of the FTS

apply(data, param, **kwargs)[source]

Apply the transformation on input data

Parameters
  • data – input data

  • param

  • kwargs

Returns

numpy array with transformed data

inverse(data, param, **kwargs)[source]
Parameters
  • data – transformed data

  • param

  • kwargs

Returns

numpy array with inverse transformed data

is_multivariate

detemine if this transformation can be applied to multivariate data

pyFTS.common.transformations.trend module

class pyFTS.common.transformations.trend.LinearTrend(**kwargs)[source]

Bases: pyFTS.common.transformations.transformation.Transformation

Linear Trend. Estimate

y’(t) = y(t) - (a*t+b) y(t) = y’(t) + (a*t+b)

apply(data, param=None, **kwargs)[source]

Apply the transformation on input data

Parameters
  • data – input data

  • param

  • kwargs

Returns

numpy array with transformed data

data_field

The Pandas Dataframe column to use as data

datetime_mask

The Pandas Dataframe mask for datetime indexes

generate_indexes(data, value, **kwargs)[source]
increment(value, **kwargs)[source]
index_field

The Pandas Dataframe column to use as index

index_type

The type of the time index used to train the regression coefficients. Available types are: field, datetime

inverse(data, param=None, **kwargs)[source]
Parameters
  • data – transformed data

  • param

  • kwargs

Returns

numpy array with inverse transformed data

model

Regression model

train(data, **kwargs)[source]
trend(data)[source]