Forecasting Monthly Expenditures with TimeGPT
Introduction
In this tutorial, we introduce Nixtla’s TimeGPT integration which offers the first foundational model for time series forecasting. Follow along to see how it works.
Prerequisites
MindsDB Setup
Install MindsDB locally via Docker or Docker Desktop.
Creating an ML Engine
You can check the available engines with this command:
If you see the TimeGPT engine on the list, you are ready to follow the tutorials. If you do not see TimeGPT on the list, you will have to create an instance of the engine first with this command:
Notice that the USING
clause is optional, but you must pass an API key eventually (either at model creation, engine creation, model usage, or in the mindsdb configuration file).
Tutorial
Connecting the Data
In this tutorial, we take our the Monthly Expenditures dataset.
We use a table from our MySQL public demo database, so let’s start by connecting MindsDB to it:
Now that we’ve connected our database to MindsDB, let’s query the data to be used in the example:
Here is the output:
Creating a Model
Let’s create a model table to predict the expenditure values:
We add the USING
clause that specifies the ML engine used to make predictions.
We can check the training status with the following query:
Making Predictions
Once the model status is complete
, the behavior is the same as with any other AI table – you can query for batch predictions by joining it with a data table:
Here is the output data:
What’s Next?
Have fun while trying it out yourself!
- Bookmark MindsDB repository on GitHub.
- Install MindsDB locally via Docker or Docker Desktop.
- Engage with the MindsDB community on Slack or GitHub to ask questions and share your ideas and thoughts.
If this tutorial was helpful, please give us a GitHub star here.