ARIMA Exporter Module

class arima.ArimaToPMML(time_series_data, model_obj, results_obj, pmml_file_name)[source]

Bases: object

Write a PMML file using model-object, model-parameters and time series data. Models are built using Statsmodels.

time_series_data: Pandas Series object
The input data
model_obj: statsmodels model object
Instance of ExponentialSmoothing from statsmodels
results_obj: statsmodels trained model object
Instance of HoltWintersResults from statsmodels
pmml_file_name: string
Name of the pmml
ExportToPMML(model_name, arima_obj, ts_data, f_name)[source]

Write the PMML file by aggregating all required data

model_name: string
Name of the model
arima_obj: statsmodels model object
ARIMA model object
ts_data : Pandas Series object
The input data
f_name : string
Pmml file name
get_arima_extension_list(model)[source]

Create Extension for ARIMA object

model: statsmodels model object
Statsmodels model object
extensions : list
A list of Extension object
get_arima_obj(sm_model, sm_results)[source]

Create Arima’s PMML object

sm_model: statsmodels model object
Statsmodels model object
sm_results: statsmodels trained model object
Statsmodels trained model object
nyoka_sarimax_obj : Nyoka PMML44 object
ARIMA object
get_data_field_objs(ts_data)[source]

Create a list with instances of DataField

ts_data: Pandas Series object
The input data
data_field_objs: list
A list of DataField object
get_mining_field_objs(ts_data)[source]

Create a list with instances of MiningField

ts_data : pandas Series
The input data
mining_field_obj : list
A list of MiningField object
get_pmml_datatype_optype(series_obj)[source]

Create dataType and opType for the model object

series_obj: statsmodels model object
Statsmodels model object
pmml_data_type: string
Data type
pmml_op_type: string
Optype
get_sarimax_extension_list(results)[source]

Create Extension for SARIMAX object

results: statsmodels model object
Statsmodels trained model
extensions : list
A list of Extension object
get_sarimax_obj(sm_model, sm_results)[source]

Create SeasonalArima’s PMML object

sm_model: statsmodels model object
Statsmodels model object
sm_results: statsmodels trained model object
Statsmodels trained model object
nyoka_sarimax_obj : Nyoka PMML44 Object
ARIMA object
get_time_series_obj_list(ts_data, usage='original', timeRequired=True)[source]

Create TimeSeries object for time series data

ts_data : pandas Series
The input data
usage : string
usage type (default=”original”)
timeRequired : boolean
(default=True)

Returns: get_time_series_obj_list : list

A list of TimeSeries object