def fit(self, input_relation: Union[(vDataFrame, str)], X: list, ts: str, test_relation: Union[(vDataFrame, str)]=''):
    '\n    ---------------------------------------------------------------------------\n    Trains the model.\n\n    Parameters\n    ----------\n    input_relation: str/vDataFrame\n        Training relation.\n    X: list\n        List of the response columns.\n    ts: str\n        vcolumn used to order the data.\n    test_relation: str/vDataFrame, optional\n        Relation used to test the model.\n\n    Returns\n    -------\n    object\n        self\n        '
    check_types([('input_relation', input_relation, [str, vDataFrame]), ('X', X, [list]), ('ts', ts, [str]), ('test_relation', test_relation, [str, vDataFrame])])
    self.cursor = check_cursor(self.cursor, input_relation, True)[0]
    does_model_exist(name=self.name, cursor=self.cursor, raise_error=True)
    self.input_relation = (input_relation if isinstance(input_relation, str) else input_relation.__genSQL__())
    if isinstance(test_relation, vDataFrame):
        self.test_relation = test_relation.__genSQL__()
    elif test_relation:
        self.test_relation = test_relation
    else:
        self.test_relation = self.input_relation
    (self.ts, self.deploy_predict_) = (str_column(ts), [])
    (self.X, schema) = ([str_column(elem) for elem in X], schema_relation(self.name)[0])
    model = LinearRegression(name=self.name, solver=self.parameters['solver'], max_iter=self.parameters['max_iter'], tol=self.parameters['tol'])
    (columns, AR) = ([], [])
    for (idx, elem) in enumerate(self.X):
        for i in range(1, (self.parameters['p'] + 1)):
            columns += ['LAG([X{}], {}) OVER (ORDER BY [VerticaPy_ts]) AS AR{}_{}'.format(idx, i, idx, i)]
            AR += ['AR{}_{}'.format(idx, i)]
    self.transform_relation = '(SELECT *, {} FROM {}) VERTICAPY_SUBTABLE'.format(', '.join(columns), '{}')
    relation = self.transform_relation.replace('[VerticaPy_ts]', self.ts).format(self.input_relation)
    for (idx, elem) in enumerate(self.X):
        relation = relation.replace('[X{}]'.format(idx), elem)

    def drop_temp_elem(self, schema):
        try:
            with warnings.catch_warnings(record=True) as w:
                drop('{}.VERTICAPY_TEMP_MODEL_LINEAR_REGRESSION_VIEW_{}'.format(schema, get_session(self.cursor)), cursor=self.cursor, method='view')
        except:
            pass
    drop_temp_elem(self, schema)
    try:
        query = 'CREATE VIEW {}.VERTICAPY_TEMP_MODEL_LINEAR_REGRESSION_VIEW_{} AS SELECT * FROM {}'.format(schema, get_session(self.cursor), relation)
        self.cursor.execute(query)
        self.coef_ = []
        for elem in X:
            model.fit(input_relation='{}.VERTICAPY_TEMP_MODEL_LINEAR_REGRESSION_VIEW_{}'.format(schema, get_session(self.cursor)), X=AR, y=elem)
            self.coef_ += [model.coef_]
            model.drop()
    except:
        drop_temp_elem(self, schema)
        raise
    drop_temp_elem(self, schema)
    model_save = {'type': 'VAR', 'input_relation': self.input_relation, 'test_relation': self.test_relation, 'transform_relation': self.transform_relation, 'deploy_predict': self.deploy_predict_, 'X': self.X, 'ts': self.ts, 'p': self.parameters['p'], 'tol': self.parameters['tol'], 'max_iter': self.parameters['max_iter'], 'solver': self.parameters['solver']}
    for (idx, elem) in enumerate(self.coef_):
        model_save['coef_{}'.format(idx)] = elem.values
    insert_verticapy_schema(model_name=self.name, model_type='VAR', model_save=model_save, cursor=self.cursor)
    return self
---------------------------------------------------------------------------
Trains the model.

Parameters
----------
input_relation: str/vDataFrame
    Training relation.
X: list
    List of the response columns.
ts: str
    vcolumn used to order the data.
test_relation: str/vDataFrame, optional
    Relation used to test the model.

Returns
-------
object
    self
def fit(self, input_relation: Union[(vDataFrame, str)], X: list, ts: str, test_relation: Union[(vDataFrame, str)]=):
    '\n    ---------------------------------------------------------------------------\n    Trains the model.\n\n    Parameters\n    ----------\n    input_relation: str/vDataFrame\n        Training relation.\n    X: list\n        List of the response columns.\n    ts: str\n        vcolumn used to order the data.\n    test_relation: str/vDataFrame, optional\n        Relation used to test the model.\n\n    Returns\n    -------\n    object\n        self\n        '
    check_types([('input_relation', input_relation, [str, vDataFrame]), ('X', X, [list]), ('ts', ts, [str]), ('test_relation', test_relation, [str, vDataFrame])])
    self.cursor = check_cursor(self.cursor, input_relation, True)[0]
    does_model_exist(name=self.name, cursor=self.cursor, raise_error=True)
    self.input_relation = (input_relation if isinstance(input_relation, str) else input_relation.__genSQL__())
    if isinstance(test_relation, vDataFrame):
        self.test_relation = test_relation.__genSQL__()
    elif test_relation:
        self.test_relation = test_relation
    else:
        self.test_relation = self.input_relation
    (self.ts, self.deploy_predict_) = (str_column(ts), [])
    (self.X, schema) = ([str_column(elem) for elem in X], schema_relation(self.name)[0])
    model = LinearRegression(name=self.name, solver=self.parameters['solver'], max_iter=self.parameters['max_iter'], tol=self.parameters['tol'])
    (columns, AR) = ([], [])
    for (idx, elem) in enumerate(self.X):
        for i in range(1, (self.parameters['p'] + 1)):
            columns += ['LAG([X{}], {}) OVER (ORDER BY [VerticaPy_ts]) AS AR{}_{}'.format(idx, i, idx, i)]
            AR += ['AR{}_{}'.format(idx, i)]
    self.transform_relation = '(SELECT *, {} FROM {}) VERTICAPY_SUBTABLE'.format(', '.join(columns), '{}')
    relation = self.transform_relation.replace('[VerticaPy_ts]', self.ts).format(self.input_relation)
    for (idx, elem) in enumerate(self.X):
        relation = relation.replace('[X{}]'.format(idx), elem)

    def drop_temp_elem(self, schema):
        try:
            with warnings.catch_warnings(record=True) as w:
                drop('{}.VERTICAPY_TEMP_MODEL_LINEAR_REGRESSION_VIEW_{}'.format(schema, get_session(self.cursor)), cursor=self.cursor, method='view')
        except:
            pass
    drop_temp_elem(self, schema)
    try:
        query = 'CREATE VIEW {}.VERTICAPY_TEMP_MODEL_LINEAR_REGRESSION_VIEW_{} AS SELECT * FROM {}'.format(schema, get_session(self.cursor), relation)
        self.cursor.execute(query)
        self.coef_ = []
        for elem in X:
            model.fit(input_relation='{}.VERTICAPY_TEMP_MODEL_LINEAR_REGRESSION_VIEW_{}'.format(schema, get_session(self.cursor)), X=AR, y=elem)
            self.coef_ += [model.coef_]
            model.drop()
    except:
        drop_temp_elem(self, schema)
        raise
    drop_temp_elem(self, schema)
    model_save = {'type': 'VAR', 'input_relation': self.input_relation, 'test_relation': self.test_relation, 'transform_relation': self.transform_relation, 'deploy_predict': self.deploy_predict_, 'X': self.X, 'ts': self.ts, 'p': self.parameters['p'], 'tol': self.parameters['tol'], 'max_iter': self.parameters['max_iter'], 'solver': self.parameters['solver']}
    for (idx, elem) in enumerate(self.coef_):
        model_save['coef_{}'.format(idx)] = elem.values
    insert_verticapy_schema(model_name=self.name, model_type='VAR', model_save=model_save, cursor=self.cursor)
    return self