Skip to content

Zvapo/uk-flood-risk-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UK Flood Risk Detection System 🌊

Status

Version License

Overview

This program uses a machine learning model to predict the flood risk for a given UK postcode. The model is trained on historical data and is used to predict the flood risk from an unlabelled dataset. This is my playground project where I explore different machine learning models, prediction methods and data transformation techniques. Feel free to use the code as you see fit.

Demo

Flood Risk Calculation

Flood risk is calculated from the median house price in the postcode and the flood risk.

Installation

  1. Clone the repository:
git clone https://github.com/Zvapo/uk-flood-risk-detection.git
  1. Navigate to the project directory:
cd uk-flood-risk-detection
  1. Create a virtual environment:
conda env create -f environment.yml
  1. Activate the virtual environment:
conda activate uk-flood-risk-detection

Usage

  1. Train the model, fine-tune the hyperparameters and create a postcode databse file by running:
python main.py
  1. The folder should now contain a file called postcodedb.csv which contains the postcode database as well as the models trained on the postcode labelled file.

  2. Use the tool to predict the flood risk for a given UK postcode by running:

python main.py predict-risk <postcode>
  1. The tool will return the flood risk for the postcode given the model was trained on the postcode.

Examples

  1. Predict the flood risk for a given postcode:
python main.py predict-risk "PO7 8PR" "SO17 1NS" # add quotes if the postcode contains a space
  1. Add more data to the model and train it again:
python main.py add-file file <path_to_data_file> method-risk <method_name> method-house-price <method_name>
  1. List the available models:
python main.py list-methods
  1. For more information on the commands, use the help flag:
python main.py -h

Contributing

  • Fork the repository and create a new branch for your feature or bugfix.
  • Commit your changes and push them to your fork.
  • Submit a pull request describing your changes.

License

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

Acknowledgments

Contact

For support or queries, please contact:

  • Twitter: @LocusIII

About

CLI application for calculating flood risk for UK postcodes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages