AutomaticTimeSeriesFitAndSave

class hana_ai.tools.hana_ml_tools.automatic_timeseries_tools.AutomaticTimeSeriesFitAndSave(connection_context: ConnectionContext, return_direct: bool = False)

This tool fits a time series model and saves it in the model storage.

Parameters:
connection_contextConnectionContext

Connection context to the HANA database.

Returns:
str

The JSON string of the trained table, model storage name, and model storage version.

Note

args_schema is used to define the schema of the inputs as follows:

Field

Description

fit_table

The table to fit the model. If not provided, ask the user. Do not guess.

fit_schema

The schema of the fit_table, it is optional.

name

The name of the model in model storage. If not provided, ask the user. Do not guess.

version

The version of the model in model storage, it is optional

scorings

The scorings for the model, e.g. {'MAE':-1.0, 'EVAR':1.0} and it supports EVAR, MAE, MAPE, MAX_ERROR, MSE, R2, RMSE, WMAPE, LAYERS, SPEC, TIME, and it is optional

generations

The number of iterations of the pipeline optimization., it is optional

population_size

The number of individuals in the population., it is optional

offspring_size

The number of children to produce at each generation., it is optional

elite_number

The number of the best individuals to select for the next generation., it is optional

min_layer

The minimum number of layers in the pipeline., it is optional

max_layer

The maximum number of layers in the pipeline., it is optional

mutation_rate

The mutation rate., it is optional

crossover_rate

The crossover rate., it is optional

random_seed

The random seed., it is optional

config_dict

The configuration dictionary for the searching space, it is optional

progress_indicator_id

The progress indicator id, it is optional

fold_num

The number of folds for cross validation, it is optional

resampling_method

The resampling method for cross validation from {'rocv', 'block'}, it is optional

max_eval_time_mins

The maximum evaluation time in minutes, it is optional

early_stop

Stop optimization progress when the best pipeline is not updated for the give consecutive generations and 0 means there is no early stop, and it is optional

percentage

The percentage of the data to be used for training, it is optional

gap_num

The number of samples to exclude from the end of each train set before the test set, it is optional

connections

The connections for the model, it is optional

alpha

The rejection probability in connection optimization, it is optional

delta

The minimum improvement in connection optimization, it is optional

top_k_connections

The number of top connections to keep in connection optimization, it is optional

top_k_pipelines

The number of top pipelines to keep in pipeline optimization, it is optional

fine_tune_pipline

Whether to fine tune the pipeline, it is optional

fine_tune_resource

The resource for fine tuning, it is optional

key

The key of the dataset. If not provided, ask the user. Do not guess.

endog

The endog of the dataset. If not provided, ask the user. Do not guess.

exog

The exog of the dataset, it is optional

categorical_variable

The categorical variable of the dataset, it is optional

background_size

The amount of background data in Kernel SHAP. Its value should not exceed the number of rows in the training data, it is optional

background_sampling_seed

The seed for sampling the background data in Kernel SHAP, it is optional

use_explain

Whether to use explain, it is optional

workload_class

The workload class for fitting the model, it is optional

name: str

Name of the tool.

description: str

Description of the tool.

connection_context: ConnectionContext

Connection context to the HANA database.