Giter Club home page Giter Club logo

disaster-management-ml's Introduction

Disaster Response Pipeline Project

Overview

This project is in a form of a Web App implemented using python and its libraries, ETL techniques, Machine Learning Models and Flask App to visualize a system that can classify messages sent during disasters and correlate it to various categories in order to facilitate disaster response. This is a Udacity Nanodegree Educational Project.

Contents

The repo consists folders of the following structure:

  • app

    • template
      • master.html       # main page of web app
      • go.html       # classification result page of web app
    • run.py       # Flask file that runs app
  • data

    • disaster_categories.csv       # data to process
    • disaster_messages.csv       # data to process
    • process_data.py       # python script for the ETL Transformation of the data
    • DisasterResponse.db       # database created from code to save cleaned data
  • models

    • train_classifier.py       # python script to create machine learning pipeline model for the dataset
    • classifier.pkl       # saved model
  • notebooks

    • ETL_Pipeline_Preparation.ipynb       # Jupyter Notebook to explain ETL Script step by step
    • ML_Pipeline_Preparation.ipynb       # Jupyter Notebook to explain ML Model creation step by step
  • README.md

Code Flow and Results

The code cleans data extracted from dataset containing real messages that were sent during disaster events using process_data.py file. Then, it runs a ML Pipeline using CountVectorizer, TfidfTransformer then MultiOutputClassifier and KNeighborsClassifier to train the model.

After that, GridSearch is used to find the best parameters for the classifier and the results was using 10 n_neighbours and uniform weights. To enhance the model further, a custom extractor called StartingVerbExtractor was used to increase the accuracy.

The precision reached 0.7 after being 0.58 before enhancement.

Instructions:

  1. Run the following commands in the project's root directory to set up your database and model.

    • To run ETL pipeline that cleans data and stores in database python data/process_data.py data/disaster_messages.csv data/disaster_categories.csv data/DisasterResponse.db
    • To run ML pipeline that trains classifier and saves python models/train_classifier.py data/DisasterResponse.db models/classifier.pkl
  2. Run the following command in the app's directory to run your web app. python run.py

  3. Go to http://0.0.0.0:3001/

disaster-management-ml's People

Contributors

nandini-singh05 avatar

Watchers

 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.