---
title: "Training"
description: "Tutorials and steps for training TimeGPT for various forecasting scenarios"
icon: "gear"
---
## Overview
This section provides tutorials about training **TimeGPT** under specific conditions. Learn how to extend predictions across multiple time series and over long horizons with ease.
TimeGPT is designed to handle time series forecasting tasks of varying complexities. The tutorials below will guide you through key strategies for effective training and deployment.
---
## Quick Start: General Training Steps
Below is a concise overview of how to start training with **TimeGPT**.
Ensure your time series data is clean, properly formatted, and includes all necessary features (e.g., timestamps, values, external variables).
Decide whether you need a single series or multi-series approach, and whether you need short or long horizons.
Set up the relevant hyperparameters for your forecasting needs (window size, horizon, seasonalities, etc.).
Train the model on your dataset and evaluate performance with appropriate error metrics (MAPE, RMSE, etc.).
Use performance insights to refine your model, then deploy it in a production environment.
---
## Tutorials
Learn how to make predictions beyond two seasonal periods or further into the future using the specialized long-horizon forecasting model of **TimeGPT**.
For forecasting horizons that exceed two seasonal periods, you may need additional computational resources and careful hyperparameter tuning.
Discover the steps to train and optimize TimeGPT’s long-horizon capabilities.
Learn how to forecast multiple time series simultaneously using **TimeGPT**.
Forecasting multiple time series can help you leverage shared patterns and reduce overall computational overhead.
Forecast numerous time series at once, streamlining your workflow for complex projects.
---
## Example Training Code
Below is a simplified example of how you might train **TimeGPT** in Python. Adjust hyperparameters as needed for your specific use case.
```python Example: Training TimeGPT Multi-Series
# Example: Training TimeGPT for a multi-series scenario
import timegpt
# Load your dataset
data = timegpt.load_data("my_dataset.csv")
# Initialize the model
model = timegpt.TimeGPT(
horizon=30, # Forecast horizon
max_epochs=50, # Number of training epochs
seasonality=24, # Seasonal period
learning_rate=1e-3
)
# Train the model
model.fit(data)
# Generate predictions
predictions = model.predict(data)
# Evaluate results
error = model.evaluate(predictions, data)
print(f"Forecast error: {error:.2f}")
```
---
Congratulations\! You now have an overview of how to set up and train TimeGPT for both single and multiple series forecasting as well as for long-horizon use cases.