Predict delivery times with 80.8% accuracy using advanced machine learning algorithms
DeliveryTime AI is a sophisticated web application that leverages machine learning to predict food delivery times with remarkable accuracy. Built with modern web technologies and trained on real delivery data, it provides instant predictions with detailed factor analysis.
- 80.8% accuracy with only 6.4 minutes average error
- Real-time predictions using Linear Regression model
- Confidence scoring for prediction reliability
- Factor impact visualization with interactive charts
- Weather condition analysis (Clear, Foggy, Rainy, Snowy, Windy)
- Traffic level optimization (Low, Medium, High)
- Vehicle type comparison (Bike, Car, Scooter)
- Responsive design that works on all devices
- Glass morphism effects for premium aesthetics
- Smooth animations and micro-interactions
- Intuitive form controls with helpful tooltips
- Experience-based adjustments for courier efficiency
- Time-of-day optimization for different periods
- Real-time confidence scoring based on input reliability
- Optimization tips for better delivery performance
- Node.js 18.0 or higher
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/yourusername/deliverytime-ai.git cd deliverytime-ai -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:5173to see the application
- React 18 - Modern UI library with hooks
- TypeScript - Type-safe JavaScript development
- Tailwind CSS - Utility-first CSS framework
- Vite - Fast build tool and development server
- Recharts - Composable charting library
- Lucide React - Beautiful icon library
- Linear Regression - Trained on real delivery data
- Feature Engineering - Optimized categorical encoding
- Cross-validation - Robust model validation
| Metric | Value | Description |
|---|---|---|
| Accuracy | 80.8% | Overall prediction accuracy |
| MAE | 6.4 min | Mean Absolute Error |
| Rยฒ Score | 0.808 | Coefficient of determination |
| Training Data | 1000+ records | Real delivery scenarios |
- Distance (km) - Primary factor affecting delivery time
- Weather Conditions - Significant impact on travel speed
- Traffic Levels - Real-time traffic consideration
- Vehicle Type - Optimization for different vehicles
- Courier Experience - Experience-based efficiency
- Time of Day - Peak hours and off-peak optimization
- Preparation Time - Kitchen preparation duration
- Set the distance from restaurant to delivery location
- Input food preparation time
- Select courier experience level
- Choose current weather conditions
- Set traffic level (Low/Medium/High)
- Select time of day period
- Pick vehicle type
- Click "Predict Delivery Time" button
- View detailed prediction with confidence score
- Analyze factor impacts with interactive charts
- Get optimization tips for better performance
- Predicted Time: Main delivery time estimate
- Confidence Score: Reliability of the prediction
- Factor Analysis: Impact of each variable
- Optimization Tips: Suggestions for improvement
interface DeliveryPredictionInput {
distance_km: number; // Distance in kilometers
preparation_time_min: number; // Preparation time in minutes
courier_experience_yrs: number; // Years of experience
weather: 'Clear' | 'Foggy' | 'Rainy' | 'Snowy' | 'Windy';
traffic_level: 'High' | 'Low' | 'Medium';
time_of_day: 'Afternoon' | 'Evening' | 'Morning' | 'Night';
vehicle_type: 'Bike' | 'Car' | 'Scooter';
}interface PredictionResult {
predicted_time: number; // Predicted time in minutes
confidence_score: number; // Confidence (0-1)
factors: {
distance_impact: number; // Distance contribution
weather_impact: number; // Weather contribution
traffic_impact: number; // Traffic contribution
vehicle_impact: number; // Vehicle contribution
experience_impact: number; // Experience contribution
};
}src/
โโโ components/ # React components
โ โโโ Header.tsx # Application header
โ โโโ PredictionForm.tsx # Input form
โ โโโ PredictionResult.tsx # Results display
โ โโโ ModelInfo.tsx # Model information
โโโ types/ # TypeScript interfaces
โโโ utils/ # Utility functions
โ โโโ modelUtils.ts # ML model implementation
โโโ App.tsx # Main application
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
The Linear Regression model uses the following coefficients:
const MODEL_COEFFICIENTS = {
intercept: 25.0,
distance_km: 2.8,
preparation_time_min: 0.9,
courier_experience_yrs: -2.1,
weather_foggy: 8.5,
weather_rainy: 12.3,
weather_snowy: 15.7,
weather_windy: 5.2,
// ... additional coefficients
};- Build the project:
npm run build - Deploy the
distfolder to Netlify - Configure build settings:
- Build command:
npm run build - Publish directory:
dist
- Build command:
- Connect your GitHub repository
- Vercel will automatically detect Vite configuration
- Deploy with zero configuration
- Run
npm run build - Upload the
distfolder to your web server - Configure your server to serve the
index.htmlfor all routes
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow TypeScript best practices
- Use Tailwind CSS for styling
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Scikit-learn for machine learning algorithms
- React Team for the amazing framework
- Tailwind CSS for the utility-first approach
- Recharts for beautiful data visualization
- Lucide for the icon library
- Documentation: docs/USER_GUIDE.md
- Technical Report: docs/TECHNICAL_REPORT.md
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with โค๏ธ using React, TypeScript, and Machine Learning
Live Demo โข Documentation โข Report Issues