{"id":27163064,"url":"https://github.com/spafic/farespot","last_synced_at":"2025-04-09T01:41:08.607Z","repository":{"id":285238668,"uuid":"957482252","full_name":"Spafic/FareSpot","owner":"Spafic","description":"FareSpot is a Django-based machine learning application that predicts taxi fares in the USA. It leverages a pretrained LightGBM model and applies preprocessing techniques, including feature engineering, encoding, and scaling, to ensure accurate predictions.","archived":false,"fork":false,"pushed_at":"2025-03-30T14:20:12.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T14:29:59.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Spafic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-30T13:41:17.000Z","updated_at":"2025-03-30T14:20:16.000Z","dependencies_parsed_at":"2025-03-30T14:40:30.205Z","dependency_job_id":null,"html_url":"https://github.com/Spafic/FareSpot","commit_stats":null,"previous_names":["spafic/farespot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spafic%2FFareSpot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spafic%2FFareSpot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spafic%2FFareSpot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spafic%2FFareSpot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Spafic","download_url":"https://codeload.github.com/Spafic/FareSpot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247958720,"owners_count":21024821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-09T01:41:07.981Z","updated_at":"2025-04-09T01:41:08.576Z","avatar_url":"https://github.com/Spafic.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FareSpot - Intelligent Taxi Fare Prediction\n\n![Python](https://img.shields.io/badge/Python-3.12%2B-brightgreen)\n![Django](https://img.shields.io/badge/Django-5.0.1-green)\n![LightGBM](https://img.shields.io/badge/LightGBM-4.1.0-blue)\n![ScikitLearn](https://img.shields.io/badge/Scikit--Learn-1.4.1-orange)\n![Pandas](https://img.shields.io/badge/Pandas-2.2.1-yellow)\n![Matplotlib](https://img.shields.io/badge/Matplotlib-3.8.3-red)\n![License](https://img.shields.io/badge/License-MIT-yellow)\n![Status](https://img.shields.io/badge/Status-Active-success)\n![Version](https://img.shields.io/badge/Version-2.0-informational)\n\n![FareSpot Logo](Fare_Spot.png)\n\n## Overview\n\nFareSpot is an advanced machine learning solution for predicting taxi fares with high accuracy. Built with Django and powered by LightGBM regression models, this application provides reliable fare estimates based on trip details such as pickup/dropoff locations, time of day, and passenger count.\n\n## Data Challenges Overcome\n\nOne of the biggest challenges in this project was dealing with problematic real-world data:\n\n### Geolocation Inconsistencies\n\nThe heatmaps below illustrate one of our major data quality issues - many coordinates showed pickups and dropoffs in impossible locations such as oceans and lakes, despite the dataset being from the USA:\n\n#### Pickup Locations Heatmap\n![Pickup Heatmap](Heatmaps/Pickup_Heatmap.png)\n\n#### Dropoff Locations Heatmap\n![Dropoff Heatmap](Heatmaps/Dropoff_Heatmap.png)\n\nOther significant data challenges included:\n- Extreme outliers in fare amounts\n- Missing values across multiple features\n- Need for sophisticated scaling and encoding techniques\n\n## Model Performance\n\nAfter rigorous data cleaning and preprocessing, our model achieved excellent performance metrics:\n\n| Metric | Value |\n|--------|-------|\n| R² Score | 0.7846 |\n| MSE | 0.0429 |\n| RMSE | 0.2070 |\n| MAE | 0.1447 |\n\n## Features\n\n- **Accurate Fare Prediction**: Uses machine learning to provide reliable fare estimates\n- **User-Friendly Interface**: Simple web interface for entering trip details\n- **Geospatial Analysis**: Incorporates location data for improved predictions\n- **Time-Based Factors**: Accounts for time of day and date in predictions\n- **Robust Model**: Handles various input combinations with consistent results\n\n## Project Structure\n\n```\nFareSpot/\n├─ fare_prediction/           # Main application directory\n│  ├─ models/                 # Trained ML models\n│  │  ├─ lgb_model.pkl        # LightGBM model\n│  │  └─ scaler.pkl           # StandardScaler preprocessor\n│  ├─ templates/              # HTML templates\n│  ├─ views.py                # View controllers\n│  └─ urls.py                 # URL routing\n├─ FareSpot/                  # Django project settings\n├─ Heatmaps/                  # Geospatial visualization\n│  ├─ Pickup_Heatmap.png      # Pickup location density map\n│  └─ Dropoff_Heatmap.png     # Dropoff location density map\n├─ Fare_Spot.png              # Project logo\n├─ fare_prediction_pipeline.ipynb  # Model training notebook\n├─ preprocessing_pipeline.ipynb    # Data preprocessing notebook\n└─ manage.py                  # Django management script\n```\n\n## Technologies Used\n\n- **Django**: Web framework for building the application interface\n- **LightGBM Regressor**: Gradient boosting framework for the prediction model\n- **StandardScaler**: Feature preprocessing for improved model performance\n- **Jupyter Notebooks**: For data exploration and model development\n- **Matplotlib/Seaborn**: For generating geospatial heatmaps\n\n## Model Development Process\n\n1. **Data Collection**: Gathered extensive taxi trip data\n2. **Exploratory Data Analysis**: Identified patterns and anomalies\n3. **Data Cleaning**: Addressed geolocation inconsistencies and outliers\n4. **Feature Engineering**: Created relevant time-based and distance features\n5. **Preprocessing**: Applied scaling and encoding techniques\n6. **Model Selection**: Evaluated multiple regression models\n7. **Hyperparameter Tuning**: Optimized LightGBM parameters\n8. **Model Validation**: Ensured robust performance across various scenarios\n\n## Setup Instructions\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/Spafic/FareSpot.git\n   cd FareSpot\n   ```\n\n2. **Create a virtual environment**:\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. **Install dependencies**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Run migrations**:\n   ```bash\n   python manage.py migrate\n   ```\n\n5. **Start the server**:\n   ```bash\n   python manage.py runserver\n   ```\n\n6. **Access the application**:\n   Open your browser and go to `http://127.0.0.1:8000/`\n\n## Usage\n\n1. Navigate to the home page\n2. Enter trip details:\n   - Pickup location (latitude/longitude)\n   - Dropoff location (latitude/longitude)\n   - Time and date\n   - Number of passengers\n3. Click \"Predict Fare\"\n4. View the predicted fare amount\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request.\n\n## License\n\nThis project is licensed under the [MIT License](./LICENSE).\n\n## Contact\n\nFor any inquiries, please contact:\n- Email: [Email](mailto:omar.mamon203@gmail.com)\n- GitHub: [Spafic](https://github.com/Spafic)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspafic%2Ffarespot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspafic%2Ffarespot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspafic%2Ffarespot/lists"}