Git Product home page Git Product logo

disaster-response-pipeline's Introduction

Disaster Response Pipeline Project

This project builds an ETL pipeline to process disaster response messages and their categories. Then uses a ML pipeline to build a model to predict the category of messages, which can be entered by the user in a web UI. Check it out on https://disasterresponsepipeline.herokuapp.com/

The UI shows what categories the model predicted for the inputted message, by using 4 different ML models. This allows for better predictions and comparison between the models.

Here's a few examples

Dependencies

To run the project you need python3 and pip installed. The full list of dependencies can be found in the requirements.txt.

Installation

Clone the project

git clone https://github.com/luchev/disaster-response-pipeline

Enter project directory

cd disaster-response-pipeline

Set up a virtual environment

python3 -m venv venv

Activate the virtual invironment

source venv/bin/activate

Install requirements

pip install -r requirements.txt

Usage

Using pre-trained model

The project comes with wrangled data and pre-trained models. If you want to use the pre-trained models you can just run the webserver:

python3 run.py

or

./runFlask.sh

Then go to http://0.0.0.0:3001/ to see the running project.

Building custom model

If you want to train your own models on custom dataset you will have to update the model path in app/run.py:34

  • To run ETL pipeline that cleans data and stores in database python3 data/process_data.py data/disaster_messages.csv data/disaster_categories.csv <Database-Name>.db

  • To run ML pipeline that trains classifier and saves python3 models/train_classifier.py <DatabasePath>.db <ModelPath>.pkl [ModelClassifier]

There are 4 classifiers you can use:

  • RandomForest (default)
  • AdaBoost
  • KNeighbours
  • DecisionTree

Examples

Process the sample data using the ETL (executed in the root of the project)

python3 data/process_data.py data/disaster_messages.csv data/disaster_categories.csv data/DisasterResponse.db

Train a new KNeighbours model (executed in the root of the project)

python3 models/train_classifier.py data/DisasterResponse.db models/new-kneighbours.pkl kneighbours

Acknowledgements

This project is developed as part of Udacity's Data Science Nanodegree Program

The data is provided by Figure Eight

License

This project is licensed under the terms of the MIT license.

disaster-response-pipeline's People

Contributors

luchev avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.