Comprehensive Time-Series Analysis Tool
Description: This Python package is designed to offer robust tools for the analysis and visualization of time-series data, focusing on the comparison of actual versus forecasted outcomes across various dimensions such as Safety and Security, Personal Freedom, and Governance. It includes three primary scripts:
-
arima_model.py
- Purpose: Fits ARIMA models to time-series data to make predictions and visualize the forecasted results.
- Key Features: Supports customization of ARIMA parameters, graphical representation of forecasts vs. actual data, and insights into potential future trends.
-
error_metrics.py
- Purpose: Computes standard error metrics to assess forecast accuracy.
- Metrics Included: Mean Squared Error (MSE), Mean Absolute Error (MAE), and Root Mean Squared Error (RMSE).
- Output: Outputs both console-based results and a CSV file with detailed metrics for further analysis.
-
plot.py
- Purpose: An interactive Dash application for dynamic visualization of time-series data.
- Functionality: Allows users to explore data trends visually across different countries and categories over time through an interactive web-based dashboard.
Installation:
Prerequisites:
- Python 3.x: Install from python.org.
Steps:
- Clone the repository or download the package to your local machine.
- Navigate to the package directory.
- Install the necessary dependencies using pip: pip install dash pandas plotly sklearn numpy
- Update the file paths in the scripts (arima_model.py, error_metrics.py, plot.py) to point to your data directories or specific files.
Execution:
Running ARIMA Model Script (arima_model.py):
- Place your dataset in the designated directory or update the dataset path in the script.
- To execute, run: python3 arima_model.py
- Outputs will include a graphical display of the ARIMA model predictions and actual data, saved to a file or displayed on screen.
Calculating Error Metrics (error_metrics.py):
- Verify that the dataset path in the script matches where your data is stored.
- Execute the script with: python3 error_metrics.py
- Error metrics will be printed to the console, and a CSV file with detailed results will be saved in the specified output directory.
Data Visualization with Dash (plot.py):
- Confirm that the script is located in the correct directory to access the necessary data files.
- Run the script using: python3 plot.py
- Open a web browser and navigate to http://127.0.0.1:8050/ to interact with the dynamic visualization dashboard.