# <span style="background-color:#4b8021;color:white">Time series forecasting</span> 
This flow zone is dedicated to convert the electricity consumption into co2 emissions.
![time_series_forecasting_zone.png](v7WZqBk2c3tv)
The [Time series forecasting](flow_zone:Xett5ef) zone is where we train a time series forecasting model using visual time series feature of Dataiku. You can have more information about time series forecasting in Dataiku with [this tutorial on the knowledge base](https://knowledge.dataiku.com/latest/ml-analytics/time-series/tutorial-forecasting-visual-ml.html).

 **Filtering:** 
The first step of this flow zone is to filter the electricity consumption dataset on the mains meters of the 3 factories: process_main, main_a, and factory_main. The prediction is made at a site level, but it could be done at the meters level or workshops level.
![meters_distribution.png](Xei6qTOLKMHc)

 **Joining:** 
The data is joined with a weekly production history used as an external feature for forecasting. Using an external feature helps the model to decompose the input signal. 

 **Resampling:** 
Used to interpolate data to align time series on a fixed sampling rate.

 **Forecasting:** 
Several time series forecasting models have been trained on the prepared data, and the best performing has been deployed to the flow. 
![model_comparison.png](rQcoP4QQBVlB)

To compare the models' performance, you need to retrain them. You can launch it from the [time series modeling of electricity consumption analysis](analysis:kWR0UpFo)