verticapy.machine_learning.vertica.tsa.ensemble.TimeSeriesByCategory.fit¶
- TimeSeriesByCategory.fit(input_relation: Annotated[str | vDataFrame, ''], ts: str, y: str, by: str, test_relation: Annotated[str | vDataFrame, ''] = '', return_report: bool = False) str | None¶
Trains the model.
Parameters¶
- input_relation: SQLRelation
Training relation.
- ts: str
TS (Time Series) :py:class`vDataColumn` used to order the data. The :py:class`vDataColumn` type must be
date(date,datetime,timestamp…) or numerical.- y: str
Response column.
- by: str
Column used to represent the different categories. The number of categories will define the number of models. The
bycolumn must not have more than 50 categories.- test_relation: SQLRelation, optional
Relation used to test the model.
- return_report: bool, optional
[For native models] When set to
True, the model summary will be returned. Otherwise, it will be printed. In case ofTimeSeriesByCategory, the report of all the models for each category are merged together.
Returns¶
- str
model’s summary.
Examples¶
This model is built based on multiple base models. You should look at the source models to see entire examples.