> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebase.energy/llms.txt
> Use this file to discover all available pages before exploring further.

# How it works

> How energy forecasting works

## General approach

Energy forecasting is about creating mathematical models to predict future
energy supply and demand.

<img src="https://mintcdn.com/rebase/3jX8Yhg5APuNbXPt/images/how-it-works.png?fit=max&auto=format&n=3jX8Yhg5APuNbXPt&q=85&s=acf40cbda36e976a2f595a71ff9fe62c" alt="How it works" width="1372" height="734" data-path="images/how-it-works.png" />

The idea behind forecasting, in general, is to use what we know today to predict what might happen tomorrow.
This knowledge may be based on theoretical understanding (such as calculating the amount of solar radiation incident on a tilted plane)
or on empirical analysis (such as identifying trends and seasonality in data). In practice, forecasting typically involves a combination of these approaches.

For energy forecasting specifically, one of the main sources of uncertainty is often the weather, making weather forecasting highly important.
In other cases, such as behaviour-driven or industrial electricity demand, the best predictor is often the time series itself.
It contains valuable information about how behaviour correlates with specific times of the day, days of the week, or days of the year.

## Input data sources

The input data sources used in the energy forecasting models are:

* Target time series itself
* Weather forecasts
* Other exogenous information

Other exogenous information typically consist of day types (as mentioned previously),
but can also be production plans, planned maintenance and even historical weather measurements.
Find more information about our data APIs [here](/home/data-apis).

## Approaches and frameworks

Any Python framework or code can be used in the Rebase Platform to develop energy forecasting models. Several commonly used frameworks already have pre-implemented energy forecasting models.
Below is a list of frameworks that include an implemented model:

| Model                           | Developer    | Model type                       | Code and docs                                                                                                                                               |
| ------------------------------- | ------------ | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sklearn.LinearRegression`      | Scikit-learn | Linear regression                | [Code](https://github.com/scikit-learn/scikit-learn), [Docs](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html)  |
| `statsmodels.ARIMA`             | Statsmodels  | ARIMA                            | [Code](https://github.com/statsmodels/statsmodels), [Docs](https://www.statsmodels.org/stable/generated/statsmodels.tsa.arima.model.ARIMA.html)             |
| `sklearn.RandomForestRegressor` | Scikit-learn | Random forest regression         | [Code](https://github.com/scikit-learn/scikit-learn), [Docs](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html) |
| `sklearn.RandomForestRegressor` | Scikit-learn | Random forest regression         | [Code](https://github.com/scikit-learn/scikit-learn), [Docs](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html) |
| `LightGBM`                      | Microsoft    | Gradient boosting decision trees | [Code](https://github.com/microsoft/LightGBM), [Docs](https://github.com/microsoft/LightGBM)                                                                |
| `XGBoost`                       | DMLC         | Gradient boosting decision trees | [Code](https://github.com/microsoft/LightGBM), [Docs](https://github.com/microsoft/LightGBM)                                                                |
| `tensorflow`                    | Google       | Neural networks                  | [Code](https://github.com/tensorflow/tensorflow), [Docs](https://www.tensorflow.org/guide)                                                                  |
