Inspiration
Delivery and gig workers lose a full day of pay when heavy rain hits. Nobody pays them for that day. We wanted a simple safety net: rain stops work, money arrives. No forms, no waiting.
What it does
RainPay is weather cover for gig workers in Chennai and Visakhapatnam.
- Workers pay a small weekly premium (about Rs. 70–93) through PayPal.
- Our AI checks tomorrow's rain risk.
- On a real work-stop day (35 mm or more of rain), RainPay sends a Rs. 400 payout through PayPal automatically.
- On a dry day, the payout is rejected.
How we built it
- Real data only. 26 years (2000–2025) of daily weather for 8 spots, from Open-Meteo. No fake data.
- Rain model. XGBoost predicts if tomorrow is a work-stop day. Trained on 2000–2014, tuned on 2015–2018, tested on 2019–2025.
- Zone risk score. Each area gets a 0–100 risk score from past rain. Riskier zones pay a higher premium.
- Money check. We replayed 2019–2025 and then all 26 years to see if the fund survives bad years.
- PayPal. A FastAPI app takes the premium and sends the payout using the PayPal sandbox.
Results
- Test recall: 49.6%, precision: 22.1% on years the model never saw.
- Loss ratio (payouts vs premiums): 59.4% in 2019–2025, never above 82.3% combined in 26 years.
- A reserve of about Rs. 30 lakh covers the worst year.
Challenges
- Bengaluru had too few heavy-rain days, so we replaced it with Visakhapatnam.
- Our first model memorized the training years. A validation split fixed this.
- A Random Forest did not beat a simple 5-year average for zone risk, so we kept the simple one.
- PayPal Payouts gave a 403 error with India accounts. We moved to US sandbox test accounts.
What we learned
Honest testing matters more than a big score. Real data showed us the true limits of the model.
What's next
More cities, heat and air-quality triggers, and live (non-sandbox) payouts.
Built With
- fastapi
- open-meteo-api
- pandas
- paypal
- paypalsandox
- python
- restapi
- scikit-learn
- xgboost