autots.templates package¶
Submodules¶
autots.templates.general module¶
Starting templates for models.
- autots.templates.general.general_template = Model ... Ensemble 1 ARIMA ... 0 3 AverageValueNaive ... 0 4 AverageValueNaive ... 0 5 AverageValueNaive ... 0 6 DatepartRegression ... 0 .. ... ... ... 84 Theta ... 0 85 MultivariateRegression ... 0 86 SeasonalityMotif ... 0 87 TVVAR ... 0 88 TVVAR ... 0 [87 rows x 4 columns]¶
# Basic Template Construction Code # transformer_max_depth = 6 and transformer_list = “fast” from autots.evaluator.auto_model import unpack_ensemble_models max_per_model_class = 1 export_template = model.validation_results.model_results export_template = export_template[
export_template[‘Runs’] >= (model.num_validations + 1)
] export_template = (
export_template.sort_values(‘Score’, ascending=True) .groupby(‘Model’) .head(max_per_model_class) .reset_index()
) import json export2 = unpack_ensemble_models(model.best_model, keep_ensemble=False, recursive=True) export_final = pd.concat([export_template, export2]) export_final = export_final[export_final[‘Ensemble’] < 1] export_final[[“Model”, “ModelParameters”, “TransformationParameters”, “Ensemble”]].reset_index(drop=True).to_json(orient=’index’)
import pprint import json
imported = pd.read_csv(“autots_forecast_template_gen.csv”) export = unpack_ensemble_models(imported, keep_ensemble=False, recursive=True) export[export[‘Ensemble’] < 1].to_json(“template.json”, orient=”records”) with open(“template.json”, “r”) as jsn:
json_temp = json.loads(jsn.read())
print(json_temp) with open(“template.txt”, “w”) as txt:
txt.write(json.dumps(json_temp, indent=4, sort_keys=False))
Module contents¶
Model Templates