TimeToDoor is a machine learning-powered delivery time prediction application. It predicts the expected delivery time based on various features like delivery person details, weather, traffic, order type, vehicle, and city information. The app also supports batch predictions via CSV files.
- Predict delivery time for a single order.
- Perform batch predictions using CSV uploads.
- Train and retrain the machine learning model with the latest dataset.
- Modern Flask-based web interface.
- Python 3.11+
- Conda (recommended)
- All dependencies are listed in
requirements.txt
- Clone the repository
git clone https://github.com/Prakashkumar88/TimeToDoor.git
cd TimeToDoor- Activate your Conda environment
conda create -n timetodoor python=3.11
conda activate timetodoor- Install dependencies
pip install -r requirements.txt- Run the Flask application
python app.py- Access the app
- Open your browser and navigate to: http://localhost:5000
TimeToDoor/
├── app.py # Main Flask application
├── templates/ # HTML templates
├── static/ # CSS, JS, favicon
├── TimeToDoor/ # Main Python package
│ ├── components/ # Data ingestion, transformation, training modules
│ ├── pipelines/ # Prediction & training pipelines
│ ├── config/ # Configuration files
│ ├── utils.py # Helper functions
│ ├── logger.py # Logging setup
│ └── constants.py # Constants like file paths
└── requirements.txt # Python dependencies
- Go to
/predict - Fill out the form with order details
- Click Predict to get the estimated delivery time
- Go to
/batch_prediction - Upload a CSV file with multiple orders
- Click Run Batch Prediction
- Download the output CSV with predicted delivery times
- Go to
/train - Click Train Model to retrain the model with the latest dataset
- Update libraries to the latest versions
pip install --upgrade -r requirements.txt- Retrain the model
- Go to the
/trainpage on the app and click Train Model - Or run the training pipeline manually:
python -m TimeToDoor.pipelines.training_pipeline- Predict using the latest model
- The updated model will automatically be used for
/predictand/batch_prediction.
- Ensure to retrain the model if you update the dataset or dependencies.
- For production deployment, configure the Flask app with a proper web server (e.g., Gunicorn or Nginx).
- Output CSV files from batch prediction are saved in
batch_prediction/prediction_csv/output.csv.
MIT License © 2025 Prakash Kumar