A machine learning-powered web application that predicts the country where a UFO sighting was most likely reported based on duration, latitude, and longitude data.
This web application uses a trained logistic regression model to predict which country a UFO sighting was reported in, based on three key features:
- Duration (in seconds, 0-60)
- Latitude (geographical coordinate)
- Longitude (geographical coordinate)
The model can predict sightings from 5 countries: Australia, Canada, Germany, United Kingdom, and United States.
- 🌐 Interactive Web Interface: Clean, modern UI with gradient text effects and smooth animations
- 🤖 Machine Learning Prediction: Trained logistic regression model using scikit-learn
- 📊 Real-time Results: Instant predictions based on user input
- 📱 Responsive Design: Works seamlessly across desktop and mobile devices
- ℹ️ Educational Content: Includes information about the model and how to use it
- Python 3.x: Core programming language
- Flask: Lightweight web framework for routing and serving the application
- scikit-learn: Machine learning library for model training and prediction
- NumPy: Numerical computing library for array operations
- Pandas: Data manipulation and analysis
- HTML5: Semantic markup structure
- CSS3: Modern styling with gradients, animations, and glassmorphism effects
- JavaScript: Interactive button effects and dynamic user interactions
- Google Fonts: Inter and Playfair Display for premium typography
- Model: Logistic Regression classifier
- Training Data: UFO Sightings dataset from Kaggle
- Features: Duration (seconds), Latitude, Longitude
- Target: Country of reported sighting (5 classes)
ufo-webapp/
├── app/
│ ├── app.py # Main Flask application
│ ├── requirements.txt # Python dependencies
│ ├── static/
│ │ ├── css/ # Stylesheets (global, layout, components)
│ │ └── js/ # JavaScript components (buttons, background)
│ └── templates/ # HTML templates (base, landing, index, about)
├── model/
│ └── ufo-model.pkl # Trained ML model (pickled)
├── data/
│ └── raw/ # Raw dataset storage
├── train.ipynb # Jupyter notebook for model training
└── README.md # This file
- Python 3.7 or higher
- pip (Python package manager)
-
Clone the repository
git clone <repository-url> cd ufo-webapp
-
Create a virtual environment (recommended)
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
cd app pip install -r requirements.txt
-
Navigate to the app directory
cd app -
Start the Flask development server
python app.py
-
Open your browser and navigate to:
http://127.0.0.1:5000 -
Use the application
- Visit the landing page at
/ - Navigate to the prediction form at
/prediction - Enter duration (seconds), latitude, and longitude
- Click "Predict!" to see which country the sighting likely occurred in
- Visit the landing page at
To predict a UFO sighting in New York City:
- Navigate to
/prediction - Enter the following values:
- Seconds:
30 - Latitude:
40.7128 - Longitude:
-74.0060
- Seconds:
- Click Predict!
- Result: United States 🇺🇸
The model was trained using the train.ipynb Jupyter notebook. To retrain the model:
- Open
train.ipynbin Jupyter Notebook or JupyterLab - Ensure the UFO sightings dataset is in the
data/raw/directory - Run all cells to train the logistic regression model
- The trained model will be saved as
model/ufo-model.pkl
Thank you to my parents for always believing in me :D