How josue-rdgzcb/airbnb-price-prediction-mexico-city works
This project estimates Mexico City Airbnb nightly prices and contextualizes each estimate against nearby comparable listings. Users choose a location on the map, enter property and host details, and submit them through the Streamlit app to FastAPI; the API prepares features, applies the saved preprocessing pipeline and model, then generates market insights and returns a combined result. The graph also includes the documented training/analysis capabilities, though their internal connections are not established by the sampled runtime excerpts. Those excerpts support the API inference path; unsampled domain-module relationships are omitted rather than inferred.
Main entry points: inference.py Prediction inference · preprocess_features.py Preprocessing pipeline · preprocess_settings.py Preprocess settings · streamlit_app.py Pricing interface
Components 25
User Experience
- Pricing interface
app/frontend/streamlit_app.py - Location map
app/frontend/map.py - Neighborhood lookup
app/services/geolocation.py
Prediction Service
- FastAPI app
app/main.py - Prediction endpoint
app/api/routes.py - Request and response
app/api/schemas.py - Prediction inference
app/services/inference.py - Feature preparation
app/services/features.py - Input cleaning
src/cleaning/cleaning_utils.py - Preprocessing pipeline
src/preprocess/preprocess_features.py - Missing-value imputation
src/preprocess/imputation.py - Categorical encoding
src/preprocess/encoding.py - Numeric transforms
src/preprocess/numeric_transformation.py - Feature scaling
src/preprocess/scaling.py - Preprocess settings
src/settings/preprocess_settings.py - Model artifacts
app/services/artifacts.py - Model settings
src/settings/model_settings.py - Trained price model
Market Context
- Comparable-market insights
app/services/insights.py - Reference listings
ML Development
- Data preparation
src/data - Exploratory analysis
src/eda - Feature diagnostics
src/features/analysis - Model training and evaluation
src/modeling
Other components
- Listing user
Connections 30
- Listing user → Pricing interface: enters listing
README.md - Pricing interface → Location map: offers location selection
app/frontend/streamlit_app.py - Location map → Neighborhood lookup: looks up neighborhood
app/frontend/map.py - Pricing interface → FastAPI app: submits listing
app/frontend/streamlit_app.py - FastAPI app → Prediction endpoint: registers routes
app/main.py - Prediction endpoint → Request and response: validates and returns
app/api/routes.py - Prediction endpoint → Prediction inference: requests prediction
app/api/routes.py - Prediction endpoint → Comparable-market insights: requests insights
app/api/routes.py - Prediction inference → Feature preparation: prepares features
app/services/inference.py - Prediction inference → Preprocessing pipeline: transforms features
app/services/inference.py - Prediction inference → Model artifacts: uses loaded model and preprocessor
app/services/inference.py - Prediction inference → Trained price model: predicts price
app/services/inference.py - Feature preparation → Input cleaning: uses cleaning utilities
app/services/features.py - Input cleaning → Preprocess settings: reads cleaning settings
src/cleaning/cleaning_utils.py - Preprocessing pipeline → Missing-value imputation: applies imputation
src/preprocess/preprocess_features.py - Preprocessing pipeline → Categorical encoding: applies encoding
src/preprocess/preprocess_features.py - Preprocessing pipeline → Numeric transforms: applies numeric transforms
src/preprocess/preprocess_features.py - Preprocessing pipeline → Feature scaling: applies scaling
src/preprocess/preprocess_features.py - Categorical encoding → Preprocess settings: reads encoding settings
src/preprocess/encoding.py - Missing-value imputation → Preprocess settings: reads imputation settings
src/preprocess/imputation.py - Numeric transforms → Preprocess settings: reads transform settings
src/preprocess/numeric_transformation.py - Feature scaling → Preprocess settings: reads scaling settings
src/preprocess/scaling.py - Comparable-market insights → Model artifacts: uses reference listings
app/services/insights.py - Comparable-market insights → Reference listings: searches comparables
app/services/insights.py - Pricing interface → Request and response: renders returned insights
- Model artifacts → Trained price model: loads trained model
- Data preparation → Exploratory analysis: analyzes prepared data
- Exploratory analysis → Feature diagnostics: informs feature analysis
- Feature diagnostics → Model training and evaluation: supports model development
- Model training and evaluation → Trained price model: produces deployed model