> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.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.

![How it works](https://mintlify.s3-us-west-1.amazonaws.com/test-b2d4feb0/images/how-it-works.png)

The idea behind forecasting in general is making use of what we know today to
predict what might happen tomorrow. This knowledge might be based a theoretical
understanding (such as calculating how much solar radiation is incident on a tilted
plane) or more empirical (such as finding trends and seasonality in data). In
reality, forecasting is usually done with a blend of these approaches.

For energy forecasting specifically, one of the main uncertain factors is
in many cases the weather, which is why weather forecasting becomes of high
importance. In other cases, such as for behaviour-driven or industrial
electricity demand, the best predictor is the time series itself that is
forecasted. It contains information regarding how behaviour is correlated
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 and code can be used in the Rebase Platform to develop an energy
forecast models. Several of the more common frameowrks already have pre-implemented energy
forecasting models. Below is a list of frameworks that have 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)                                                                  |
