Skip to content

Hi-kue/syncgraph-309

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

SyncGraph 309

Table of Contents

About this Project

SyncGraph 309 is a project that leverages OpenRouter, OpenAI, Streamlit, and various ML techniques with Sklearn to create predictive models from datasets that can be found within the Toronto Police Service's Public Data Portal

Installation & Usage

Prerequisites

For this project, it is recommended that you have Python 3.8 or higher installed on your system, alongside Pipenv or Poetry (whichever package manager you prefer). Additionally, you will need to have Git installed on your system, with Streamlit installed as well since our Steamlit application will need to use the command-line interface to run the application properly.

Running the Application

  1. Clone the repository from GitHub to your local machine:
git clone https://github.com/Hi-kue/syncgraph-309.git
  1. Open 2 terminals, navigating to the client directory and server directory respectively and running the following commands:
cd ./client/
pipenv install
pipenv shell

cd ./server/
pipenv install
pipenv shell 

Note

Alternatively, we suggest to use a single package manager with a single virtual environment for both the client and server, but if you prefer to have separate environments for each, you can do so as well.

  1. Once both the client and the server have been set up, you should start with the server directory and run the ipynb file called c309_r2_toodu_model.ipynb to train and deploy the .pkl model files that will be used in the Streamlit and backend application.

Note

In order to quickly run the cells within the notebook, you can use press SHIFT + ENTER for each cell to run them.

  1. Once the models have been trained and deployed and the .pkl files have been saved, you can now run the app.py file in the server by either running the bash script ./run.sh or by typing in flask run in your first terminal.

  2. Finally, after running the app.py file, you can now run the Streamlit application (on the other terminal) by typing in the following command or by running the bash script ./run_streamlit.sh:

streamlit run app_streamlit.py --server.port 8501

Note

For more information about how to run the application properly, consider viewing the youtube video tutorial that will be attached to this README file below.

If you are still having trouble running the application, consider watching the video tutorial below:

!YOUTUBE VIDEO

File Content and Structure

Provided below are the files and folders for this project in a tree structure:

.
├── client/
│   ├── main.py -> (StreamLit App)
│   ├── host.sh
│   ├── run.sh
│   ├── .env
│   ├── .env.sample
│   ├── poetry.lock
│   └── pyproject.toml
├── server/
│   ├── data/
│   │   └── *.{csv, txt, xlsx}
│   ├── models/
│   │   └── *.pkl
|   ├── insights/
|   │   └── *.ipynb
│   ├── app.py
│   ├── pyproject.toml
│   ├── poetry.lock
│   └── setup.sh
├── docs/
│   ├── CODE_OF_CONDUCT.md
│   ├── CODEOWNERS
│   ├── CONTRIBUTING.md
│   └── SECURITY.md
├── .gitignore
├── README.md
└── LICENSE

Contributing

Contributions are what make open-source such an amazing place to learn, get inspired, and create. Any contributions you make to this repository is greatly appreciated.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

If you have any questions or concerns, feel free to reach out to the contributors of this website or open an issue in this repository following the proper guidelines in the CONTRIBUTING.md file.

Acknowledgements

Thank you to all the following people for their contributions to this repository, to the moon and back! 🚀

TODO: Add contributors here (if any).

About

309 | Predictive machine learning model (classifier) and deployed API using Flask w/python and NextJs w/javascript (fullstack app).

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors