Redefining 'Local' in the X-Minute City: Predicting apartment performance based on neighborhood amenities and understanding how renter preferences changed post-COVID.
Try the platform: https://revpar-analysis.streamlit.app/
This project predicts RevPAR (Revenue Per Available Unit) Growth for multifamily apartment properties using machine learning. We analyze how neighborhood amenities, location characteristics, and market dynamics influence apartment performance.
- Time Period Effect: Pre vs Post COVID distinction accounts for ~67% of prediction importance
- Location Matters: State and metro-level features are crucial predictors
- Optimal Drivetime: 10-minute drivetime radius provides best predictive power
- Model Performance: Ensemble model achieves 0.1092 RMSE (18.3% improvement over baseline)
# Navigate to project
cd "/Users/somildoshi/Somil Doshi/UH - Coding/Finance"
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Install OpenMP for XGBoost (Mac only)
brew install libomp# Create .env file
echo 'OPENAI_API_KEY=your_key_here' > .env
echo 'RANDOM_STATE=42' >> .env# Train on 15-minute drivetime (default)
python train.py --drivetime drv15
# Or train on other drivetimes
python train.py --drivetime drv10
python train.py --drivetime drv30python generate_full_submission.pystreamlit run app/app.pyFinance/
βββ data/
β βββ master_panel_drv10.csv # 10-minute drivetime data
β βββ master_panel_drv15.csv # 15-minute drivetime data
β βββ master_panel_drv30.csv # 30-minute drivetime data
β βββ scoring.csv # Held-out test set
β βββ dictionary.csv # Data dictionary
β
βββ src/
β βββ __init__.py # Package init
β βββ config.py # Configuration settings
β βββ data_loader.py # Data loading & wrangling
β βββ features.py # Feature engineering
β βββ model.py # Model training & evaluation
β
βββ app/
β βββ app.py # Streamlit dashboard
β
βββ models/ # Saved model checkpoints
β βββ baseline_ridge.pkl
β βββ xgboost_model.pkl
β βββ lightgbm_model.pkl
β βββ ensemble_model.pkl
β
βββ outputs/ # Predictions & analysis
β βββ submission_final_*.csv
β βββ feature_importance_*.csv
β
βββ train.py # Main training script
βββ generate_full_submission.py # Generate predictions
βββ requirements.txt # Dependencies
βββ .env # Environment variables
βββ README.md # This file
- Handled missing values (median imputation for numeric, 'Unknown' for categorical)
- Handled multi-phase buildings (same UBID with different yearbuilt)
- Outlier clipping at 1st/99th percentiles
- Created target variable based on
time_window_tag
- Amenity Density: Count / trade area size
- Amenity Ratios: High-end grocery / total grocery, sit-down / total food
- Composite Scores: Proximity, transit, health, housing composites from AARP metrics
- Building Features: Age, renovation status, size indicators
- Supply Features: Growth rate, expansion indicators
- Affordability Features: Rent-to-mortgage ratio, rent advantage indicator
| Model | CV RMSE | CV RΒ² |
|---|---|---|
| Baseline (Ridge) | 0.1337 | 56.0% |
| XGBoost | 0.1095 | 70.5% |
| LightGBM | 0.1104 | 70.0% |
| Ensemble | 0.1092 | 70.6% |
- GroupKFold with 5 folds
- Grouped by UBID to prevent data leakage
- Same property never appears in both train and validation
is_pre_covid(39.4%)is_post_covid(28.0%)time_window_tag(9.4%)state(4.7%)state_metro(4.3%)zip_metro(1.4%)aarp_met_house_access_step(1.1%)aarp_met_trans_delay(0.7%)aarp_met_health_hospital(0.6%)mrkt_name(0.4%)
| Drivetime | Ensemble RMSE |
|---|---|
| drv10 | 0.1091 β |
| drv15 | 0.1092 |
| drv30 | 0.1098 |
- Post-COVID, local amenities matter more than downtown proximity
- Properties with good grocery access outperform regardless of location type
- The 15-minute city concept should be adapted by neighborhood type
- For Renters: Look for "hidden gem" neighborhoods with high local amenity density
- For Urban Planners: Invest in local amenities in underserved suburban areas
- For Investors: Consider supply growth as a key risk factor
- β Code Repository: Complete with clear instructions
- β Methodology Summary: This README + notebook analysis
- β
Predictions CSV:
outputs/submission_final_*.csv - β Dashboard: Interactive Streamlit app
- Abbiasov et al., "The 15-minute city quantified using human mobility data," Nature Human Behaviour 8, no. 3 (2024)
- BroadVail Capital Partners Finance Track Problem Statement
Rice Datathon 2026 Participant
This code is provided for the Rice Datathon 2026 competition only. Data must be deleted after the event.