Timeseries Forecast
Last updated
Last updated
A Timeseries Forecast Model is designed to predict future values by analyzing historical time-related data. To utilize this model, your dataset must include both time-based and numerical columns. In this tutorial, we'll cover the fundamentals of the Model Scenario to help you achieve optimal results. Within the Model Scenario, you'll select parameters related to your dataset and the model itself.
For the Target Column, select a numeric value you want to predict. It's crucial to have values by day, week, or year. If some dates are repeated, you can aggregate them by taking their sum, average, etc.
Next, choose a Sequence Identifier Field to group certain fields and generate an independent forecast for each time series. These values shouldn't be unique; they must form a series.
Then, select the Time/Date Column, specifying the column containing time-related values. The Time Interval represents the data frequency—choose daily for daily data, yearly for annual data, etc. With Forecast Horizon, decide how many days, weeks, or years you want to predict from the last date in your dataset.
The model performs well with seasonal data patterns. If your data shows a linear growth trend, select "additive" for Seasonality Mode; for exponential growth, select "multiplicative." For example, if you see annual patterns, set Yearly Seasonality to True. (TIP: Plotting your data beforehand can help you understand these patterns.) If you're unsure, the model will attempt to detect seasonality automatically.
For daily or hourly intervals, you can access Advanced Parameters to add special dates, weekends, holidays, or limit the target value.
We are constantly enhancing our platform with new features and improving existing models. For your daily data, we've introduced some new capabilities that can significantly boost forecast accuracy. Now, you can limit your target predictions, remove outliers, and include country holidays and special events.
To set prediction limits, enter the minimum and maximum values for your target variable. For example, if you're predicting daily temperatures and know the maximum is 40°C, enter that value to prevent the model from predicting higher temperatures. This helps the model recognize the appropriate range of the Target Column. Additionally, you can use the Remove Days of the Week feature to exclude certain days from your predictions.
We added parameters for country holidays and special dates to improve model accuracy. Large deviations can occur around holidays, where stores see more customers than usual. By informing the model about these holidays, you can achieve more balanced and accurate predictions. To add holidays in Graphite Note, navigate to the advanced section of the Model Scenario and select the relevant country or countries.
Similarly, you can add promotions or events that affect your data. Enter the promotion name, start date, duration, and future dates. This ensures the model accounts for these events in future predictions.
Combining these parameters provides more accurate results. The more information the model receives, the better the predictions.
In addition to adding holidays and special events, you can delete specific data points from your dataset. In Graphite Note, enter the start and end dates of the period you want to remove. For single-day periods, enter the same start and end date. You can remove multiple periods if necessary. Understanding your data and identifying outliers or irrelevant periods is crucial for accurate predictions. Removing these dates can help eliminate biases and improve model accuracy.
By following these steps, you can harness the full potential of your Timeseries Forecast Model, providing valuable insights and more accurate predictions for your business. Now it's your turn to do some modeling and explore your results!
After setting all parameters it is time to Run Scenario and train Machine Learning model.
After running your model, review your results. The Model Performance section provides visual and numerical summaries of key metrics. You'll see values for four evaluation metrics, crucial for assessing your machine learning algorithm's performance.
R-squared determines the proportion of variance in the dependent variable that can be explained by the independent variable. MAPE (Mean absolute percentage error), MAE (Mean absolute error) and RMSE (Root mean squared error) are measures that describe the average difference between the actual and predicted value.
The results are organized into five tabs: Model Fit, Trend, Seasonality, Special Dates, and Details.
The Model Fit Tab features a graph displaying actual and predicted values. Besides the primary target value prediction (yellow line), the model shows a range of values, known as the uncertainty interval (yellow shaded area). This visualization helps you gauge your model's performance.
If you used the Sequence Identifier Field, you can choose which value to analyze in each Model Result.
Trends and seasonality are key characteristics of time-series data that should be analyzed. The Trend Tab displays a graph illustrating the global trend that Graphite Note has detected from your historical data.
Seasonality represents the repeating patterns or cycles of behavior over time. Depending on your Time Interval, you can find one or two graphs in the Seasonality Tab. For daily data, one graph shows weekly patterns, while the other shows yearly patterns. For weekly and monthly data, the graph highlights recurring patterns throughout the year.
The Special Dates graph shows the percentage effects of the special dates and holidays in historical and future data:
The Details Tab contains a comprehensive table with all the values related to the Model Fit Tab, along with additional information.
Once your model is trained zou can use to fullfill its real function and that is predicting future values for Target column and trend. Use Predict tab to set up Star date and End date for time interval for which prediction will be calculated.
after trigering predict button table with prediction results and trends will become available. Prediction results will have the same frequency as trained model. (for example if model is trained on daily data predictions will be calculated for every day in prediction interval, if model is trained monthly, predictions will be created for every month)
Beside predict option where you can mannualz enter prediction parameters in case of timeseries Start end End tade Graphite Note offers API connection that can be used as a two-way communication between Graphite Note model third party external applications. You can use the API to programmatically make predictions by passing data to a model and retrieve the prediction results in real time. Details on how to use API you can find in the REST API section.
To interact with the Graphite Note API and perform predictions, you need to make a POST request to the API endpoint. On the API tab zou will find generated code snippet containing request that needs to be sent using cURL.
The request requires the Authorization header to be included. This header should be set to "Bearer [token]
". You will replace[token]
with your unique token that can be found by accessing the account info page in the Graphite Note app, under the section displaying your current plan information.
Once your prediction model is prepared and you are using it to predict future outcome of Timeseries you can enable end users to run their own predictions with Notebook feature. Notebook is used to easaly and intuitively do your own Data Storytelling; create various visualization with detailed descriptions, plot model results for better understanding and enable users to make their own predictions. More about notebooks you can find in Notebooks - Data Storytelling section
Click on New Notebook button to open New notebook creation vizard. Choose neotebook name, description, and attributes and click Create.
You can use notebook as single place to represent any of the following data:
Text with descriptions and writen insights about data
New visualization - you can choose between different visualisations to show data from zour dataset (such as barchart, linechart,
MODEL RESULT - you can present model results containing predictions based on data feed to model throug Predict tab or API.
MODEL ACTIONABLE INSIGHT - zou can present recomended actionable insight prepared by Gen Ai.
In our case we want to expose predct option to final user similar as it is available on Predict tab. Select Model result option and you will be guided to Model result visualization creator.
Choose model you want to use and you will be guided to next step where zou will choose model result you want to include into notebook.
Choose Predict as tab you would like to include into notebook. Predict tab enables users to make their own prediction interval selections and generate predictions based on model.
Once Notebook options are saved you will get Notebook frontend screen. You can always expand zour notebook with additional text, visualisations and model results.
You can share notebook to other users by copying URL link