Statsmodels Exporter Module

class StatsmodelsToPmml(results_obj=None, pmml_file_name='from_statsmodels.pmml', conf_int=None, model_name=None, description=None)[source]

Bases: object

Exports time-series models from statsmodels library into PMML.

Instance of AR(I)MAResultsWrapper / (SARI/VAR)MAXResultsWrapper from statsmodels
pmml_file_name: string
Name of the PMML
conf_int : list (optional)
Confidence intervel. A list of values mentioning the percentage of confidence. e.g., conf_int = [80,95] will create OutputField for lower bound and upper bound of confidence interval with 80% and 95%.
model_name : string (optional)
Name of the model
description : string (optional)
Description of the model
Return type:Generates PMML object and exports it to pmml_file_name
def construct_pmml()[source]

Constructs the actual model object. (ARIMA/ TimeSeriesModel)

def export_pmml()[source]

Writes the generated PMML object to given pmml_file_name

def generate_arima_model()[source]

Constructs ARIMA object. Only for statsmodels.tsa.arima_model.ARIMA class.

def generate_data_dictionary()[source]

Generates DataDictionary Object. The number of DataField is one more than the dimension of the data. The extra DataField is a supplementary to hold the value of `h`(horizon) for forecasting.

def generate_mining_schema()[source]

Generates MiningSchema object.

def generate_output()[source]

Generates Output object. If user provides value in conf_int parameter, then there will be two OuputField for each value. One with feature=confidenceIntervalLower and another with feature=confidenceIntervalUpper.

def generate_state_space_model()[source]

Constructs StateSpaceModel object. For the following models - - statsmodels.tsa.statespace.sarimax.SARIMAX - statsmodels.tsa.statespace.varmax.VARMAX - statsmodels.tsa.statespace.tsa.arima.ARIMA

def generate_time_series()[source]

Generates TimeSeries object. The number of TimeSeries object is equal to the dimeansion of the data.

def generate_time_value_object(data)[source]

Generates TimeValue object. If data has any index, then the index will be in TimeStamp object.