How ammar8065/earthquake-disaster-predictions works
Project Type and Purpose
• This is a data-driven, machine-learning based prediction system.
• Its primary purposes are earthquake magnitude prediction (via an LSTM model), impact assessment (using a Random Forest classifier), and resource allocation (via a greedy algorithm). Visualizations help interpret the results.
• The execution environment is a Jupyter Notebook that integrates data processing, model training, and real-time visualizations.
Analyzing the File Structure
• Key files:
• Earthquake Disaster Prediction.ipynb: Contains the main code for data ingestion, preprocessing, model implementation, and visualization.
• earthquake_map.html and magnitude_plot.html: Standalone interactive visualizations generated by Folium and Plotly.
• README.md: Provides a complete system description, algorithm details, and instructions.
• The lean structure indicates that the system is built as a prototype or educational/portfolio project rather than a multi-tier microservices system.
Main Components and Their Relationships
• Data Input & Ingestion:
• Represents loading datasets (e.g., usgs_main.csv and usgs_current.csv from Kaggle, as mentioned in the README).
• Preprocessing and data cleaning operations.
• Machine Learning Modules:
• Magnitude Prediction Module: This module uses the LSTM model to forecast future earthquake magnitudes.
• Impact Assessment Module: Uses a Random Forest Classifier to classify earthquake events by impact into Low, Moderate, and Severe.
• Resource Allocation Module:
• Implements a greedy algorithm that assigns resources (rescue teams, food, water, etc.) based on the impact severity from the classification.
• Visualization Components:
• Time-series Plot: Generated via Plotly to show earthquake magnitudes over time.
• Interactive Map: Generated via Folium to display the geographical locations of events and their severity.
• Execution Environment:
• The Jupyter Notebook acts as an integrator that orchestrates all the above modules. It may also serve as the interface to view the outputs such as visualizations.
Architectural Patterns/Design Principles
• Although not strictly layered as in a full-stack application, the notebook organizes the workflow in a sequential pipeline:
Data ingestion → Preprocessing → Model training/evaluation → Resource allocation → Visualization.
• This separation of concerns can be visually represented as distinct blocks or modules connected in sequence.
• Annotations regarding technologies or frameworks used (e.g., Python 3.11, TensorFlow, scikit-learn, Plotly, Folium).