Earthquake Classifier and Map Visualizer

Project Overview

This project fetches recent earthquake data from GeoNet and provides six different approaches for classifying earthquakes based on their potential intensity (High or Low):

Data Source: Earthquake data is provided by GeoNet (https://www.geonet.org.nz/).

How to Use

To generate the earthquake map and run either classifier:

  1. Ensure you have Python and the necessary libraries installed (see Technologies Used).
  2. Choose your preferred model and run the corresponding script:
    • For Decision Tree: python decision_tree.py
    • For Neural Network (TensorFlow): python neural_network.py
    • For Statistical Model: python statistical_model.py
    • For ML Model: python ml_model.py
    • For Neural Model (MLPClassifier): python neural_model.py
    • For Transformer Model (DistilBERT): python transformer_model.py
  3. This will fetch data, process it, and generate an HTML map file.
  4. Open the generated HTML file in your web browser to view the map.

Model Approaches

Decision Tree Model

The Decision Tree approach provides a simple, interpretable model that's great for understanding the classification process. It's particularly useful for:

  • Quick initial analysis
  • Understanding feature importance
  • Visualizing the decision-making process

Output files: decision_tree.html and decision_tree.png

Neural Network Model

The Neural Network approach offers a more sophisticated model that can capture complex patterns in the data. It's particularly useful for:

  • More accurate predictions
  • Handling complex relationships in the data
  • Learning from larger datasets

Output files: neural_network.html and neural_network.png

Statistical Model

The Statistical Model approach provides traditional machine learning algorithms with proven statistical foundations. It supports both Logistic Regression and Naive Bayes classifiers and is particularly useful for:

  • Well-established statistical methods with theoretical backing
  • Baseline comparisons with other models
  • Fast training and prediction times
  • Good performance on smaller datasets

Output file: statistical_model.html

Machine Learning Model

The Machine Learning Model approach focuses specifically on Logistic Regression optimization with advanced features like decision boundary visualization. It's particularly useful for:

  • Focused Logistic Regression implementation
  • Decision boundary visualization
  • Feature scaling and standardization
  • Detailed performance metrics and reporting

Output files: ml_model.html and ml_model.png

Neural Model (MLPClassifier)

The Neural Model approach uses MLPClassifier for neural network simulation without requiring TensorFlow. It's particularly useful for:

  • Lightweight neural network implementation
  • No TensorFlow dependency requirements
  • Multi-layer perceptron architecture
  • Scikit-learn integration and consistency

Output files: neural_model.html and neural_model.png

Transformer Model (DistilBERT)

The Transformer Model approach uses DistilBERT for attention-based text classification by converting numerical earthquake data into descriptive text. It's particularly useful for:

  • Attention-based pattern recognition
  • Natural language processing techniques
  • Text representation of numerical data
  • State-of-the-art transformer architecture

Output files: transformer_model.html and transformer_model.png

Configuration

You can modify the behavior of all models by editing the config.py file. Key settings include:

Earthquake Maps

View the generated maps:

Technologies Used