CREATE ML_ENGINE
statement and providing the TimeGPT API key:
CREATE MODEL
statement to create the TimeGPT model in MindsDB.
USING
clause at the end, which defines the engine
and lists all parameters used with time-series models, including OREDER BY
, GROUP BY
, HORIZON
.
What’s different about the TimeGPT engine is that it does not expose the WINDOW
parameter in its API, so as a user you need to send a payload with at least N rows, where N depends on the model and the frequency of the series. This is automatically handled by MindsDB in the TimeGPT handler code.
CREATE MODEL
statement to create, train, and deploy a model. The FROM
clause defines the training data used to train the model - here, the latest Binance data is used. The PREDICT
clause specifies the column to be predicted - here, the open price of the BTC/USDT trading pair is to be forecasted.
As it is a time-series model, you should order the data by a date column - here, it is the open time when the open price takes effect. Finally, the HORIZON
clause defines how many rows into the future the model will forecast - here, it forecasts the next 10 rows (the next 10 minutes, as the interval between Binance data rows is one minute).
complete
.