---
title: "Forecast"
description: "Advanced zero-shot forecasting capabilities for time series data"
icon: "chart-line"
---

<Info>
  TimeGPT offers advanced zero-shot forecasting capabilities for a wide range of
  time series domains, thanks to its large-scale and diverse pretraining.
</Info>

<AccordionGroup>
  <Accordion title="Overview">
    This section provides an overview of forecasting features available in TimeGPT. You can leverage TimeGPT for:

    - Zero-shot forecasting
    - Forecasting with exogenous variables
    - Manipulating holidays and special dates
    - Incorporating categorical variables
    - Long-horizon forecasting
    - Forecasting multiple series
    - Fine-tuning TimeGPT
    - Working with specific loss functions
    - Cross-validation
    - Adding prediction intervals
    - Handling irregular timestamps

    These capabilities allow teams to handle real-world scenarios across different industries and problem domains.

  </Accordion>
  <Accordion title="When to Use TimeGPT for Forecasting">
    TimeGPT is a powerful choice when you need:

    - Rapid iteration without explicit training on your own datasets.
    - A flexible model that generalizes well across different time series scenarios.
    - Support for additional context or features like holidays, external events, or categorical data.

  </Accordion>
</AccordionGroup>

<CardGroup cols={2}>
  <Card title="Key Feature: Zero-Shot Forecasting">
    Zero-shot forecasting lets you generate predictions without having to train
    a new model from scratch on your data. This can significantly reduce your
    time to production for new or changing forecasting tasks.
  </Card>
  <Card title="Key Feature: Fine-Tuning">
    Gain performance boosts by fine-tuning TimeGPT on your own dataset or by
    leveraging specific loss functions. This approach helps tailor the model to
    your unique forecasting requirements.
  </Card>
</CardGroup>

<Check>
  By combining zero-shot approaches with optional fine-tuning, TimeGPT offers a
  robust and efficient solution for time series forecasting.
</Check>

<Steps>
  <Step title="1. Zero-Shot Forecasting">
    Zero-shot forecasting is an excellent starting point for quick insights.

    For detailed instructions, see: [Zero-shot forecasting documentation](https://docs.nixtla.io/docs/capabilities-forecast-quickstart).

  </Step>
  <Step title="2. Add Exogenous Variables">
    If you have additional external drivers or explanatory factors, include them to improve predictions.

    For more details, visit: [Forecasting with exogenous variables](https://docs.nixtla.io/docs/capabilities-forecast-add_exogenous_variables).

  </Step>
  <Step title="3. Incorporate Holidays or Special Dates">
    Holidays and special dates can have significant impact on time series signals.

    Learn how to handle them here: [Forecasting with holidays and special dates](https://docs.nixtla.io/docs/capabilities-forecast-add_holidays_and_special_dates).

  </Step>
</Steps>

<Tabs>
  <Tab title="More Forecasting Tasks">
    <AccordionGroup>
      <Accordion title="Forecasting with Categorical Variables">
        Explore how to add categorical information and improve your forecasts:
        [Forecasting with categorical
        variables](https://docs.nixtla.io/docs/capabilities-forecast-add_categorical_variables).
      </Accordion>
      <Accordion title="Long-Horizon Forecasting">
        Learn best practices for forecasting extended time periods well into the
        future: [Long-horizon
        forecasting](https://docs.nixtla.io/docs/capabilities-forecast-long_horizon_forecasting).
      </Accordion>
      <Accordion title="Forecasting Multiple Series">
        Handle multiple time series simultaneously to build scalable and
        efficient solutions: [Forecasting multiple
        series](https://docs.nixtla.io/docs/capabilities-forecast-multiple_series_forecasting).
      </Accordion>
    </AccordionGroup>
  </Tab>
  <Tab title="Fine-Tuning & Advanced Topics">
    <AccordionGroup>
      <Accordion title="Fine-Tuning TimeGPT">
        Adapt TimeGPT to your specific domain or data distribution: [Fine-tuning
        TimeGPT](https://docs.nixtla.io/docs/capabilities-forecast-fine_tuning).
      </Accordion>
      <Accordion title="Custom Loss Functions">
        Go beyond default metrics by defining custom loss functions:
        [Fine-tuning with a specific loss
        function](https://docs.nixtla.io/docs/capabilities-forecast-finetuning_with_a_custom_loss_function).
      </Accordion>
      <Accordion title="Cross-Validation">
        Ensure robust forecasting performance through cross-validation:
        [Cross-validation](https://docs.nixtla.io/docs/capabilities-forecast-cross_validation).
      </Accordion>
      <Accordion title="Prediction Intervals">
        Build prediction intervals to quantify uncertainty in your forecasts:
        [Adding prediction
        intervals](https://docs.nixtla.io/docs/capabilities-forecast-predictions_intervals).
      </Accordion>
      <Accordion title="Irregular Timestamps">
        Discover approaches to deal with missing or irregular time steps:
        [Handling irregular
        timestamps](https://docs.nixtla.io/docs/capabilities-forecast-irregular_timestamps).
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>

<Info>
  Below is a concise code snippet to get started with zero-shot forecasting.
  This example demonstrates how to import TimeGPT and make a simple prediction.
</Info>

<CodeGroup>

```python Zero-Shot Forecasting Example
# Example: Zero-shot forecasting with TimeGPT
from timegpt import TimeGPT

# Initialize TimeGPT
gpt_model = TimeGPT()

# Sample time series data (replace with your own)
time_series_data = [10, 12, 13, 12, 15, 18, 20]

# Make a forecast
forecast = gpt_model.forecast(time_series_data, horizon=3)
print("Forecast:", forecast)
```

</CodeGroup>

<Check>
  Congratulations\! You are now equipped with TimeGPT's key forecasting
  features. Explore the linked guides for detailed instructions on advanced
  topics.
</Check>
