SkyPrice was my thesis project on apartment asking prices in Mexico City. I brought data preparation, regression models, an API and an interface together to explore what we could estimate from property listings.
SkyPrice#
Introduction#
SkyPrice is a web application designed to estimate the prices of apartments in Mexico City using regression models. This project, part of my BSc thesis at ESCOM, IPN, uses real estate listing data to explore how well regression models can estimate asking prices. Asking prices and completed sale prices are different targets; this project does not establish an appraisal value.

Visit the SkyPrice website: https://skyprice.xyz to explore
the application and learn more about the project.
Motivation#
I wanted to explore how property characteristics and location relate to asking prices, and make that experiment accessible through an application. The modeling and geographic context connect to earlier work on valuation methods1 and geographic information systems2, while the project itself uses the narrower target of prices advertised in listings.
Technologies Used#
I used the following tools:
- Machine Learning (ML) for the regression models trained on real estate data.
- FastAPI for backend API development.
- React and Next.js with Material-UI for frontend
- KeplerGL for data visualization
- Telegram API for Chatbot
- OpenAI for natural language processing.
- Docker for containerization
- AWS for deployment
Data#
The project combined listing information with contextual datasets from sources including datos.gob.mx and the Mexico City data portal. The datasets incorporated include:
- Real estate listings with price and property details, extracted from online platforms.
- Locations of hospitals, schools, universities, malls, supermarkets.
- Historical earthquake data.
- Postal codes.
- Demographic information.
- Acoustic and water contamination data.

Importance of Each Dataset#
The listing data and contextual map layers have different roles. The API example below lists the property inputs used to request a prediction; displaying another dataset on a map does not establish that it was used as a model feature:
- Real estate listings: Provide the core data for price estimation, including property details and prices. This data is used for training and testing the models.
- Hospitals, schools, etc.: Influence the desirability and value of the location.
- Earthquake data: Important for assessing risk factors.
- Demographic information: Help in geospatial analysis and segmentation.
Data Challenges and Solutions#
We faced several challenges in data collection and cleaning:
- Inconsistencies in data formats: Addressed by standardizing formats during preprocessing.
- Missing values: Handled through imputation techniques.
- Data integration: Visualized with KeplerGL.
- Natural language processing: Utilized OpenAI for processing unstructured data in the chatbot.
Methodology#
The methodology of SkyPrice involves several key steps:
- Data Collection and Cleaning: Gathering data from multiple online platforms and applying preprocessing for the model inputs.
- Model Selection and Training: Using regression models such as SVM, Random Forest, and Neural Network. A grid of hyperparameters was used to fine-tune the models.
- Model Evaluation: Comparing the performance of different models using metrics like R², Mean Absolute Error (MAE), and Root Mean Squared Error (RMSE).
The following diagram illustrates the methodology of SkyPrice (in spanish):

Detailed Process#
- Data Preprocessing: Included handling missing values, normalizing data, and encoding categorical variables.
- Feature Selection: Identified key features that impact apartment prices, such as location, size, and proximity to amenities.
- Model Training: Used a combination of SVM, Random Forest, and Neural Network with hyperparameter tuning.
Model Performance#
We evaluated the models using metrics like R², Mean Absolute Error (MAE), and Root Mean Squared Error (RMSE), and selected the best-performing model based on these evaluations for each algorithm.
The following plots show the predictions vs. actual prices for each model:

Public API#
I built a FastAPI service with endpoints for estimates, model and dataset metadata, and plots comparing predictions with listing prices.
The project used an AWS deployment at https://api.skyprice.xyz.
The examples and screenshots document the thesis application. The linked deployment and its availability may have changed since the project was published.
API Documentation#
The API docs describe the endpoints and their inputs. Swagger UI · Redoc.

Predict Endpoint#
The /predict endpoint allows users to input property details and get price
predictions. The input JSON should include the following fields:
Size_Terrain: Size of the terrain in square meters.Size_Construction: Size of the construction in square meters.Bedrooms: Number of bedrooms.Bathrooms: Number of bathrooms.Parking: Number of parking spaces.Age: Age of the property in years.Lat: Latitude of the property.Lon: Longitude of the property.Municipality: Municipality where the property is located.
And the output JSON will include the predicted price for each model, allowing users to compare the predictions.
Example API Request#
{
"Size_Terrain": 140,
"Size_Construction": 130,
"Bedrooms": 3,
"Bathrooms": 2,
"Parking": 2,
"Age": 7,
"Lat": 19.4326,
"Lon": -99.1332,
"Municipality": "Álvaro Obregón"
}
Example API Response#
{
"Random_Forest": 6420750.0,
"SVM": 6164968.58,
"Neural_Network": 5167572.5
}
Metadata Endpoint#
The /models endpoint provides metadata about the models used in the API,
including information about the features, hyperparameters, and evaluation metrics.
It also includes information about the data used for training the models.
Example Metadata Response#
{
"dataset": {
"original": [32520, 18],
"training": {
"X": [11169, 9],
"y": [11169, 1]
},
"testing": {
"X": [3724, 9],
"y": [3724, 1]
}
},
"models": {
"random_forest": {
"mse": 2767108007816.376,
"rmse": 1663462.6559728885,
"ci": [-3288575.5823341985, 3232135.171812599],
"mae": 704079.571484675,
"r2": 0.9038900065218292,
"feature_importances": [
0.0011281899895630631, 0.0017738994702383077, 0.0019866359182250486,
0.0007018637582167237, 0.0014665387673904304, 0.0023498577692012985,
0.00004089436452670091, 0.000018750183784930174,
0.000025032684545761422, 0.0001471126291344862, 0.0022393854044217604,
0, 0.0000018591757405458183, 0.00033878248531502486,
0.000024947352434527034, 0.000004803359328795989, 0.10737325614938063,
0.6581596171662714, 0.018088970068768237, 0.0078064922484012405,
0.011072231256017567, 0.06306614405016867, 0.05947059290138905,
0.06271414284753582
],
"max_features": 1,
"max_depth": 30,
"n_estimators": 1000,
"oob_score": true
},
"svm": {
"mse": 8718507842976.787,
"rmse": 2952711.947172766,
"ci": [-6072782.238924998, 5435880.829712623],
"mae": 1843353.6959805356,
"r2": 0.697179969281674,
"kernel": "linear",
"C": 1000,
"epsilon": 0.01
},
"neural_network": {
"mse": 6774725145058.313,
"rmse": 2602830.2182544125,
"ci": [-5522911.848758079, 4471074.026658187],
"mae": 1597042.1520542428,
"r2": 0.637984037399292,
"learning_rate": 0.10000000149011612,
"beta_1": 0.9,
"beta_2": 0.999,
"epsilon": 1e-7
}
}
}
Reading the reported errors#
The metadata example above reports a Random Forest MAE of about MXN 704,080, an RMSE of about MXN 1,663,463, and an of about 0.904. Those describe performance on the project’s test split. A high does not make the peso error small, and MAE does not bound the error for an individual apartment.
The article does not document enough about duplicate listings or the geographical and temporal separation of training and test data to establish how well those results generalize. It also does not explain how the ci values were calculated, so they should not be interpreted here as calibrated prediction intervals.
For a stronger evaluation, I would want a baseline, a documented split strategy, and errors broken down by price range and location. The numbers are worth showing with those limits alongside them.
Web Application#
I built the web app with React, Next.js, and Material UI.
User Interface Design#
The forms adapt to different screen widths, and the interface is available in Spanish, French, Portuguese, and English.

Price Prediction Tool#
Enter the apartment details to see the estimates from each of the three models side by side.


Currency Conversion#
The prices are displayed in Mexican Pesos (MXN), but the application also provides a currency conversion feature that allows users to view the prices in other currencies, such as USD, EUR, or CAD.

Interactive Map#
I used KeplerGL to put apartment listings and nearby services, including schools and hospitals, on the same map.

If you want to explore the interactive map, you can visit the
SkyPrice website: https://skyprice.xyz.
Model Information#
This page shows the data sources, the regression methods, and the plots comparing their results.

Telegram Chatbot#
I also built a Telegram bot that takes a property description in a message. Open @SkyPriceChatbot.
Setup and Features#
The bot’s instructions are in Spanish, and it can interpret descriptions in other languages. It also links to the web app for the map and model information.

Example Interaction#
The chatbot tries to extract the necessary information from the user’s input and provides a detailed response with price predictions. Here’s an example interaction:
User: “Quiero saber el precio de un departamento en Álvaro Obregón con 3 recámaras, 2 baños y 2 estacionamientos, de 140m² de terreno y 130m² de construcción, con 7 años de antigüedad.”3
SkyPriceChatbot:
🏢 Detalles del departamento extraídos:
📏 Tamaño del terreno: 140m²
🏗️ Tamaño de la construcción: 130m²
🛏️ Número de habitaciones: 3
🚽 Número de baños: 2
🚗 Número de estacionamientos: 2
🕰️ Antigüedad: 7 años
🌍 Alcaldía: Álvaro Obregón
💰 Precios estimados:
🌳 Random Forest: $6,420,750.00 MXN
📈 SVM: $6,164,968.58 MXN
🧠 Neural Network: $5,167,572.50 MXN
🔍 Puedes encontrar más detalles en https://skyprice.xyz 🏡
Methodology and Implementation#
The bot uses GPT-3.5 to pull the property details out of the message, sends those fields to the prediction endpoint, and replies with the fields it extracted and the three estimates.
Conclusion#
SkyPrice brought data preparation, regression models, an API, a map and a chatbot into one thesis project. The screenshots show the application I built; the reported metrics need the evaluation context described above.
The reported metrics do not explain where the estimates fail; that still needs examination.
A continuing interest in housing data#
Before SkyPrice, I co-founded FetchBug and Valú, working on data services and real estate reports. SkyPrice is a separate academic project, with its own dataset, model comparisons and evaluation.
Footnotes
-
E. Pagourtzi, V. Assimakopoulos, and T. Hatzichristos, “Real estate appraisal: a review of valuation methods,” J. Property Invest. Finance, vol. 21, no. 4, pp. 383–401, 2003. ↩
-
Z. Nedović-Budić, A. K. Pinto, and L. D. Budic, “Gis database deve- lopment and exchange: Interaction mechanisms and motivations,” J. Urban Plan. Dev., vol. 126, no. 2, pp. 51–73, 2000. ↩
-
“I want to know the price of an apartment in Álvaro Obregón with 3 bedrooms, 2 bathrooms, and 2 parking spaces, 140m² of land and 130m² of construction, 7 years old.” ↩
-
- 🏢 Apartment details extracted:
- 📏 Land size: 140m²
- 🏗️ Construction size: 130m²
- 🛏️ Number of bedrooms: 3
- 🚽 Number of bathrooms: 2
- 🚗 Number of parking spaces: 2
- 🕰️ Age: 7 years
- 🌍 Borough: Álvaro Obregón
- 💰 Estimated prices:
- 🌳 Random Forest: $6,420,750.00 MXN
- 📈 SVM: $6,164,968.58 MXN
- 🧠 Neural Network: $5,167,572.50 MXN
- 🔍 You can find more details at https://skyprice.xyz 🏡