Skip to content

nchu-machine-learning/Taiwan-Traffic-Safety-Forecast-System

Repository files navigation

Introduction

The purpose of the system

  • To implement a forecasting system that allows you to choose the models you want to make predictions

Components of the repo

  1. Frontend Vue
  2. Backend Flask: for testing, templates\form.html is provided.
  3. Python notebooks: also for testing, training models, or running experiments.

Running the server

  • main.py: main.py contains the flask code is placed
  • Activate the virtual environment containing all the dependencies. In the command, type
python main.py

for Linux users, type

python3 main.py

in the command

Running the Experiment

To explore the experiment setup, navigate to the experiment directory:

  • E_2.ipynb: Use this notebook for training models. It demonstrates how to prepare data, configure parameters, and run the training process.
  • E_3.ipynb: Use this notebook for application development. It provides an example of how to call the prediction functions from your chosen models and visualize or utilize the results.

Before running these notebooks, ensure that the following directories exist in the project’s root:

  • figure
  • output

Make sure to activate the appropriate virtual environment and then run the desired notebook.


Installation

To install all required dependencies, execute:

pip install -r requirements.txt