time_series_transform.sklearn package

Submodules

time_series_transform.sklearn.metrics module

time_series_transform.sklearn.transformer module

class time_series_transform.sklearn.transformer.Base_Stock_Time_Series_Transform(time_col, category_col=None, len_preprocessing='ignore', remove_time=True, remove_category=True, remove_org_data=True, cache_data_path=None, High='High', Low='Low', Close='Close', Open='Open', Volume='Volume')[source]

Bases: time_series_transform.sklearn.transformer.Base_Time_Series_Transformer

transform(X, y=None)[source]

transform prepare data as Stock_Transformer and helper data

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

  • tst Stock_Transformer – the output Stock_Transformer

  • X_time list – time column list

  • X_header list – column name list

  • X_category list – category name list

class time_series_transform.sklearn.transformer.Base_Time_Series_Transformer(time_col, category_col=None, len_preprocessing='ignore', remove_time=True, remove_category=True, remove_org_data=True, cache_data_path=None)[source]

Bases: sklearn.base.BaseEstimator, sklearn.base.TransformerMixin

fit(X, y=None)[source]

fit train model

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

Return type

self

get_time_series_index_cache()[source]

get_time_series_index_cache the fitted time series index help to see when is the latest timestamp of the model

Returns

cached time series index

Return type

list

transform(X, y=None)[source]

transform prepare the data as Time_Series_Transformer and other helper data

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

  • tst Time_Series_Transformer – the output Time_Series_Transformer

  • X_time list – time column list

  • X_header list – column name list

  • X_category list – category name list

class time_series_transform.sklearn.transformer.Function_Transformer(func, inputLabels, time_col, category_col=None, remove_time=True, remove_category=True, remove_org_data=True, cache_data_path=None, parameterDict={})[source]

Bases: time_series_transform.sklearn.transformer.Base_Time_Series_Transformer

fit(X, y=None)[source]

fit train model

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

Return type

self

transform(X, y=None)[source]

transform transforming data

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

transformed data

Return type

numpy ndArray

class time_series_transform.sklearn.transformer.Lag_Transformer(lag_nums, time_col, category_col=None, remove_time=True, remove_category=True, remove_org_data=True, cache_data_path=None)[source]

Bases: time_series_transform.sklearn.transformer.Base_Time_Series_Transformer

fit(X, y=None)[source]

fit train model

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

Return type

self

transform(X, y=None)[source]

transform transforming lag data

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

transformed data

Return type

numpy ndArray

class time_series_transform.sklearn.transformer.Stock_Technical_Indicator_Transformer(strategy, time_col, symbol_col=None, remove_time=True, remove_category=True, remove_org_data=True, cache_data_path=None, High='High', Low='Low', Close='Close', Open='Open', Volume='Volume', n_jobs=1, verbose=0, backend='loky')[source]

Bases: time_series_transform.sklearn.transformer.Base_Stock_Time_Series_Transform

fit(X, y=None)[source]

fit train model

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

Return type

self

transform(X, y=None)[source]

transform transforming data according to the strategy

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

transformed data

Return type

numpy ndArray

Module contents

class time_series_transform.sklearn.Lag_Transformer(lag_nums, time_col, category_col=None, remove_time=True, remove_category=True, remove_org_data=True, cache_data_path=None)[source]

Bases: time_series_transform.sklearn.transformer.Base_Time_Series_Transformer

fit(X, y=None)[source]

fit train model

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

Return type

self

transform(X, y=None)[source]

transform transforming lag data

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

transformed data

Return type

numpy ndArray

class time_series_transform.sklearn.Stock_Technical_Indicator_Transformer(strategy, time_col, symbol_col=None, remove_time=True, remove_category=True, remove_org_data=True, cache_data_path=None, High='High', Low='Low', Close='Close', Open='Open', Volume='Volume', n_jobs=1, verbose=0, backend='loky')[source]

Bases: time_series_transform.sklearn.transformer.Base_Stock_Time_Series_Transform

fit(X, y=None)[source]

fit train model

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

Return type

self

transform(X, y=None)[source]

transform transforming data according to the strategy

Parameters
  • X (pandas DataFrame or numpy ndArray) – input values

  • y (depreciated not used, optional) – following sklearn convention (not used), by default None

Returns

transformed data

Return type

numpy ndArray