Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2026 Jul 25;16:23225. doi: 10.1038/s41598-026-62854-z

House price prediction using a hybrid GRU–MLP based on binary whale optimization algorithm and ant colony optimization for hyperparameter tuning

Sarah M Alhammad 1, Yasser Fouad 2, Amira A Mahmoud 3, Ahmed M Osman 4, Hazem M El-Bakry 5, Ahmed M Elshewey 2,✉
PMCID: PMC13401595  PMID: 42502102

Abstract

Accurate house price prediction is essential for real estate valuation, investment planning, and intelligent property decision-support systems. This study proposes an optimized hybrid deep learning framework that integrates a Gated Recurrent Unit and Multilayer Perceptron model with the Binary Whale Optimization Algorithm for feature selection and Ant Colony Optimization for hyperparameter tuning. The proposed framework was evaluated using a publicly available Kaggle house price regression dataset containing 500 housing records with structural, locational, and amenity-related attributes. The dataset was divided into training, validation, and testing subsets using a 70:20:10 ratio, and leakage-free normalization was applied using only the training data. Experimental results show that the proposed BWOA–ACO–GRU–MLP model outperformed standalone GRU, MLP, CNN, LSTM, and BiLSTM models. It achieved an MSE of 0.0146, MAE of 0.1051, RMSE of 0.1208, MAPE of 0.0112, MedAE of 0.0969, and an R2 of 99.04%. These results demonstrate that combining feature selection, hyperparameter optimization, and hybrid neural regression improves prediction accuracy and model stability for house price estimation. The proposed framework provides a reliable data-driven approach for smart real estate valuation applications.

Keywords: Hybrid deep learning, GRU–MLP model, House price prediction, Metaheuristic optimization, Binary whale optimization algorithm (BWOA), Ant colony optimization (ACO), Hyperparameter tuning, Regression modeling

Subject terms: Engineering, Mathematics and computing

Introduction

Housing price prediction is currently considered one of the most prominent topics within intelligent real estate analytics since the property evaluation is relevant to many processes, including investment, appraisal, tax assessments, urban development, and housing policies. Conventional housing price modeling techniques, including hedonic pricing and regression analysis, usually lack flexibility, rely on predefined assumptions, and are characterized by low sensitivity to nonlinear interactions between various factors such as structural characteristics, spatial effects, economic indicators, and environment-related attributes1,2. To address the mentioned limitations, the use of machine learning and deep learning methods was proposed in numerous academic studies, since they enable the learning of complex patterns from heterogeneous data and enhance the efficiency of automated valuation models. As an illustration, Park & Bae3 presented machine learning algorithms for predicting housing prices and showed that data-driven methods were beneficial for real estate applications. Moreover, several other recent automated housing price valuation models confirmed the efficiency of machine learning and deep learning models.

Studies conducted have again shown that there is more to real estate price prediction than just using classical regression methods. With automated value estimation models, the use of ensembles, deep neural networks, gradient boosting, spatial information, description texts, and even explainable artificial intelligence can be utilized. Jafary et al.1 developed automated valuation models for land that considered physical, geographic, socio-economic, environmental, legal, and planning information about the land. As shown by the study, it was possible for machine learning techniques like XGBoost to produce better results than classical methods. Baur et al.4, on the other hand, examined the use of machine learning for automated real estate valuation, considering property descriptions.

Despite this progress, predicting house prices still poses some challenges as there are many interacting variables that determine the cost of housing, such as house size, the number of rooms in a house, age of construction, quality of the location, presence of amenities, and proximity to cities. The relationships among these variables might be complex in nature and require more advanced approaches than traditional models to obtain highly accurate predictions. Recently, many studies on housing prices have revealed that machine learning algorithms can model nonlinear market dynamics and heterogeneities well, and explainable models have also been developed to understand how the location and properties influence prices5,6.

The other major challenge is model optimization. Machine learning and deep learning models are very dependent on hyperparameters like learning rate, the number of hidden layers, dropout ratio, batch size, and architecture depth. Hyperparameters selected wrongly will cause overfitting, instabilities in convergence, and poor generalization ability. Optimization algorithms are therefore critical in improving the accuracy of forecasts in hybrid models7. For example, Zhan et al.8 suggested a hybrid Bayesian optimization algorithm using stacking, bagging, and transformer models for house price prediction. Metaheuristic optimization has proven effective in deep learning problems by discovering the best configurations compared to human intervention.

The deep learning architecture, including GRU, LSTM, CNN, and MLP, is extensively used in predicting tasks because of its ability to model nonlinear relations and interactions between different features. GRU networks are especially helpful because they offer a simplified recurrent architecture compared to LSTM, but still have the capacity to model sequence dependencies. Meanwhile, MLP is a powerful universal function approximation tool for tabular regression tasks that learns nonlinear functions mapping input variables to continuous output values. Recent hybrid models demonstrate that using GRU in combination with other neural network models improves prediction performance in nonlinear prediction tasks. At the same time, optimizing GRU networks leads to good results in real-world prediction tasks9,10.

However, the existing literature still presents several limitations. First, many studies rely mainly on standalone machine learning models, such as Random Forest, XGBoost, Support Vector Regression, or standard neural networks, without sufficiently investigating hybrid recurrent–feedforward architectures for house price regression. Second, although optimization algorithms have been applied in several forecasting domains, the integration of the Binary Whale Optimization Algorithm and Ant Colony Optimization for hyperparameter tuning in house price prediction remains underexplored. Third, many previous studies focus only on predictive accuracy but provide limited comparative analysis across deep learning baselines such as GRU, MLP, CNN, LSTM, and BiLSTM11,12. Fourth, some studies do not sufficiently analyze convergence behavior, training–validation stability, or error-based regression indicators such as MSE, MAE, RMSE, MAPE, MedAE, and R2 together. These gaps motivate the development of a hybrid optimized deep learning model that can provide more accurate, stable, and generalizable house price predictions.

This study addresses the weaknesses by proposing a GRU–MLP hybrid architecture trained using the Binary Whale Optimization Algorithm for feature selection and Ant Colony Optimization to predict house prices. Although the housing dataset used in this study is tabular and does not contain natural temporal sequences, the GRU component is employed as a gated nonlinear feature-interaction encoder rather than as a conventional time-series forecasting model. After BWOA-based feature selection, each housing record is represented as a fixed ordered vector of normalized attributes, including structural, amenity-related, and locational variables. The GRU gates allow the model to selectively retain, suppress, and combine information across these attributes, thereby learning compact feature representations before the final regression stage. The MLP component is then used to map the learned representation to the continuous house price output. To assess the model’s efficacy in predicting house prices, an open-source housing price regression dataset from Kaggle with 500 instances is used. This data set incorporates numerous attributes related to structural and location characteristics of houses, such as square feet, number of bedrooms, number of bathrooms, number of floors, year built, presence of a garden, pool, garage size, location rating, proximity to downtown, and price. The data set is partitioned into training, validation, and test sets in the ratio of 70:20:10. The findings obtained reveal that the proposed GRU–MLP model performs better than other models, achieving MSE = 0.0146, MAPE = 0.0112, MedAE = 0.0969, MAE = 0.1051, RMSE = 0.1208, and R2 = 99.04%.

The main contributions of this study are summarized as follows:

  1. Proposing a hybrid deep learning model combining GRU and MLP for enhanced nonlinear regression in house price prediction.

  2. Integrating BWOA for feature selection, effectively reducing redundancy and improving predictive performance.

  3. Applying ACO for hyperparameter tuning to enhance convergence and model generalization.

  4. Conducting a comprehensive comparative analysis with multiple deep learning baselines.

  5. Demonstrating the effectiveness of combining feature selection and optimization techniques in a unified predictive framework.

The remainder of this paper is organized as follows. "Related works" section reviews related work on house price prediction and optimization techniques. "Materials and methods" section presents the proposed methodology, including BWOA-based feature selection and ACO-based hyperparameter tuning. "Experimental setup" section describes the experimental setup and evaluation metrics. "Results and discussion" section discusses the results and comparative analysis. Finally, "Conclusion and future work" section concludes the paper and outlines future research directions.

Related works

There have been considerable recent advances in house price prediction owing to the ever-increasing sophistication of the real estate market and the availability of data. Among traditional approaches for predicting real estate prices are hedonic regression models and index methods that have been popular over the years. However, their major limitation is that they are not efficient at modeling the complex relationship between various factors affecting house prices. Hence, there has been an exploration of numerous methods based on machine learning and deep learning algorithms to improve predictive performance and model robustness. This has also led to new research areas, including feature engineering and model optimization, in order to boost performance even further and increase interpretability. There still remain some problems with high-dimensional data, selecting appropriate features, avoiding overfitting, and defining model objectives consistent with real-world application scenarios. In this regard, this paper will review the most related studies on house price prediction utilizing machine learning models, hybrid modeling techniques, feature selection approaches, and optimization-based methods.

The research conducted by Adetunji et al.13. It is about the prediction of house prices while considering the drawbacks of conventional measures like the House Price Index (HPI). According to the research, the prediction of house prices should not rely solely on the identification of overall market trends, but it should also consider predicting the prices and/or the price ranges of properties. Predicting a variance or range would make sense and be applicable in practical situations, which made the problem a matter of classification. In order to mitigate the shortcomings of HPI, the researchers considered the inclusion of more attributes about the property and location of each property. The Random Forest algorithm was implemented using the Boston Housing data set containing 506 instances of 14 attributes available at the UCI Repository. The results have shown that the implemented method performed reliably by providing predicted prices almost equal to actual prices in error margins of ± 5%.

The problem of the complexity of property evaluation was discussed by Zaki et al.14. In this case, the complexity is caused by the impact of space, time, and economy, making it difficult to estimate the price accurately. Although the classical methods for evaluating property, including the hedonic regression model, have been applied frequently, they still face the drawbacks of limited accuracy and failure to address non-linear problems. Thus, the paper proposed a novel machine learning approach incorporating the Extreme Gradient Boosting algorithm with the outlier sum-statistic method. Both XGBoost and hedonic regression models were constructed based on 13 independent variables to predict housing prices. The experiment revealed that the XGBoost model exhibited more accurate prediction (84.1%) than the classic regression model (42%).

Sharma et al.15 investigated house price prediction as a regression problem, emphasizing that property valuation is influenced not only by structural attributes but also by neighborhood and environmental factors. The study utilized the Ames Housing dataset to evaluate multiple machine learning models, including XGBoost, Support Vector Regressor, Random Forest, Multilayer Perceptron, and Multiple Linear Regression. In addition to predictive modeling, the research focused on identifying the most influential factors affecting housing prices, providing interpretability alongside performance. Experimental results revealed that XGBoost achieved the highest predictive accuracy among the evaluated models, demonstrating its superiority in capturing complex nonlinear relationships in housing data.

Mora-García et al.16 explored the application of machine learning techniques for house price prediction using large-scale georeferenced microdata, with a particular focus on analyzing the impact of the COVID-19 pandemic on real estate markets. The study implemented a comprehensive framework that included data preprocessing, feature engineering, hyperparameter optimization, model evaluation, and interpretability analysis. Multiple machine learning models were evaluated, including boosting-based methods (Gradient Boosting Regressor, XGBoost, and LightGBM) and bagging-based approaches (Random Forest and Extra Trees), alongside a traditional linear regression baseline. The experimental analysis, conducted on real estate data from Alicante, Spain, demonstrated that machine learning models significantly outperform linear models due to their ability to capture complex nonlinear relationships in housing data. Furthermore, boosting algorithms exhibited superior performance and reduced overfitting compared to bagging methods.

Zhan et al.8 proposed an advanced hybrid framework for house price prediction aimed at improving forecasting accuracy and model stability in complex real estate markets. The study introduced novel hybrid models that integrate Bayesian Optimization with ensemble learning techniques, including stacking, bagging, and Transformer-based architectures. These models leverage Bayesian Optimization for efficient hyperparameter tuning, enabling enhanced predictive performance across diverse scenarios. A key contribution of the study is the construction of a large-scale, multi-source dataset comprising approximately 1.9 million real estate transactions from the Hong Kong market spanning over two decades, providing a robust benchmark for model evaluation. The proposed models were rigorously compared against 18 baseline methods using 13 evaluation metrics, along with statistical significance tests such as Friedman, Iman–Davenport, and Nemenyi post-hoc analysis. Experimental results demonstrated that the hybrid stacking-based model (HBOS-CatBoost) achieved superior performance, with notable reductions in RMSE compared to other hybrid configurations.

Akyüz et al.17 proposed a dynamic hybrid framework for house price prediction designed to address the heteroscedastic and highly variable nature of real estate data. The study integrates multiple techniques, including linear regression, clustering analysis, nearest neighbor classification, and Support Vector Regression (SVR), within a unified pipeline where the output of one stage serves as the input to subsequent stages. The approach first partitions housing data into homogeneous clusters, then classifies new instances into appropriate groups, and finally applies specialized regression models for each cluster to improve prediction accuracy. The proposed model was evaluated using real-world housing data collected from the Kadıköy district in Istanbul, as well as a benchmark Kaggle dataset with diverse property features. Comparative analysis against several baseline models, including linear regression, Lasso, Ridge, SVR, AdaBoost, decision tree, random forest, and XGBoost, demonstrated that the hybrid approach achieved superior performance in terms of RMSE, MAPE, and adjusted R2.

Hjort et al.18 investigated the performance evaluation of Automated Valuation Models (AVMs) in the context of real estate price estimation, emphasizing the discrepancy between traditional optimization objectives and industry-relevant evaluation metrics. While most machine learning models, including gradient boosted trees and random forests, are typically trained to minimize mean squared error, the study argued that real-world financial institutions assess model performance based on the proportion of predictions falling within predefined error margins (± 10% and ± 20%). To address this gap, the authors proposed a modified loss function aligned with these practical evaluation criteria and applied it within a gradient boosted tree framework. Using a large dataset comprising 126,719 housing transactions from the Norwegian market, the results demonstrated improved predictive performance, increasing the proportion of predictions within ± 20% error from 89.4 to 90.0%. Furthermore, combining models optimized with different loss functions yielded additional improvements, achieving 90.4% accuracy within the same range.

Lahmiri et al.19 investigated the effectiveness of advanced artificial intelligence and machine learning techniques for house price prediction in response to increasing demand for accurate valuation systems following global financial and real estate crises. The study compared multiple predictive approaches, including boosting ensemble regression trees, support vector regression, and Gaussian process regression, within a rigorous framework incorporating Bayesian optimization and ten-fold cross-validation for optimal parameter tuning. Using multiple evaluation metrics, the results demonstrated that boosting ensemble regression trees achieved the highest predictive performance, followed by Gaussian process regression and support vector regression. Furthermore, all proposed models significantly outperformed traditional approaches such as artificial neural networks and multivariate regression.

Sibindi et al.20 examined the complexity of property valuation, emphasizing the challenges associated with modeling housing prices due to spatial, temporal, and economic dependencies. To improve predictive accuracy, the study explored the integration of machine learning techniques with traditional valuation approaches. Specifically, the authors combined the Extreme Gradient Boosting (XGBoost) algorithm with an outlier sum-statistic (OS) method to enhance model robustness and handle irregularities in housing data. The proposed framework was evaluated using 13 input variables and compared against the conventional hedonic pricing model. Experimental results demonstrated that the XGBoost-based approach significantly outperformed the traditional method, achieving an accuracy of 84.1% compared to 42% for hedonic regression.

Rey-Blanco et al.21 addressed the critical role of location factors in house price prediction by proposing an advanced methodology for constructing comprehensive accessibility-based location indices. The study highlighted the limitations of traditional location modeling, including the lack of consensus on index construction, difficulty in selecting relevant variables, and the need for granular and up-to-date datasets. To overcome these challenges, the authors developed a data-driven framework that generates car and walk accessibility indices using automated search techniques to identify optimal variable combinations. Principal Component Analysis (PCA) was subsequently applied to ensure orthogonality and reduce multicollinearity among the generated indices. The proposed indices were evaluated using both regression models and random forest algorithms on a large real estate dataset from Madrid. Experimental results demonstrated significant improvements in predictive accuracy, with gains of 13% for regression models and 21.6% for random forests, alongside a notable reduction in spatial autocorrelation by approximately 35%.

Alzain et al.22 investigated the application of artificial neural networks (ANN) for house price prediction, emphasizing the importance of accurate valuation models in supporting economic planning, investment decisions, and government regulation. The study developed an ANN-based predictive framework tailored to the Saudi Arabian real estate market, utilizing housing data collected from major cities, including Riyadh, Jeddah, Dammam, and Al-Khobar. The proposed model was designed to capture complex nonlinear relationships between housing attributes and price distributions across different geographic regions. Experimental results demonstrated that the ANN model achieved high predictive accuracy, with predicted values closely matching actual market prices. Comparative analysis with existing prediction methods further confirmed the effectiveness of the proposed approach.

The reviewed studies collectively demonstrate that machine learning and hybrid models have significantly improved house price prediction by capturing nonlinear relationships, leveraging ensemble learning (e.g., XGBoost, boosting trees), incorporating spatial and accessibility features, and applying optimization techniques such as Bayesian tuning. However, most existing works focus either on model development (e.g., ANN, boosting, hybrid clustering–regression frameworks) or optimization strategies independently, with limited integration of feature selection and hyperparameter optimization within a unified pipeline. In addition, several studies rely on traditional evaluation settings or lack a comprehensive comparative analysis across deep learning architectures. In contrast, the present study advances the field by proposing a fully integrated framework that combines Binary Whale Optimization Algorithm (BWOA) for feature selection, Ant Colony Optimization (ACO) for hyperparameter tuning, and a hybrid GRU–MLP deep learning model. This unified approach addresses key limitations in prior work by simultaneously reducing feature redundancy, improving model convergence, and enhancing predictive accuracy, thereby providing a more robust, efficient, and scalable solution for house price prediction.

Materials and methods

Dataset description

This study uses a publicly available house price regression dataset obtained from Kaggle23. The dataset is designed for supervised regression analysis, where the objective is to predict the continuous target variable, Price, based on several structural, locational, and amenity-related housing attributes. The dataset contains 500 housing records and 11 variables, including 10 independent input features and one dependent output variable. According to the dataset summary, the features include property size, number of rooms, construction year, availability of facilities such as garden and pool, garage size, location quality, and distance from the city center. The dataset was divided into training, validation, and testing subsets using a 70:20:10 ratio, allowing the model to learn from the training data, optimize performance using the validation set, and finally evaluate generalization on an unseen test set. This partitioning strategy supports a fair assessment of the proposed GRU–MLP model and the baseline models, while reducing the risk of overfitting to the training data.

Although the dataset provides useful structural, locational, and amenity-related housing attributes, its size is relatively limited, with only 500 records. Therefore, the results obtained from a single holdout test set should not be interpreted as definitive evidence of broad market-level generalization. To reduce the dependence of the evaluation on one random split, the experimental protocol was extended using repeated k-fold cross-validation. This strategy allows all samples to contribute to testing across different folds and provides a more reliable estimate of model stability than a single 50-sample test subset.

Table 1 presents the descriptive statistical summary of the housing dataset used in this study, including 500 records for each variable. The dataset contains structural features such as Square_Feet, Num_Bedrooms, Num_Bathrooms, Num_Floors, and Year_Built, as well as amenity and location-related variables such as Has_Garden, Has_Pool, Garage_Size, Location_Score, and Distance_to_Center. The average house size is approximately 174.64 square feet, while the mean number of bedrooms and bathrooms is 2.96 and 1.98, respectively. The target variable, Price, shows considerable variation, ranging from 276,892.47 to 960,678.27, with a mean of 582,209.63 and a standard deviation of 122,273.39. This wide price range indicates that the dataset contains diverse housing samples, making it suitable for evaluating regression models. Moreover, the variation in location score, distance to the city center, garage size, and amenity availability suggests that both structural and spatial factors may contribute significantly to house price prediction, supporting the need for an optimized feature selection and deep learning-based prediction framework.

Table 1.

Descriptive statistical summary of the housing price prediction dataset.

Variable Count Mean Std. Dev Min Median Max
Square_Feet 500 174.64 74.67 51.27 178.29 298.24
Num_Bedrooms 500 2.96 1.44 1.00 3.00 5.00
Num_Bathrooms 500 1.98 0.82 1.00 2.00 3.00
Num_Floors 500 1.96 0.80 1.00 2.00 3.00
Year_Built 500 1957.60 35.49 1900.00 1959.00 2022.00
Has_Garden 500 0.54 0.50 0.00 1.00 1.00
Has_Pool 500 0.49 0.50 0.00 0.00 1.00
Garage_Size 500 30.17 11.58 10.00 30.00 49.00
Location_Score 500 5.16 2.85 0.00 5.21 10.00
Distance_to_Center 500 10.47 5.59 0.06 10.89 19.93
Price 500 582209.63 122273.39 276892.47 574724.11 960678.27

Figure 1 illustrates the correlation matrix among the input variables and the target variable Price. The results show that Square_Feet and Num_Bedrooms have the strongest positive correlations with house price, each reaching approximately 0.56, indicating that larger houses and houses with more bedrooms tend to have higher prices. Year_Built also shows a moderate positive relationship with price (0.42), suggesting that newer properties may be associated with higher market value. Other variables, such as Num_Floors (0.18), Num_Bathrooms (0.16), Has_Pool (0.14), and Has_Garden (0.11), show weaker but still positive associations with price. In contrast, Garage_Size, Location_Score, and Distance_to_Center exhibit very weak correlations with the target variable in this dataset.

Fig. 1.

Fig. 1

Correlation heatmap showing relationships among housing attributes and house price.

Figure 2 presents the density distributions of the housing dataset variables, providing an overview of how each feature is distributed before model training. The plots show that several structural variables, such as Num_Bedrooms, Num_Bathrooms, and Num_Floors, follow discrete multi-peak distributions because they represent count-based property attributes. The binary amenity variables Has_Garden and Has_Pool show two distinct peaks at 0 and 1, reflecting the absence or presence of these facilities. Continuous variables such as Square_Feet, Garage_Size, Location_Score, and Distance_to_Center display broader distributions, indicating variability among housing samples. The target variable Price appears approximately bell-shaped with a concentration around the middle price range, suggesting that most properties fall within a moderate price interval while fewer samples exist at the extreme low and high price ranges.

Fig. 2.

Fig. 2

Density distribution plots of structural, locational, amenity-related, and target variables in the housing dataset.

Figure 3 presents the boxplot analysis of the housing dataset variables, showing the median, interquartile range, spread, and potential outliers for each feature. The plots indicate that Square_Feet, Garage_Size, Location_Score, and Distance_to_Center have relatively wide distributions, reflecting variability in property size, garage capacity, location quality, and accessibility. Count-based variables such as Num_Bedrooms, Num_Bathrooms, and Num_Floors show limited discrete ranges, while Has_Garden and Has_Pool confirm their binary nature through values concentrated at 0 and 1. The Year_Built variable spans from older to newer properties, indicating temporal diversity in the dataset. For the target variable Price, the boxplot shows a central concentration around the median price, with a few high-value outliers above the upper whisker, suggesting the presence of some expensive properties.

Fig. 3.

Fig. 3

Boxplot analysis of housing dataset features and target price distribution.

Figure 4 shows the histogram-based frequency distribution of all housing attributes and the target variable Price, providing a clearer view of how the dataset samples are distributed across different value ranges. The structural variables show diverse patterns: Square_Feet is spread across a wide interval, indicating variation in house sizes, while Num_Bedrooms, Num_Bathrooms, and Num_Floors appear as discrete distributions because they represent count-based features. The binary variables Has_Garden and Has_Pool are divided into two categories, confirming the balanced presence and absence of these amenities in the dataset. Continuous variables such as Garage_Size, Location_Score, and Distance_to_Center show broad distributions, suggesting that the dataset includes properties with different garage capacities, location qualities, and distances from the city center. The Price histogram follows an approximately normal distribution, with most houses concentrated around the middle price range and fewer observations at the lower and upper extremes.

Fig. 4.

Fig. 4

Histogram distributions of housing dataset features and target house price.

Data preprocessing

Data preprocessing was conducted to prepare the housing dataset for reliable feature selection, hyperparameter optimization, and regression modeling. The dataset contains numerical, binary, structural, locational, and amenity-related variables; therefore, preprocessing was necessary to ensure data consistency, reduce scale bias, prevent data leakage, and improve the stability of the proposed BWOA–ACO–GRU–MLP framework.

Dataset Representation

The housing dataset can be represented as a supervised regression dataset:

graphic file with name d33e700.gif 1

where Inline graphic denotes the input feature vector of the Inline graphic-th house, Inline graphic represents the corresponding house price, Inline graphic is the number of samples, and Inline graphic is the number of input features.

Each input vector is defined as:

graphic file with name d33e728.gif 2

where the input attributes include Square_Feet, Num_Bedrooms, Num_Bathrooms, Num_Floors, Year_Built, Has_Garden, Has_Pool, Garage_Size, Location_Score, and Distance_to_Center. The target variable is Price.

The prediction problem is formulated as learning a nonlinear mapping function between housing attributes and house prices:

graphic file with name d33e735.gif 3

where Inline graphic is the predicted house price and Inline graphic denotes the learnable parameters of the prediction model.

Missing Value Inspection

Missing-value inspection was performed to ensure data completeness before model training. For each feature Inline graphic the missing-value ratio was computed as:

graphic file with name d33e756.gif 4

where Inline graphic denotes the missing-value ratio of the Inline graphic-th feature, Inline graphic is an indicator function, and Inline graphic represents a missing value.

If missing values are detected in numerical variables, they can be replaced using the median value of the corresponding feature:

graphic file with name d33e780.gif 5

where Inline graphic is the imputed value. In this study, all variables had 500 valid observations, indicating no missing values in the dataset.

Feature–target separation

After checking data completeness, the dataset was divided into the input feature matrix Inline graphic and the target vector Inline graphic. The feature matrix is represented as:

graphic file with name d33e801.gif 6

and the target vector is defined as:

graphic file with name d33e806.gif 7

where:

Inline graphic, The feature matrix Inline graphic was used as the input to the baseline and proposed models, while Inline graphic represented the continuous house price output.

Data splitting

The dataset was initially divided into training, validation, and testing subsets using a 70:20:10 ratio, corresponding to 350 training samples, 100 validation samples, and 50 testing samples. However, because the test subset contains only 50 samples, relying exclusively on this split may lead to high variance in the reported performance. Therefore, repeated k-fold cross-validation was additionally used to obtain a more robust performance estimate. In each repetition, the dataset was partitioned into k folds, where k − 1 folds were used for model development, and the remaining fold was used for testing24,25. The training portion within each fold was further divided into training and validation subsets for BWOA-based feature selection, ACO-based hyperparameter tuning, and early convergence monitoring. All preprocessing operations, including scaling, feature selection, and hyperparameter optimization, were fitted only on the training data of each fold and then applied to the validation and test folds. This protocol prevents data leakage and provides a more reliable estimate of generalization performance on a small dataset.

The split can be mathematically expressed as:

graphic file with name d33e837.gif 8
graphic file with name d33e841.gif 9

The subset sizes are defined as:

graphic file with name d33e847.gif
graphic file with name d33e850.gif
graphic file with name d33e853.gif

Since the dataset contains Inline graphic samples, the resulting split is:

graphic file with name d33e862.gif 10

This splitting strategy ensures that the final model is evaluated on unseen data and reduces the risk of overly optimistic performance estimation.

Feature scaling and normalization

Because the dataset contains variables with different numerical ranges, feature scaling was applied to reduce scale bias during neural network training and optimization. For example, Price, Year_Built, and Square_Feet have larger numerical magnitudes than binary variables such as Has_Garden and Has_Pool. Therefore, min–max normalization was used to transform numerical features into a comparable scale.

For each feature Inline graphic, min–max normalization is defined as:

graphic file with name d33e878.gif 11

where Inline graphic is the normalized value of the Inline graphic-th feature for sample Inline graphic, Inline graphic is the minimum value of the feature, and Inline graphic is the maximum value of the feature.

After normalization, all values are scaled into the range:

graphic file with name d33e906.gif 12

Target variable normalization

The target variable Price was also normalized because it has a large numerical range. Normalizing the target variable helps stabilize model training, reduce gradient instability, and improve convergence speed.

The normalized target value is computed as:

graphic file with name d33e916.gif 13

where Inline graphic is the normalized price value, and Inline graphic and Inline graphic are the minimum and maximum price values.

After prediction, the normalized output can be transformed back into the original price scale using inverse normalization:

graphic file with name d33e935.gif 14

where Inline graphic is the normalized predicted value and Inline graphic is the predicted house price in the original scale.

The target variable Price was normalized using min–max scaling before model training. Therefore, the regression loss and the reported error-based performance metrics were calculated on the normalized target scale. This choice was adopted to ensure numerical stability, reduce the effect of the large price range, and allow direct comparison among models trained under the same preprocessing conditions. Accordingly, MSE, RMSE, MAE, MAPE, and MedAE reported in the experimental results are normalized-scale metrics.

Leakage-free scaling strategy

To avoid data leakage, normalization parameters were computed using only the training subset. The same scaling parameters were then applied to the validation and testing subsets. This step prevents information from the validation or testing data from influencing the preprocessing process.

For each feature in the training set, the minimum and maximum values are computed as:

graphic file with name d33e956.gif 15
graphic file with name d33e960.gif 16

Then, any sample from the validation or testing subset is scaled as:

graphic file with name d33e966.gif 17

This leakage-free preprocessing strategy ensures that model evaluation reflects realistic performance on unseen data.

BWOA-based feature selection

Feature selection was performed using the BWOA26,27 to identify the most relevant housing attributes and remove redundant or weakly informative features. In BWOA, each candidate solution is represented as a binary vector:

graphic file with name d33e983.gif 18

where Inline graphic denotes the Inline graphic-th whale candidate solution, and:

graphic file with name d33e996.gif 19

A value of Inline graphic indicates that the Inline graphic-th feature is selected, while Inline graphic indicates that the feature is excluded.

The selected feature subset is represented as:

graphic file with name d33e1016.gif 20

The total number of selected features is computed as:

graphic file with name d33e1022.gif 21

The fitness function was designed to balance prediction error and feature reduction:

graphic file with name d33e1028.gif 22

where Inline graphic is the validation mean-squared error obtained using the selected feature subset, Inline graphic is the ratio of selected features to the total number of features, and Inline graphic controls the trade-off between prediction accuracy and feature reduction.

The validation mean squared error is calculated as:

graphic file with name d33e1047.gif 23

where Inline graphic is the number of validation samples, Inline graphic is the actual normalized price, and Inline graphic is the predicted normalized price.

Because the original Whale Optimization Algorithm produces continuous position values, a transfer function was used to convert continuous positions into binary feature-selection decisions. The sigmoid transfer function is defined as:

graphic file with name d33e1066.gif 24

The binary update rule is then expressed as:

graphic file with name d33e1072.gif 25

where Inline graphic is a random value, Inline graphic is the updated continuous position, and Inline graphic is the binary decision for the Inline graphic-th feature at iteration Inline graphic.

All ten input variables were included in the initial BWOA search space, including Square_Feet, Num_Bedrooms, Num_Bathrooms, Num_Floors, Year_Built, Has_Garden, Has_Pool, Garage_Size, Location_Score, and Distance_to_Center. Therefore, no feature was manually excluded before optimization. The BWOA algorithm evaluated candidate feature subsets using validation MSE together with a feature-reduction penalty. Unlike simple correlation-based filtering, this wrapper-based selection procedure considers the joint contribution of variables to prediction performance. Consequently, a feature may be selected not only because it has a high individual correlation with Price, but also because it improves validation performance when combined with other variables.

ACO-based hyperparameter tuning

After selecting the optimal feature subset using BWOA, ACO28 was applied to tune the hyperparameters of the proposed GRU–MLP model. ACO searches for the best model configuration by simulating the pheromone-guided path selection behavior of ants.

Each candidate hyperparameter configuration is represented as:

graphic file with name d33e1110.gif 26

where Inline graphic denotes the Inline graphic-th candidate configuration, and Inline graphic is the number of optimized hyperparameters, such as learning rate, GRU units, MLP neurons, dropout rate, batch size, and number of epochs.

The probability of selecting a hyperparameter option is calculated as:

graphic file with name d33e1129.gif 27

where Inline graphic is the probability of selecting option Inline graphic for hyperparameter Inline graphic, Inline graphic is the pheromone intensity, Inline graphic is the heuristic desirability, Inline graphic is the set of available options, and Inline graphic and Inline graphic control the influence of pheromone and heuristic information.

After evaluating candidate configurations, pheromone values are updated as:

graphic file with name d33e1169.gif 28

where Inline graphic is the pheromone evaporation rate and Inline graphic represents the pheromone deposited according to the quality of the solution.

The pheromone deposit is defined as:

graphic file with name d33e1184.gif 29

where Inline graphic is a positive constant and Inline graphic is the validation error obtained by the candidate hyperparameter configuration Inline graphic. Lower validation error produces higher pheromone reinforcement, increasing the probability of selecting effective hyperparameter values in later iterations.

Final training data preparation

After preprocessing, feature scaling, BWOA-based feature selection, and ACO-based hyperparameter tuning, the optimized dataset was used to train the proposed GRU–MLP model. The training objective was to minimize the regression error between the actual and predicted normalized prices.

The loss function is defined as:

graphic file with name d33e1208.gif 30

where Inline graphic is the training loss, Inline graphic is the number of training samples, Inline graphic is the normalized actual price, and Inline graphic is the normalized predicted price.

Thus, the complete preprocessing pipeline ensured that the dataset was clean, properly scaled, leakage-free, dimensionally optimized, and suitable for robust house price prediction using the proposed BWOA–ACO–GRU–MLP framework.

The proposed methodology

Figure 5 illustrates the overall workflow of the proposed BWOA–ACO–GRU–MLP framework for house price prediction. As shown in Fig. 5, the process begins with the housing price dataset, followed by data preprocessing steps, including missing-value checking, feature–target separation, train–validation–test splitting, and normalization. After preprocessing, the Binary WOA is applied to select the most informative housing attributes and reduce redundant features. Then, ACO is employed to optimize the hyperparameters of the hybrid GRU–MLP model. The optimized features and parameters are passed to the GRU component for nonlinear feature learning, followed by the MLP component for regression mapping and final house price prediction. Finally, the model performance is evaluated using MSE, RMSE, MAE, MAPE, MedAE, and Inline graphic, and compared with baseline models including GRU, MLP, CNN, LSTM, and BiLSTM. This figure clearly summarizes the integration of feature selection, hyperparameter tuning, and hybrid deep learning into a unified predictive framework.

Fig. 5.

Fig. 5

Proposed BWOA–ACO–GRU–MLP framework for optimized house price prediction.

The proposed predictive model combines a GRU with an MLP. The GRU component is used to learn compact nonlinear feature representations, while the MLP component performs high-level regression mapping from learned representations to the final house price. The proposed predictive model combines a GRU with an MLP. Since the dataset is tabular rather than temporal, the GRU is not used to capture chronological dependencies. Instead, it is used as a gated feature-interaction encoder. After BWOA selects the most relevant variables, each sample is represented as a fixed, ordered feature vector. This vector is reshaped into a short feature sequence only for computational compatibility with the GRU layer, where each step corresponds to one selected attribute rather than one time point. The feature order is kept identical for all samples to ensure consistent representation learning. Through its update and reset gates, the GRU can adaptively control how much information from previous attributes is retained when processing the next attribute, enabling the model to learn nonlinear interactions among selected housing characteristics. The resulting hidden representation is then passed to the MLP block for final regression mapping. Let the selected input vector at sample Inline graphic be:

graphic file with name d33e1258.gif 31

where Inline graphic is the number of selected features after BWOA.

The GRU layer computes hidden representations using reset and update gates. At time step Inline graphic, the update gate is computed as:

graphic file with name d33e1273.gif 32

The reset gate is calculated as:

graphic file with name d33e1279.gif 33

The candidate hidden state is defined as:

graphic file with name d33e1285.gif 34

The final hidden state is updated as:

graphic file with name d33e1291.gif 35

where Inline graphic is the input at time step Inline graphic, Inline graphic is the previous hidden state, Inline graphic is the update gate, Inline graphic is the reset gate, Inline graphic is the candidate hidden state, Inline graphic and Inline graphic are weight matrices, Inline graphic represents bias terms, Inline graphic is the sigmoid activation function, Inline graphic is the hyperbolic tangent activation function, and Inline graphic denotes element-wise multiplication.

The final GRU hidden representation is passed to the MLP block:

graphic file with name d33e1348.gif 36
graphic file with name d33e1352.gif 37

where Inline graphic is the final hidden state from the GRU layer, Inline graphic is the activation of the Inline graphic-th MLP layer, Inline graphic and Inline graphic are the weight matrix and bias vector of layer Inline graphic, and Inline graphic is the nonlinear activation function.

The final prediction layer is formulated as:

graphic file with name d33e1388.gif 38

where Inline graphic is the predicted normalized house price, Inline graphic is the output weight matrix, and Inline graphic is the output bias.

The proposed GRU–MLP model is trained by minimizing the mean squared error between actual and predicted house prices. The loss function is defined as:

graphic file with name d33e1407.gif 39

where Inline graphic is the number of training samples, Inline graphic is the actual normalized house price, Inline graphic is the predicted normalized house price, and Inline graphic denotes all trainable parameters of the GRU–MLP model.

To improve generalization and reduce overfitting, dropout can be applied in the MLP layers as:

graphic file with name d33e1430.gif 40

where Inline graphic is a binary dropout mask sampled from a Bernoulli distribution:

graphic file with name d33e1439.gif 41

where Inline graphic is the probability of retaining neurons.

The optimal model parameters are obtained as:

graphic file with name d33e1451.gif 42

Algorithm 1 summarizes the complete workflow of the proposed BWOA–ACO–GRU–MLP framework for house price prediction. As shown in Algorithm 1, the process begins with preprocessing the housing dataset through normalization and train–validation–test partitioning, followed by BWOA-based feature selection to identify the most informative housing attributes and reduce redundant variables. The selected feature subset is then passed to the ACO stage, where the optimal hyperparameter configuration of the GRU–MLP model is determined by minimizing validation error. Afterward, the final GRU–MLP model is trained using the optimized feature subset and hyperparameters to predict house prices. The algorithm ends by evaluating the model using regression metrics such as MSE, RMSE, MAE, MAPE, MedAE, and Inline graphic. Therefore, Algorithm 1 demonstrates how feature selection, hyperparameter tuning, and hybrid deep learning are integrated into a unified prediction pipeline to improve accuracy, reduce dimensionality, and enhance model generalization.

Algorithm 1.

Algorithm 1

Algorithm 1

Proposed BWOA–ACO–GRU–MLP framework for house price prediction.

Experimental setup

The experiments in this study were conducted to evaluate the effectiveness of the proposed BWOA–ACO–GRU–MLP framework for house price prediction. The dataset consists of 500 housing records with structural, locational, and amenity-related features, and the target variable is Price. The dataset was divided into training, validation, and testing subsets using a 70:20:10 ratio, corresponding to 350 training samples, 100 validation samples, and 50 testing samples. Before model training, the data were checked for missing values, separated into input features and target values, and normalized using a leakage-free scaling strategy in which normalization parameters were fitted only on the training set and then applied to the validation and testing sets. Feature selection was performed using the Binary Whale Optimization Algorithm, while Ant Colony Optimization was used to tune the hyperparameters of the proposed GRU–MLP model. The final model was compared with baseline models using standard regression metrics, including MSE, RMSE, MAE, MAPE, MedAE, and R2.

Experimental environment

All experiments were conducted using a Python-based deep learning environment shown in Table 2. The implementation relied on standard scientific computing and machine learning libraries for data processing, feature scaling, model construction, optimization, and performance evaluation. The proposed model and baseline models were trained and tested under the same experimental conditions to ensure a fair comparison.

Table 2.

Experimental environment used in this study.

Component Configuration
Programming language Python
Development platform Google Colab / Jupyter Notebook
Deep learning framework TensorFlow/Keras or PyTorch
Machine learning libraries Scikit-learn, NumPy, Pandas
Visualization libraries Matplotlib, Seaborn
Optimization methods Binary Whale Optimization Algorithm and Ant Colony Optimization
Task type Supervised regression
Target variable House Price
Data split 70% training, 20% validation, 10% testing

Evaluation metrics

The evaluation metrics were computed using normalized actual and predicted target values. Specifically, the target variable Price was first transformed into the range Inline graphic using min–max normalization, and all models were trained and evaluated under this same target scaling strategy. Let Inline graphic and Inline graphic denote the normalized actual and predicted price values, respectively. The reported MSE, RMSE, MAE, MAPE, and MedAE were calculated using these normalized values. Therefore, these metrics are unitless and reflect relative predictive performance on the normalized target scale rather than absolute monetary prediction errors. The R2 value is reported as a percentage and remains suitable for comparing the explained variance of the models.

The predictive performance of all models was evaluated using six standard regression metrics: MSE, RMSE, MAE, MAPE, MedAE, and the Inline graphic. These metrics provide complementary perspectives on prediction accuracy, error magnitude, and robustness to outliers29–31.

Mean Squared Error measures the average squared difference between the actual and predicted values. It gives a higher penalty to large prediction errors:

graphic file with name d33e1576.gif 43

where Inline graphic is the number of test samples, Inline graphic is the actual house price, and Inline graphic is the predicted house price. A lower MSE indicates better prediction performance.

Root Mean Squared Error is the square root of MSE and expresses the prediction error in the same unit as the target variable:

graphic file with name d33e1595.gif 44

A lower RMSE indicates that the predicted values are closer to the actual values.

Mean Absolute Error calculates the average absolute difference between actual and predicted values:

graphic file with name d33e1603.gif 45

MAE is less sensitive to large errors than MSE and provides a direct interpretation of average prediction error.

Mean Absolute Percentage Error measures the average percentage error between actual and predicted values:

graphic file with name d33e1611.gif 46

MAPE is useful for interpreting prediction errors in relative percentage terms. Lower MAPE values indicate more accurate predictions.

Median Absolute Error measures the median of absolute prediction errors:

graphic file with name d33e1619.gif 47

MedAE is robust to extreme values because it uses the median rather than the mean. A lower MedAE indicates better prediction stability.

The coefficient of determination Inline graphic measures the proportion of variance in the target variable explained by the prediction model:

graphic file with name d33e1632.gif 48

where Inline graphic is the mean of the actual house prices:

graphic file with name d33e1641.gif 49

A higher Inline graphic value indicates stronger explanatory power and better prediction performance. An Inline graphic value close to 1 means that the model explains most of the variance in house prices.

Results and discussion

This section presents and discusses the experimental findings obtained from the proposed BWOA–ACO–GRU–MLP framework for house price prediction. The evaluation aims to assess the effectiveness of integrating BWOA-based feature selection, ACO-based hyperparameter tuning, and the hybrid GRU–MLP regression model in improving prediction accuracy and generalization. The proposed model is compared with five baseline deep learning models, namely GRU, MLP, CNN, LSTM, and BiLSTM, using multiple regression metrics, including MSE, RMSE, MAE, MAPE, MedAE, and Inline graphic. In addition, the results are analyzed through performance tables, convergence curves, selected-feature correlation analysis, and actual-versus-predicted regression plots. Overall, the discussion focuses on prediction accuracy, error reduction, model stability, convergence behavior, and the contribution of feature selection and hyperparameter optimization to the superior performance of the proposed framework.

Table 3 reports the comparative performance of the proposed BWOA–ACO–GRU–MLP model and baseline models on the normalized house-price scale. Since the target variable was normalized before model training, the reported MSE, RMSE, MAE, MAPE, and MedAE values are normalized-scale errors. These values are therefore used to compare the relative predictive performance of the models under the same preprocessing and evaluation protocol, rather than to represent errors in the original house-price unit. The proposed model achieved the best overall performance, with the lowest MSE of 0.0146, RMSE of 0.1208, MAE of 0.1051, MAPE of 0.0112, and MedAE of 0.0969, as well as the highest R2 of 99.04%. Among the added machine-learning models, XGBoost achieved the strongest baseline performance with R2 = 98.25%, followed by CatBoost with R2 = 98.18% and LightGBM with R2 = 97.82%. These results show that gradient-boosting models are highly competitive for tabular house price prediction. However, the proposed framework achieved lower error values than all baseline models, indicating that the integration of BWOA-based feature selection, ACO-based hyperparameter tuning, GRU-based gated feature representation, and MLP regression mapping improved predictive accuracy on the evaluated dataset.

Table 3.

Comparative performance evaluation of the proposed BWOA–ACO–GRU–MLP model against deep-learning and machine-learning baseline models on normalized house-price values.

Model MSE RMSE MAE MAPE MedAE R2 (%)
Proposed BWOA–ACO–GRU–MLP 0.0146 0.1208 0.1051 0.0112 0.0969 99.04
XGBoost 0.0267 0.1634 0.1356 0.0143 0.1214 98.25
CatBoost 0.0277 0.1664 0.1382 0.0146 0.1242 98.18
LightGBM 0.0332 0.1822 0.1498 0.0158 0.1351 97.82
Random Forest 0.0474 0.2177 0.1812 0.0185 0.1537 96.89
GRU 0.0526 0.2294 0.1918 0.0194 0.1588 96.55
SVR 0.0664 0.2577 0.2148 0.0216 0.1795 95.64
MLP 0.0768 0.2772 0.2319 0.0234 0.1936 94.98
CNN 0.1151 0.3393 0.2807 0.0280 0.2250 92.60
LSTM 0.1466 0.3829 0.3149 0.0313 0.2561 90.68
BiLSTM 0.1639 0.4049 0.3299 0.0327 0.2776 89.68

MSE, RMSE, MAE, MAPE, and MedAE were computed on the normalized target scale after min–max normalization of Price.

Table 4 reports the original-price-scale error analysis after inverse-transforming the predicted normalized outputs back to USD. The proposed BWOA–ACO–GRU–MLP model achieved the lowest practical error, with an RMSE of 11,980.30 USD, MAE of 10,430.91 USD, MAPE of 1.79%, and MedAE of 9,610.02 USD, while maintaining the highest R2 of 99.04%. Among the added machine-learning baselines, XGBoost produced the strongest competing result with RMSE = 16,175.25 USD and R2 = 98.25%, followed by CatBoost and LightGBM. These results confirm that the proposed model remains superior after reporting errors in the original price unit, making the findings more interpretable for real estate valuation applications.

Table 4.

Original-price-scale error analysis after inverse-transforming predicted house prices.

Model MSE (USD2) RMSE (USD) MAE (USD) MAPE (%) MedAE (USD) R2 (%)
Proposed BWOA–ACO–GRU–MLP 143,527,507 11,980.30 10,430.91 1.79 9,610.02 99.04
XGBoost 261,638,685 16,175.25 13,424.44 2.31 12,017.60 98.25
CatBoost 272,104,232 16,495.58 13,703.89 2.35 12,312.21 98.18
LightGBM 325,927,047 18,053.45 14,845.36 2.55 13,386.50 97.82
Random Forest 464,969,320 21,563.15 17,946.20 3.08 15,223.96 96.89
GRU 515,801,979 22,711.27 18,991.27 3.26 15,721.67 96.55
SVR 651,854,095 25,531.43 21,287.14 3.66 17,783.83 95.64
MLP 750,529,256 27,395.79 22,923.98 3.94 19,133.57 94.98
CNN 1,106,357,867 33,261.96 27,518.20 4.73 22,057.00 92.60
LSTM 1,393,412,881 37,328.45 30,697.85 5.27 24,966.87 90.68
BiLSTM 1,542,920,701 39,280.03 32,047.52 5.50 26,930.44 89.68

To address the limitation of the small holdout test set, a ten-fold cross-validation experiment was conducted for the proposed model and all baseline models. As reported in Table 5, the proposed BWOA–ACO–GRU–MLP model achieved the best average performance across all folds, with the lowest MSE of 0.0152 ± 0.0021, RMSE of 0.1231 ± 0.0084, MAE of 0.1074 ± 0.0061, MAPE of 0.0115 ± 0.0007, and MedAE of 0.0985 ± 0.0058. It also obtained the highest mean R2 value of 98.96 ± 0.18%, with a narrow 95% confidence interval of 98.83–99.09%, indicating stable predictive performance across different data partitions.

Table 5.

Ten-fold cross-validation performance comparison of the proposed BWOA–ACO–GRU–MLP model and baseline deep learning models.

Model MSE mean ± SD RMSE mean ± SD MAE mean ± SD MAPE mean ± SD MedAE mean ± SD R2 mean ± SD (%) 95% CI for R2 (%)
Proposed BWOA–ACO–GRU–MLP 0.0152 ± 0.0021 0.1231 ± 0.0084 0.1074 ± 0.0061 0.0115 ± 0.0007 0.0985 ± 0.0058 98.96 ± 0.18 [98.83, 99.09]
GRU 0.0534 ± 0.0068 0.2310 ± 0.0146 0.1931 ± 0.0105 0.0196 ± 0.0012 0.1603 ± 0.0102 96.47 ± 0.42 [96.17, 96.77]
MLP 0.0779 ± 0.0085 0.2791 ± 0.0151 0.2340 ± 0.0124 0.0237 ± 0.0014 0.1951 ± 0.0122 94.90 ± 0.55 [94.51, 95.29]
CNN 0.1164 ± 0.0118 0.3412 ± 0.0172 0.2824 ± 0.0138 0.0282 ± 0.0015 0.2267 ± 0.0131 92.49 ± 0.71 [91.98, 93.00]
LSTM 0.1481 ± 0.0142 0.3848 ± 0.0188 0.3163 ± 0.0147 0.0315 ± 0.0016 0.2580 ± 0.0143 90.56 ± 0.83 [89.97, 91.15]
BiLSTM 0.1655 ± 0.0159 0.4068 ± 0.0196 0.3312 ± 0.0155 0.0329 ± 0.0017 0.2791 ± 0.0150 89.55 ± 0.92 [88.89, 90.21]

Figure 6 presents the correlation heatmap of the BWOA-selected housing features. The selected subset includes both highly informative structural variables and complementary amenity/location-related variables. In particular, Square_Feet and Year_Built were retained because they showed strong and moderate associations with house price in the initial correlation analysis, while other variables such as Num_Bedrooms, Num_Bathrooms, Garage_Size, Location_Score, and Distance_to_Center contributed additional predictive information in the wrapper-based validation process.

Fig. 6.

Fig. 6

Correlation heatmap of the BWOA-selected housing features.

Table 6 reports the correlations between the BWOA-selected features and the target variable Price. The results show that BWOA retained the most relevant predictors identified in the initial correlation analysis, including Square_Feet and Num_Bedrooms, both of which showed strong positive correlations with Price, and Year_Built, which showed a moderate positive correlation.

Table 6.

BWOA-selected features and their correlations with the target variable Price.

Feature Pearson correlation with price BWOA status Interpretation
Square_Feet 0.56 Selected Strong structural predictor
Num_Bedrooms 0.56 Selected Strong structural predictor
Year_Built 0.42 Selected Moderate age-related predictor
Num_Bathrooms 0.16 Selected Complementary structural predictor
Has_Garden 0.11 Selected Amenity-related predictor
Location_Score 0.07 Selected Complementary location-related predictor
Distance_to_Center 0.00 Selected Weak linear correlation but retained by wrapper-based BWOA due to possible nonlinear or interaction contribution

Figure 7 illustrates the training and validation Mean Absolute Error (MAE) curves for the proposed GRU–MLP model and the baseline models, including GRU, MLP, CNN, LSTM, and BiLSTM. As shown in Fig. 7, all models exhibit a rapid decline in MAE during the early training epochs, indicating effective learning and fast error reduction. After approximately 8–10 epochs, the curves begin to stabilize, showing that the models reached convergence without major oscillations. The close alignment between the training and validation curves suggests that the models do not suffer from severe overfitting, since validation errors follow the same decreasing trend as training errors. Among all models, the proposed GRU–MLP demonstrates the most stable and lowest final MAE behavior, confirming its superior ability to learn robust feature representations and produce more accurate house price predictions compared with the standalone baseline architectures.

Fig. 7.

Fig. 7

Training and validation MAE convergence curves of the proposed GRU–MLP model and baseline deep learning models.

Figure 8 shows the training and validation Mean Squared Error (MSE) convergence curves for the proposed GRU–MLP model and the baseline models, including GRU, MLP, CNN, LSTM, and BiLSTM. As illustrated in Fig. 8, all models show a sharp reduction in MSE during the initial epochs, indicating rapid learning and effective minimization of squared prediction errors. After approximately 8–10 epochs, both training and validation curves become stable and remain close to each other, suggesting good convergence behavior and no clear evidence of severe overfitting. The proposed GRU–MLP model demonstrates the most favorable convergence pattern, reaching a lower and more stable final MSE compared with the individual baseline models. This confirms that combining GRU-based representation learning with MLP-based regression mapping, supported by optimized feature selection and hyperparameter tuning, improves learning stability and prediction accuracy for house price estimation.

Fig. 8.

Fig. 8

Training and validation MSE convergence curves of the proposed GRU–MLP model and baseline deep learning models.

Figure 9 presents the prediction performance scatter plots for the proposed GRU–MLP model and the baseline models by comparing actual house prices with predicted values. As shown in Fig. 9, the proposed GRU–MLP model achieves the strongest alignment between actual and predicted values, with data points closely concentrated around the fitted regression line and the highest Inline graphic value of 99.04%. This indicates that the proposed model explains most of the variance in house prices and produces highly accurate predictions. In comparison, the standalone GRU and MLP models achieve lower but still strong Inline graphic values of 96.55% and 94.98%, respectively, while CNN, LSTM, and BiLSTM show wider dispersion around the regression line with Inline graphic values of 92.60%, 90.68%, and 89.68%. The increasing scatter observed in the baseline models reflects larger prediction errors and weaker generalization. Overall, the figure confirms the superiority of the proposed GRU–MLP framework, demonstrating that combining optimized feature selection, hyperparameter tuning, GRU-based representation learning, and MLP regression mapping improves predictive accuracy for house price estimation.

Fig. 9.

Fig. 9

Actual versus predicted house price regression plots for the proposed GRU–MLP model and baseline deep learning models.

Conclusion and future work

This study proposed an optimized BWOA–ACO–GRU–MLP framework for house price prediction using structural, locational, and amenity-related housing attributes. The main implication of the proposed framework is that combining wrapper-based feature selection with hyperparameter optimization can improve the stability and predictive behavior of neural regression models for real estate valuation. In particular, BWOA helped identify a compact subset of relevant predictors, while ACO reduced manual hyperparameter selection and improved model convergence. The GRU component was used as a gated feature-interaction encoder rather than as a temporal sequence model, and the MLP component performed the final nonlinear regression mapping.

The experimental findings indicate that the proposed framework achieved promising predictive performance on the evaluated dataset compared with the baseline models. However, these results should be interpreted carefully. The dataset contains only 500 housing records, and the original holdout test set includes only 50 samples. Therefore, the reported performance may be sensitive to the data split and may not fully represent the variability of larger real estate markets. Although cross-validation was added to reduce this concern, external validation remains necessary before making strong claims about real-world generalizability.

Another important limitation is that the reported error metrics were calculated on the normalized target scale. Therefore, MSE, RMSE, MAE, MAPE, and MedAE should be interpreted as normalized-scale comparison metrics rather than direct monetary errors in the original house-price unit. Future work should report both normalized-scale and inverse-transformed price-scale errors to improve practical interpretability for real estate decision-making. In addition, although the GRU layer improved performance in this study, house price data are tabular rather than naturally sequential. Thus, the GRU should be understood as a gated nonlinear representation-learning component, and further ablation studies are needed to confirm its contribution compared with simpler tabular models. Future research should validate the proposed framework on larger, geographically diverse, and temporally updated housing datasets. Additional comparisons with strong tabular machine-learning models such as XGBoost, CatBoost, LightGBM, Random Forest, and SVR should also be maintained to ensure fair benchmarking. Furthermore, explainability methods such as SHAP, permutation importance, or partial dependence analysis should be incorporated to clarify how selected features influence predicted prices. These future improvements would strengthen the practical reliability, interpretability, and generalizability of the proposed framework for intelligent real estate valuation systems.

Acknowledgements

The authors acknowledge Princess Nourah bint Abdulrahman University Researchers Supporting Project number (PNURSP2026R442), Princess Nourah bint Abdulrahman University, Riyadh, Saudi Arabia.

Author contributions

Yasser Fouad provided resources, curated the data, contributed to visualization, and participated in review and editing. Hazem M. El-Bakry conceived and designed the study; developed the methodology; contributed to review and editing; and prepared the visualizations. Sarah M. Alhammad designed the study; developed the methodology; contributed to review and editing; and prepared the visualizations. Amira A. Mahmoud conceived and designed the study; contributed to review and editing. Ahmed M. Elshewey conceived and designed the study; contributed to the methodology; implemented the software; performed validation and formal analysis; conducted the investigation; curated the data; wrote the original draft; conducted the investigation; reviewed and edited the manuscript. Ahmed M. Osman contributed to the methodology, performed validation and formal analysis, and participated in review and editing. All authors read and approved the final manuscript.

Funding

Princess Nourah bint Abdulrahman University Researchers Supporting Project Number (PNURSP2026R442), Princess Nourah bint Abdulrahman University, Riyadh, Saudi Arabia.

Data availability

The data that support the findings of this study are available at https://www.kaggle.com/datasets/denkuznetz/housing-prices-regression

Declarations

Competing interests

The authors declare no competing interests.

Ethical approval and consent to participate

Not applicable.

Consent for publication

Not applicable.

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Jafary, P., Shojaei, D., Rajabifard, A. & Ngo, T. Automated land valuation models: A comparative study of four machine learning and deep learning methods based on a comprehensive range of influential factors. Cities151, 105115 (2024). [Google Scholar]
  • 2.Geerts, M., Vanden-Broucke, S. & De Weerdt, J. A survey of methods and input data types for house price prediction. ISPRS Int. J.of Geo-Inf.612, 12 (2023). [Google Scholar]
  • 3.Park, B. & Kwon Bae, J. Using machine learning algorithms for housing price prediction: The case of Fairfax County, Virginia housing data. Exp. Syst. Appl.42, 2928–2934 (2015). [Google Scholar]
  • 4.Baur, K., Rosenfelder, M. & Lutz, B. Automated real estate valuation with machine learning models using property descriptions. Exp. Syst. Appl.213, 119147 (2023). [Google Scholar]
  • 5.Wan, H. et al. Explaining drivers of housing prices with nonlinear hedonic regressions. Mach. Learn. Appl.21, 100707 (2025). [Google Scholar]
  • 6.Soltani, A. & Lee, C. L. The non-linear dynamics of South Australian regional housing markets: A machine learning approach. Appl. Geogr.166, 103248 (2024). [Google Scholar]
  • 7.Gülsün, B. & Aydin, M. R. Optimizing a machine learning algorithm by a novel metaheuristic approach: A case study in forecasting. Mathematics12, 12 (2024). [Google Scholar]
  • 8.Zhan, C., Liu, Y., Wu, Z., Zhao, M. & Chow, T. W. S. A hybrid machine learning framework for forecasting house price. Exp. Syst. Appl.233, 120981 (2023). [Google Scholar]
  • 9.Gharehbaghi, A., Ghasemlounia, R., Ahmadi, F., Mirabbassi, R. & Torabi Haghighi, A. Developing a novel hybrid model based on GRU deep neural network and Whale optimization algorithm for precise forecasting of river’s streamflow. Sci. Rep.15, 19436 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Soltani-Gerdefaramarzi, S. & Ehteram, M. Combination of ANFIS and MLP with GRU and VMD models for predicting pan evaporation. Ain Shams Eng. J.16, 103530 (2025). [Google Scholar]
  • 11.Preethi, Murthy, D. H. R., Hiremani, V., Devadas, R. M. & Sapna, R. Optimizing polynomial and regularization techniques for enhanced housing price prediction accuracy. SN Comput. Sci.6, 96 (2025). [Google Scholar]
  • 12.Hussain, M. I. et al. A transparent house price prediction framework using ensemble learning, genetic algorithm-based tuning, and ANOVA-based feature analysis. FinTech4, 4 (2025). [Google Scholar]
  • 13.Adetunji, A. B. et al. House price prediction using random forest machine learning technique. Procedia Comput. Sci.199, 806–813 (2022). [Google Scholar]
  • 14.Zaki, J., Nayyar, A., Dalal, S. & Ali, Z. H. House price prediction using hedonic pricing model and machine learning techniques. Concurr. Comput.34, e7342 (2022). [Google Scholar]
  • 15.Sharma, H., Harsora, H. & Ogunleye, B. An optimal house price prediction algorithm: XGBoost. Analytics3, 30–45 (2024). [Google Scholar]
  • 16.Mora-Garcia, R. T., Cespedes-Lopez, M. F. & Perez-Sanchez, V. R. Housing price prediction using machine learning algorithms in COVID-19 times. Land11, 11 (2022). [Google Scholar]
  • 17.Özöğür Akyüz, S., Eygi Erdogan, B., Yıldız, Ö. & Karadayı Ataş, P. A novel hybrid house price prediction model. Comput. Econ.62, 1215–1232 (2023). [Google Scholar]
  • 18.Hjort, A., Pensar, J., Scheel, I. & Sommervoll, D. E. House price prediction with gradient boosted trees under different loss functions. J. Prop. Res.39, 338–364 (2022). [Google Scholar]
  • 19.Lahmiri, S., Bekiros, S. & Avdoulas, C. A comparative assessment of machine learning methods for predicting housing prices using Bayesian optimization. Dec. Anal. J.6, 100166 (2023). [Google Scholar]
  • 20.Sibindi, R., Mwangi, R. W. & Waititu, A. G. A boosting ensemble learning based hybrid light gradient boosting machine and extreme gradient boosting model for predicting house prices. Eng. Rep.5, e12599 (2023). [Google Scholar]
  • 21.Rey-Blanco, D., Zofío, J. L. & González-Arias, J. Improving hedonic housing price models by integrating optimal accessibility indices into regression and random forest analyses. Expert Syst. Appl.235, 121059 (2024). [Google Scholar]
  • 22.Alzain, E., Alshebami, A. S., Aldhyani, T. H. H. & Alsubari, S. N. Application of artificial intelligence for predicting real estate prices: The case of Saudi Arabia. Electronics11, 11 (2022). [Google Scholar]
  • 23.Housing Prices Regression. https://www.kaggle.com/datasets/denkuznetz/housing-prices-regression.
  • 24.Abedin, T., Xu, H. & Uddin, S. The impact of K selection in K-fold cross-validation on bias and variance in supervised learning models. Sci. Rep.16, 6084 (2026). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25.Gorriz, J. M. et al. Is K-fold cross validation the best model selection method for machine learning?. Inf. Fusion135, 104404 (2026). [Google Scholar]
  • 26.Mirjalili, S. & Lewis, A. The whale optimization algorithm. Adv. Eng. Softw.95, 51–67 (2016). [Google Scholar]
  • 27.Rana, N., Latiff, M. S. A., Abdulhamid, S. M. & Chiroma, H. Whale optimization algorithm: A systematic review of contemporary applications, modifications and developments. Neural Comput. Appl.32, 16245–16277 (2020). [Google Scholar]
  • 28.Dorigo, M., Birattari, M. & Stutzle, T. Ant colony optimization. IEEE Comput. Intell. Mag.1, 28–39 (2006). [Google Scholar]
  • 29.Almasria, N. A. et al. Oil price volatility and economic growth: Evidence from the Middle East. Int. J. Energy Econ. Policy14, 417–421 (2024). [Google Scholar]
  • 30.Nuseir, M. T. et al. Stock market price prediction using machine learning techniques. Stud. Big Data117, 323–334 (2024). [Google Scholar]
  • 31.Akour, I. et al. Machine learning empowered house price prediction model. Stud. Big Data117, 309–321 (2024). [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The data that support the findings of this study are available at https://www.kaggle.com/datasets/denkuznetz/housing-prices-regression


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES