<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JDAIP</journal-id><journal-title-group><journal-title>Journal of Data Analysis and Information Processing</journal-title></journal-title-group><issn pub-type="epub">2327-7211</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jdaip.2023.113015</article-id><article-id pub-id-type="publisher-id">JDAIP-126582</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject><subject> Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  A Hybrid Spatial Dependence Model Based on Radial Basis Function Neural Networks (RBFNN) and Random Forest (RF)
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Mamadou</surname><given-names>Hady Barry</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Lawrence</surname><given-names>Nderu</given-names></name><xref ref-type="aff" rid="aff2"><sup>2</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Anthony</surname><given-names>Waititu Gichuhi</given-names></name><xref ref-type="aff" rid="aff3"><sup>3</sup></xref></contrib></contrib-group><aff id="aff3"><addr-line>Department of Statistics and Actuarial Science, Jomo Kenyatta University of Agriculture and Technology, Nairobi, Kenya</addr-line></aff><aff id="aff1"><addr-line>Department of Mathematics, Pan African University, Institute for Basic Sciences, Technology and Innovation (PAUSTI), Nairobi, Kenya</addr-line></aff><aff id="aff2"><addr-line>Department of Computing School and Information Technology (SCIT), Jomo Kenyatta University of Agriculture and Technology (JKUAT), Nairobi, Kenya</addr-line></aff><pub-date pub-type="epub"><day>11</day><month>07</month><year>2023</year></pub-date><volume>11</volume><issue>03</issue><fpage>293</fpage><lpage>309</lpage><history><date date-type="received"><day>7,</day>	<month>June</month>	<year>2023</year></date><date date-type="rev-recd"><day>24,</day>	<month>July</month>	<year>2023</year>	</date><date date-type="accepted"><day>27,</day>	<month>July</month>	<year>2023</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  The majority of spatial data reveal some degree of spatial dependence. The term 
  “
  spatial dependence
  ”
   refers to the tendency for phenomena to be more similar when they occur close together than when they occur far apart in space. This property is ignored in machine learning (ML) for spatial domains of application. Most classical machine learning algorithms are generally inappropriate unless modified in some way to account for it. In this study, we proposed an approach that aimed to improve a ML model to detect the dependence without incorporating any spatial features in the learning process. To detect this dependence while also improving performance, a hybrid model was used based on two representative algorithms. In addition, cross-validation method was used to make the model stable. Furthermore, global moran’s I and local moran were used to capture the spatial dependence in the residuals. The results show that the HM has significant with a R2 of 99.91% performance compared to RBFNN and RF that have 74.22% and 82.26% as R2 respectively. With lower errors, the HM was able to achieve an average test error of 0.033% and a positive global moran’s of 0.12. We concluded that as the R2 value increases, the models become weaker in terms of capturing the dependence.
 
</p></abstract><kwd-group><kwd>Spatial Data</kwd><kwd> Spatial Dependence</kwd><kwd> Hybrid Model</kwd><kwd> Machine Learning Algorithms</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>The real world can be represented as its geographic location. Virtually everything that occurs or exists happens “somewhere”. It is crucial to know “where” something occurred or existed. Geographic location is crucial since all human actions require understanding of the earth [<xref ref-type="bibr" rid="scirp.126582-ref1">1</xref>] . If the information contained in a map or photograph can be expressed digitally, it is because a variety of specialized computer systems have been developed to process geographical information [<xref ref-type="bibr" rid="scirp.126582-ref2">2</xref>] .</p><p>Nowadays, topographic surveys, satellites, and other methods collect vast amounts of data in computer format, frequently with geographical references [<xref ref-type="bibr" rid="scirp.126582-ref2">2</xref>] . Data regarding the position, attributes and associations features in space are often termed spatial data [<xref ref-type="bibr" rid="scirp.126582-ref3">3</xref>] . Therefore being referenced to a particular location in space creates unique characteristics (properties). These characteristics provide difficulties and present opportunities for information mining. For that reason, the exploration of these data requires implicit or explicit knowledge included in spatial science [<xref ref-type="bibr" rid="scirp.126582-ref4">4</xref>] .</p><p>Machine learning (ML) techniques enable computers to learn within data, extract knowledge, and recognize structures from huge and high-dimensional datasets. They can be supervised, unsupervised, semisupervised or reinforcement [<xref ref-type="bibr" rid="scirp.126582-ref5">5</xref>] . These techniques have been frequently used across many fields [<xref ref-type="bibr" rid="scirp.126582-ref6">6</xref>] . The emergence of ML algorithms has also been applied in spatial data. The main challenge is to build an adaptable model based on the interaction between geographical data and ML management that can handle and evaluate complex spatial information.</p><p>According to the first property of spatial data, “everything is related to everything else, but near things are more related than distant things”, knows as spatial dependence [<xref ref-type="bibr" rid="scirp.126582-ref7">7</xref>] . Consequently, we would anticipate that the majority of geographic events will have some sort of spatial autocorrelation (dependence). The existence of this geographical relationship contradicts the concept of identical and independent distribution (i.i.d.) upon which many non-spatial statistical methods are based. This is frequently the case in population data since people who have similar qualities tend to live in similar neighborhoods for a variety of reasons, including house prices, proximity to employers, and cultural considerations. For this reason, a ML algorithm may not adequately capture a significant occurrence [<xref ref-type="bibr" rid="scirp.126582-ref8">8</xref>] .</p><p>One of the most common applications of ML is spatial prediction, which uses samples for training to predict unknown values in specific locations [<xref ref-type="bibr" rid="scirp.126582-ref9">9</xref>] . ML algorithms have been used as potential replacement for geostatistical interpolation techniques (ordinary kriging and regression kriging) and for spatial analysis techniques (spatial autoregressive and geographically weighted regression). Kriging and its multiple variants have been utilized as the Best Unbiased Linear Prediction approach since the 1960s, but the authors [<xref ref-type="bibr" rid="scirp.126582-ref10">10</xref>] [<xref ref-type="bibr" rid="scirp.126582-ref11">11</xref>] and [<xref ref-type="bibr" rid="scirp.126582-ref12">12</xref>] have proven that ML models to be superior to geostatistical interpolation techniques in terms of prediction.</p><p>According to [<xref ref-type="bibr" rid="scirp.126582-ref13">13</xref>] , by incorporating geographical proximity (buffer distance) effects into a learning process, for spatial predictions, a ML model is able to generate a prediction comparable to ordinary and regression kriging. In the same ideas, [<xref ref-type="bibr" rid="scirp.126582-ref14">14</xref>] incorporated spatial lag and ESF features in a ML model whose showed fewer mistakes and lower spatial autocorrelation compared to a model without spatial features. For spatial ML prediction, the incorporation of spatial features is commonly used in a model to account for spatial dependence.</p><p>To assess spatial dependence in models, moran’s I methods was quantified [<xref ref-type="bibr" rid="scirp.126582-ref14">14</xref>] , and a new integration of weights matrix was developed to detect spatial dependence patterns among residuals [<xref ref-type="bibr" rid="scirp.126582-ref15">15</xref>] . Therefore, when analyzing spatial data, we need to be conscious of the specificity that dependence involves when we conduct ML. In fact, the explicit management of the spatial dependence might improve the performance of the ML model or provide important new insights into how a task is learned. However, failure to appropriately consider or include that property into the ML model can impact learning.</p><p>The exploration of the spatial dependence within the learning algorithm is still in its early stages. An approach is developed with the goal of illustrating and improving a ML model to identify the dependence. This study focuses on a hybrid model of ML that captures the spatial dependence through the residuals without incorporating any spatial features in the model. Two representative ML models are proposed for spatial data: RBFNN, a type of neural network used for prediction tasks when the current outcome is affected by the neighbors’ states or by contextual information and RF algorithm, that is also appropriate for the case of spatially dependent samples.</p><p>The paper is structured as follows: Section 2 presents the mathematical methods of the models; Section 3 presents their application; Section 4 discusses the experimental results; Section 5 provides the conclusion.</p></sec><sec id="s2"><title>2. Methods</title><sec id="s2_1"><title>2.1. Models Specification</title><p>The purpose of supervised learning is to infer a function or mapping from labeled training data. It involves defining the input vector X = ( x 1 , ⋯ , x m ) (the features that will be used to train the model, which may include spatial indexing) and the output vector y (the prediction or label that the model is trying to predict). The parameters are then used to determine how our model will use these features and labels in order to make accurate predictions.</p><p>The following algorithms will be developed: RBFNN, RF and Hybrid model.</p></sec><sec id="s2_2"><title>2.2. Radial Basis Function Neural Networks</title>Radial Basis Function (RBF)<p>In mathematics, RBF is a function φ ( x ) whose value mainly depends on the distance between the input and some fixed point. In the case where c is the fixed point, the formula can be expressed as:</p><p>φ ( x ) = f ( ‖ x − c ‖ ) , (2.1)</p><p>f ( ‖ x − c ‖ ) is the distance function.</p><p>In the domain of neural network, RBF is used to develop a mathematical model called Radial Basis Function Networks. The model uses radial basis function as activation function [<xref ref-type="bibr" rid="scirp.126582-ref16">16</xref>] . The notion behind RBF is that a predicted target value of a particular item is likely to be nearly equal to the other neighbors of the predictor variables. Therefore, An RBF network places one or multiple RBF neurons in the coordinate space, depending on what the predictor factors indicate. The Euclidean distance in the space concerned is between each neutron, where distance is calculated from the centre of the neutrons [<xref ref-type="bibr" rid="scirp.126582-ref17">17</xref>] .</p><p>Let denote x ∈ ℝ n the input vector and y : ℝ n → ℝ the output of the network given by a scalar function of the input vector. Then, the relation between the output and the input layers can be expressed as:</p><p>y = ∑ j = 1 M w m j φ ( ‖ x − c j ‖ ) (2.2)</p><p>In Equation (2.2), M is the number of the neurons in the hidden layer, c j is the center vector for neuron j and w m j the weight of neuron j in the linear output neuron. By including the bias ( w k 0 ) in Equation (2.2), the formula can be expressed as follows:</p><p>y r b f = ∑ j = 1 M w m j F j ( X ) + w k 0 , (2.3)</p><p>where F j ( X ) = φ ( ‖ x − c j ‖ ) .</p><p>Generally, the radial basis function is taken to be Gaussian:</p><p>F j ( X ) = exp ( − β j ‖ x − c j ‖ 2 ) (2.4)</p><p>The parameter β j is given by: β j = 1 2 σ j 2 , σ denotes the width of the basis function.</p><p>As shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>, each input layer corresponds to the input vector space. The hidden layer processes the spatial data through the use of radial basis functions that is centered on a spot. The last is the linear output layer which is the summation of the value obtained from the hidden layer and multiplied by a weight related to the neuron.</p></sec><sec id="s2_3"><title>2.3. Random Forest</title><p>Random forest is a commonly-used machine learning algorithm based on the idea of constructing multiple decision trees. The use of multiple decision trees and random feature subsets allows the model to capture both linear and nonlinear relationships. Each decision tree works on a different sample and takes their majority vote for classification and average in case of regression [<xref ref-type="bibr" rid="scirp.126582-ref18">18</xref>] .</p><p>Let consider Y i the continuous response and X i = ( x i 1 , x i 2 , ⋯ , x i m ) as input space vector. m defined the number of inputs and i the partitions of the feature space. The training set is expressed as:</p><p>D n = { ( X 1 , Y 1 ) , ( X 2 , Y 2 ) , ⋯ , ( X m , Y m ) } , X ∈ ℝ m , Y ∈ ℝ (2.5)</p><p>During the training process, the RF splits the input data at each node so that the parameters of the split functions can be improved to fit the D n set. From the first step, the algorithm generates a number of decision trees. The decision tree has to determine the best split among all variables. This splitting process begins at the root and proceeds through each node, with each node applying its own split function to the new input X. This is done recursively until a terminal node (also known as tree leaves) is reached [<xref ref-type="bibr" rid="scirp.126582-ref19">19</xref>] . At the end of this process, a prediction function f b ( x ) of each decision tree is constructed over D n and calculated as follows:</p><p>f b ( x ) = ∑ m = 1 M c m I { x } , (2.6)</p><p>where I { x ∈ R m } is the identity function that returns 1 if x is in the subset and 0 otherwise and c m is the average of y.</p><p>The final prediction of the Random Forest model is the average of the predictions of all the decision trees in the forest. This can be written as:</p><p>y r f = 1 B ∑ b = 1 B f ^ b ( x ) , (2.7)</p><p>where B is the number of decision trees in the forest and f b ( x ) is the prediction of the m-th decision tree for the input space x.</p><p>In <xref ref-type="fig" rid="fig2">Figure 2</xref>, the input features are used to construct multiple decision trees, and the mean of all predicted decision trees is taken to obtain the prediction of the random forest.</p></sec><sec id="s2_4"><title>2.4. Hybrid Model</title><p>The field of ML has rapidly evolved in recent years, with various models being developed and implemented to tackle different tasks. One such model that has gained popularity is the hybrid model. A hybrid model is a combination of ML models that are designed to solve a particular problem [<xref ref-type="bibr" rid="scirp.126582-ref20">20</xref>] . In this section, two distinct types of algorithms are used in the formulation of the hybrid model. These algorithms are RBFNN and RF.</p><p>RBFNN and RF prediction results are integrated as extra features within a Generalized Boosted Regression (gbm) technique to build a single strong model</p><p>(strong learner). This combined gbm model can then be used for making predictions on new spatial data by following the same process of extracting RBFNN and RF predictions. One of the main benefits of this hybrid model is the ability to reduce errors. Errors arise when a model does not fit the training data set properly, resulting in poor performance. By incorporating the predictions from the two models as additional features, the gbm model can benefit from the different perspectives and strengths of the individual models, potentially leading to improved performance without losing the spatial dependence.</p><p>Let { z : m = 1,2,3 } be a set of base learners:</p><p>z = { X , y r b f , y r f } = { X + h R B F N N + h R F } , (2.8)</p><p>where X is the matrix of the initial features, h R B F N N and h R F are the predicted values from RBFNN ( y r b f ) and RF ( y r f ) respectively.</p><p>Given a training set { ( z , y i ) } i = 1 n of known ( y , z ) values, the objective is to</p><p>identify a prediction function F ( z ) for predicting y H M that maps z to y in such a way that, given the joint distribution of all ( y , z ) values, the expected value of a certain loss function ( y ; F ( z ) ) is minimized.</p><p>Let L define the loss function:</p><p>L ( y i , F ( z ) ) , (2.9)</p><p>Then the model is initialized</p><p>F 0 ( z ) = a r g min F ( z ) ∑ i = 1 N L ( y i , F ( z ) ) (2.10)</p><p>The loss function is determined by the squared-error loss L ( y i , F ( z ) ) = ( y i − F ( z ) ) 2 .</p><p>For m = 1 to M do:</p><p>compute the pseudo residual by taking the loss function derivative with regard to the previous prediction F m − 1 i.e. ( F 0 ( z ) ) and multiplied by −1.</p><p>r i m = − [ ∂ L ( y i , F ( z i ) ) ∂ F ( z i ) ] F ( z ) = F m − 1 ( z ) = − ∂ ( y i − F m − 1 ) 2 ∂ F m − 1 = 2 ( y i − F m − 1 ) = ( y i − F m − 1 ) (2.11)</p><p>where m is the number of iteration.</p><p>Every iteration of the residuals, the model F ( z ) (also called week prediction model) is updated:</p><p>F m ( z ) = F 0 ( z ) + F 1 ( z ) + ⋯ + F M ( z ) (2.12)</p><p>Each model ( F m ( z ) ) is constructed based on the residuals and is trained to minimize the remaining error. This process iterate until a low learning error is reached.</p><p>The weak models are combined to create a strong predictive model that captures the complex relationships between the predictors and the response. The final model is:</p><p>y H M = ∑ m = 1 M α m F m ( z ) , (2.13)</p><p>where F m ( z ) corresponds to a weak prediction model and 0 ≤ α m ≤ 1 stands for the weight of the weak model.</p><p>As we can see in <xref ref-type="fig" rid="fig3">Figure 3</xref>, the predicted values for each algorithms ( h R B F N N and h R F ) and the initial features are combined in the gbm function to obtain the hybrid model.</p></sec><sec id="s2_5"><title>2.5. Cross-Validation</title><p>Validating the stability of a model is always necessary in machine learning. Cross-validation is a data re-sampling technique used to evaluate the true prediction error of models and tune model parameters to avoid overfitting [<xref ref-type="bibr" rid="scirp.126582-ref21">21</xref>] . In this case, we use the k-fold cross-validation. This technique splits the data into k subsets or folds, and the model is trained on k − 1 of these folds, while the remaining fold is used for testing. This process is repeated k times, with each fold being used once for testing, and the other k-1 folds used for training [<xref ref-type="bibr" rid="scirp.126582-ref22">22</xref>] . The idea is to assess the stability of each model by comparing the performance across different folds. It is expressed as:</p><p>CV ( k ) = 1 k ∑ L ( y i , f ^ − k ( x i ) ) , (2.14)</p><p>where CV ( k ) is the cross-validation estimate of the true error rate or performance metric, L is the loss or performance metric for the i t h fold, f ^ − k ( x i ) is the model that was trained and k is the number of folds.</p></sec><sec id="s2_6"><title>2.6. Spatial Autocorrelation</title><p>Spatial autocorrelation is a concept in statistics that refers to the degree to which nearby locations are similar to one another. In other words, it is a measure of the degree (that ranges from −1 to +1) to which the values of a variable in one location are similar to the values of the same variable in nearby locations. It can be positive or negative. Positive spatial autocorrelation occurs when nearby locations have similar values for a variable, while negative spatial auto-correlation occurs when nearby locations have dissimilar values for a variable. When there is no spatial auto-correlation, nearby locations have values for a variable that are unrelated to one another. In this study, we used Global Moran’s I that is used to analyze the global spatial autocorrelation and Local Moran’s I that evaluates the individual features and compares them to their neighbors and looks for clustering.</p></sec><sec id="s2_7"><title>2.7. Models Evaluation</title><p>To evaluate the performance of the models, three criteria are used: Root Mean Squared Error (RMSE), Mean Absolute Error (MAE) and R-squared (R<sup>2</sup>), which are defined by</p><p>RMSE = 1 n ∑ i = 1 n ( y i − y ^ i ) 2 (2.15)</p><p>MAE = 1 n ∑ i = 1 n | y i − y ^ i | (2.16)</p><p>R 2 = 1 − sumsquaredresiduals ( SSR ) totalsumofsquares ( SST ) = 1 − ∑ ( y i − y ^ i ) 2 ∑ ( y i − y &#175; ) 2 (2.17)</p></sec></sec><sec id="s3"><title>3. Application</title><sec id="s3_1"><title>3.1. Dataset and Tools</title><p>A public spatial dataset is used in this study. The proposed HM model is applied to California housing prices spatial data from Kaggle. This spatial dataset was originally published by Dr. Pace and Dr. Ronald Barry to build spatial auto-regressive models on 1990 California Census data. It contains information on the demographics (income, population, households) of the districts, as well as their location (latitude, longitude), and a general description of each district’s homes (number of rooms, number of bedrooms, house value, ocean proximity). The dataset contains a total of 20.640 observations of housing prices with 10 features. Each observation consists of a single block in California. The attributes of the dataset are described in this <xref ref-type="table" rid="table1">Table 1</xref> and shows the data sample. <xref ref-type="fig" rid="fig4">Figure 4</xref> shows the distribution of each of the variables. The histograms and bar graph provide further details about the distribution of each feature. The dataset reveals that some features are skewed to the right, with Median House Value peaking on the far right. <xref ref-type="fig" rid="fig5">Figure 5</xref> displays the median home value dispersion across California by population and geographical area. We can observe that, on average the houses nearest to the ocean tend to have higher median house values. Typically, homes along the water cost more than homes inland. Therefore, it becomes sense to take the spatial data into consideration when predicting the price of household.</p><p>We used the open-source statistical programming language R. The algorithm implementations of the following packages have been used: caret (Short for Classification and Regression Training), random Forest (Classification and Regression with Random Forest), RSNNS (R Stuttgart Neural Network Simulator), gbm (Generalized Boosted Regression Modeling), spdep (Spatial Dependence) and tmap (Thematic Map Visualization).</p></sec><sec id="s3_2"><title>3.2. Preprocessing</title><p>Real world data frequently possesses undesirable characteristics like inconsistent formats, missing values, unreadable formats etc. The spatial dataset contains 10 columns and 20,640 rows for different census tracts in California. This raw data needs to be processed in order for a machine learning algorithm to understand it and use it later for processing. This phase is known as preprocessing.</p><p>Modern ML techniques do well without feature selection, as models learn to identify useless features and focus on others [<xref ref-type="bibr" rid="scirp.126582-ref23">23</xref>] [<xref ref-type="bibr" rid="scirp.126582-ref24">24</xref>] . In this study, all features are included in the training process. The hybrid model (gbm method) is capable of evaluating the importance of features based on their contribution to the predictive performance of the model [<xref ref-type="bibr" rid="scirp.126582-ref25">25</xref>] . The target variable is the median house value that ranges from $14,999 to $500,001. The features are longitude, latitude, housing median age, total rooms, total bedrooms, population, households, median income and ocean proximity. Only ocean proximity is a categorical variable that has been transformed into numerical values. The variable total bedroom contains missing values that are imputed with a median value. Now, we can visualize dataset.</p><sec id="s3_2_1"><title>3.2.1. Normalization</title><p>Data normalization is used to organize data in a structured way so that it can be</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> California housing prices description</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Variables</th><th align="center" valign="middle" >Descriptions</th></tr></thead><tr><td align="center" valign="middle" >longitude</td><td align="center" valign="middle" >Longitude of the location of the house.</td></tr><tr><td align="center" valign="middle" >latitude</td><td align="center" valign="middle" >Latitude of the location of the house</td></tr><tr><td align="center" valign="middle" >median_income</td><td align="center" valign="middle" >Median age of the houses in the location</td></tr><tr><td align="center" valign="middle" >total_rooms</td><td align="center" valign="middle" >Total number of rooms in the houses in the location</td></tr><tr><td align="center" valign="middle" >total_bedrooms</td><td align="center" valign="middle" >Total number of bedrooms in the houses in the location</td></tr><tr><td align="center" valign="middle" >population</td><td align="center" valign="middle" >Total population in the location</td></tr><tr><td align="center" valign="middle" >households</td><td align="center" valign="middle" >Total number of households in the location</td></tr><tr><td align="center" valign="middle" >median_income</td><td align="center" valign="middle" >Median income of the households in the location</td></tr><tr><td align="center" valign="middle" >median_house_value</td><td align="center" valign="middle" >Median house value in the location</td></tr><tr><td align="center" valign="middle" >ocean_proximity</td><td align="center" valign="middle" >Proximity of the location to the ocean</td></tr></tbody></table></table-wrap><p>on a similar scale. This process improves the performance and training stability of the model. Mathematically, it is given as follows:</p><p>X n = X − X min X max − X min , (3.1)</p><p>where X is the normalized value, X min is the minimum value of the feature and X max is the maximum value of the feature.</p></sec><sec id="s3_2_2"><title>3.2.2. Training and Testing Process</title><p>The training and testing process is a crucial step in the development of machine learning models. Over 20,640 observations, all the spatial data was divided into</p><p>two parts. The first part, the data is divided into 70% as training data. The second part, 30% as testing data. The former was used to build the previously mentioned models, while the latter was used to validate the models as showed in <xref ref-type="table" rid="table2">Table 2</xref>.</p><table-wrap id="table2" ><label><xref ref-type="table" rid="table2">Table 2</xref></label><caption><title> The split description</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Original size</th><th align="center" valign="middle" >Training set</th><th align="center" valign="middle" >Testing set</th></tr></thead><tr><td align="center" valign="middle" >20,640</td><td align="center" valign="middle" >14,447</td><td align="center" valign="middle" >6193</td></tr></tbody></table></table-wrap></sec></sec></sec><sec id="s4"><title>4. Experimental Results</title><p>Since it is necessary to quantify the results, in this step, the findings are extracted from the fit statement, which contains a list of stored values for each model. The RBFNN and RF algorithms are isolated and independent of each other during the training process. Next, we implemented a hybrid model to enhance the novelty and effectiveness of the work.</p><sec id="s4_1"><title>4.1. Results of Machine Learning Models</title><p>The training stage involves cross-validations and hyper-parameters adjustment to better connect spatial information. The rbf () function in the RSNNS package is used to build a RBFFN model. The grid parameter values was defined for the number of hidden neurons (size = c(5, 10, 15, 20)) and maximum number of iterations (maxit) of 1000. For RF the number of variables randomly sampled (mtry) parameter was used with c(2, 5, 10) values and the number of trees to grow (ntree = 100). Then, the hybrid model was constructed using the predicted values from RBFNN and RF as additional features for training the gbm model. The number of iterations (n.trees), the maximum depth of each tree (interaction. depth) and the learning rate (shrinkage) were defined as 100, 2 and 0.8 respectively for the HM model. The distribution (for HM) was specified as gaussian.</p><p><xref ref-type="table" rid="table3">Table 3</xref> shows the results of all models. The proposed HM model outperforms all individual models. It has extremely low values for both RMSE and MAE, indicating that the predicted values align closely with the actual values. The high R2 value of 0.9991087 suggests that this model explains approximately 99.91% of the variance in the spatial data, indicating a very strong fit. The proposed model is significant compared to all other models used because we have combined the best performing RBFNN (R2 = 74.22%) and RF (R2 = 82.26%). On the other hand, while the RBFNN and RF models perform reasonably well, the RF model generally outperforms the RBFNN model in terms of RMSE, MAE, and R2 scores.</p></sec><sec id="s4_2"><title>4.2. K-Fold Cross-Validation Results</title><p>To demonstrate the significance of our proposed approach, we performed a 5-fold cross-validation using all models on the used spatial dataset. <xref ref-type="table" rid="table4">Table 4</xref> shows the performance metrics in terms of RMSE on the models on a cross-validation process, along with the corresponding test error. Analyzing the spatial data, it becomes evident that the HM model consistently achieves the lowest RMSE values across all folds and exhibits the lowest test error (which is the average RMSE across all folds within a model). These findings strongly suggest that the HM model is the most accurate model for the given task. The RF model also demonstrates reasonably good performance, showcasing lower RMSE values compared to the RBFNN model. However, the RBFNN model exhibits slightly higher RMSE values, indicating a comparatively lesser accuracy in predicting the target values.</p></sec><sec id="s4_3"><title>4.3. Spatial Autocorrelation Evaluation</title><p>In this section, we measure the spatial autocorrelation Moran’s I in the residuals to validate the HM model. In the case, we created a spatial weights matrix with the knn2nb function based on the k-nearest neighbors (k = 3) of the location coordinates (latitude and longitude) of the observations. In <xref ref-type="table" rid="table5">Table 5</xref>, the global Moran’s I statistic of residuals results are describe for each models.</p><p>The Global Moran’s I value represents the spatial autocorrelation, specifically the degree of spatial clustering or similarity, observed in the residuals. The RBFNN model exhibits a Moran’s I value of 0.42, indicating a relatively strong</p><table-wrap id="table3" ><label><xref ref-type="table" rid="table3">Table 3</xref></label><caption><title> Results obtained from all models on the testing set</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Models</th><th align="center" valign="middle" >Selected values</th><th align="center" valign="middle" >RMSE</th><th align="center" valign="middle" >MAE</th><th align="center" valign="middle" >R2</th></tr></thead><tr><td align="center" valign="middle" >RBFNN</td><td align="center" valign="middle" >size = 20 maxit = 1000</td><td align="center" valign="middle" >0.1281168</td><td align="center" valign="middle" >0.0860183</td><td align="center" valign="middle" >0.7421976</td></tr><tr><td align="center" valign="middle" >RF</td><td align="center" valign="middle" >mtry = 5 ntree = 100</td><td align="center" valign="middle" >0.09955914</td><td align="center" valign="middle" >0.06559628</td><td align="center" valign="middle" >0.8225986</td></tr><tr><td align="center" valign="middle" >HM</td><td align="center" valign="middle" >n.trees = 100 interaction.depth = 2 shrinkage = 0.8</td><td align="center" valign="middle" >0.007307837</td><td align="center" valign="middle" >0.005467172</td><td align="center" valign="middle" >0.9991087</td></tr></tbody></table></table-wrap><table-wrap id="table4" ><label><xref ref-type="table" rid="table4">Table 4</xref></label><caption><title> 5-fold cross validation results</title></caption><table><tbody><thead><tr><th align="center" valign="middle" ></th><th align="center" valign="middle"  colspan="6"  >Models-Outer Folds-RMSE</th><th align="center" valign="middle" ></th></tr></thead><tr><td align="center" valign="middle" >Models</td><td align="center" valign="middle" >Fold 1</td><td align="center" valign="middle" >Fold 2</td><td align="center" valign="middle" >Fold 3</td><td align="center" valign="middle" >Fold 4</td><td align="center" valign="middle" >Fold 5</td><td align="center" valign="middle"  colspan="2"  >Test Error</td></tr><tr><td align="center" valign="middle" >RBFNN</td><td align="center" valign="middle" >0.1342258</td><td align="center" valign="middle" >0.1309185</td><td align="center" valign="middle" >0.1287859</td><td align="center" valign="middle" >0.1300938</td><td align="center" valign="middle" >0.1323121</td><td align="center" valign="middle"  colspan="2"  >0.131267</td></tr><tr><td align="center" valign="middle" >RF</td><td align="center" valign="middle" >0.09943762</td><td align="center" valign="middle" >0.10357063</td><td align="center" valign="middle" >0.10007843</td><td align="center" valign="middle" >0.10119896</td><td align="center" valign="middle" >0.10344938</td><td align="center" valign="middle"  colspan="2"  >0.101547</td></tr><tr><td align="center" valign="middle" >HM</td><td align="center" valign="middle" >0.03306925</td><td align="center" valign="middle" >0.03533340</td><td align="center" valign="middle" >0.03441766</td><td align="center" valign="middle" >0.03331788</td><td align="center" valign="middle" >0.03350357</td><td align="center" valign="middle"  colspan="2"  >0.033928</td></tr><tr><td align="center" valign="middle" ></td><td align="center" valign="middle" ></td><td align="center" valign="middle" ></td><td align="center" valign="middle" ></td><td align="center" valign="middle" ></td><td align="center" valign="middle" ></td><td align="center" valign="middle" ></td><td align="center" valign="middle" ></td></tr></tbody></table></table-wrap><table-wrap id="table5" ><label><xref ref-type="table" rid="table5">Table 5</xref></label><caption><title> Degree of global spatial autocorrelation</title></caption><table><tbody><thead><tr><th align="center" valign="middle" ></th><th align="center" valign="middle" >RBFNN</th><th align="center" valign="middle" >RF</th><th align="center" valign="middle" >HM</th></tr></thead><tr><td align="center" valign="middle" >Moran’s I of residuals</td><td align="center" valign="middle" >0.42</td><td align="center" valign="middle" >0.21</td><td align="center" valign="middle" >0.12</td></tr></tbody></table></table-wrap><p>positive spatial autocorrelation pattern in the residuals. The RF model shows a lower Moran’s I value of 0.21, suggesting a relatively weaker spatial autocorrelation compared to the RBFNN model. In contrast, the HM model demonstrates the lowest Moran’s I value of 0.12, indicating the lowest spatial autocorrelation among the two other models. In summary, the comparison of the Moran’s I values of the models shows the reduction of the spatial autocorrelation in the residuals. It clearly indicates that the performance of a model influences the way in which the model captures the spatial autocorrelation in the residuals.</p><p>The study also looked for the spatial association around each individual location. Figures 6-8 show the maps of local moran’s statistic (Ii). A positive Ii value implies that the unit is surrounded by units with similar values. It appears from the maps, all models used in this study captured the neighborhood, which means that they take into account the dependencies in the residuals according to the blue points in the figures. The hybrid model figure shows the li has a small range (−7.32 to 14.55) compared to others. While the model (HM) demonstrates high performance, it does not fully account for the spatial structure in the data, despite containing some dependencies.</p><p>This suggests that the models successfully captured the spatial property, as evidenced by the robust performance evaluation using RMSE for the HM model</p><p>and moderate performance for the other two models. These results align with our expectations, demonstrating that a specific ML model can effectively process spatial information without incorporating explicit spatial features during the learning process. Additionally, it highlights the model’s ability to capture spatial dependencies and improve accuracy.</p></sec></sec><sec id="s5"><title>5. Conclusion</title><p>This study proposed a hybrid approach for spatial dependence detection using machine learning (ML) without incorporating any spatial features in the learning process. The hybrid model (HM) was developed by combining two models, Radial basis function neural networks (RBFNN) and Random forest (RF) to achieve high accuracy and efficiency. Both models (RBFNN and RF) perform well and can detect the dependence because of their ensemble architecture. Combining them, they further achieved 99.91% of performance. This significant performance improvement observed can be attributed to the utilization of the boosting technique (Generalized Boosted Regression), which identifies errors for each model. In conclusion, the individual models were able to capture a greater amount of spatial information, including spatial dependencies as measured by global Moran and local Moran, despite having lower R2 values compared to the HM model. The HM model, on the other hand, exhibited a high R2 but showed weak positive spatial dependence.</p></sec><sec id="s6"><title>Conflicts of Interest</title><p>The authors declare no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s7"><title>Cite this paper</title><p>Barry, M.H., Nderu, L. and Gichuhi, A.W. (2023) A Hybrid Spatial Dependence Model Based on Radial Basis Function Neural Networks (RBFNN) and Random Forest (RF). Journal of Data Analysis and Information Processing, 11, 293-309. https://doi.org/10.4236/jdaip.2023.113015</p></sec></body><back><ref-list><title>References</title><ref id="scirp.126582-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Fazal, S. (2008) GIS Basics. New Age International, New Delhi.</mixed-citation></ref><ref id="scirp.126582-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Bernhardsen, T. (2002) Geographic Information Systems: An Introduction. John Wiley &amp; Sons, Hoboken.</mixed-citation></ref><ref id="scirp.126582-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Guptill, S.C. and Morrison, J.L. (2013) Elements of Spatial Data Quality. Elsevier, Amsterdam.</mixed-citation></ref><ref id="scirp.126582-ref4"><label>4</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Sneha</surname><given-names> N.S. and Pushpa </given-names></name>,<etal>et al</etal>. (<year>2014</year>)<article-title>Clustering and Noise Detection for Geographic Knowledge Discovery</article-title><source> International Journal of Advances in Engineering &amp; Technology</source><volume> 7</volume>,<fpage> 845</fpage>-<lpage>855</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.126582-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Sarker, I.H. (2021) Machine Learning: Algorithms, Real-World Applications and Research Directions. SN Computer Science, 2, Article No. 160. https://doi.org/10.1007/s42979-021-00592-x</mixed-citation></ref><ref id="scirp.126582-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Gilardi, N. and Bengio, S. (2000) Local Machine Learning Models for Spatial Data Analysis. Journal of Geographic Information and Decision Analysis, 4, 11-28.</mixed-citation></ref><ref id="scirp.126582-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Miller, H.J. (2004) Tobler’s First Law and Spatial Analysis. Annals of the Association of American Geographers, 94, 284-289. https://doi.org/10.1111/j.1467-8306.2004.09402005.x</mixed-citation></ref><ref id="scirp.126582-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Andersson, M. and Gr&amp;#229;sj&amp;#246;, U. (2009) Spatial Dependence and the Representation of Space in Empirical Models. The Annals of Regional Science, 43, 159-180. https://doi.org/10.1007/s00168-008-0211-5</mixed-citation></ref><ref id="scirp.126582-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Shekhar, S., Jiang, Z., Ali, R.Y., Eftelioglu, E., Tang, X., Gunturi, V.M.V. and Zhou, X. (2015) Spatiotemporal Data Mining: A Computational Perspective. ISPRS International Journal of Geo-Information, 4, 2306-2338. https://doi.org/10.3390/ijgi4042306</mixed-citation></ref><ref id="scirp.126582-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Pereira, G.W., Valente, D.S.M., de Queiroz, D.M., de Freitas Coelho, A.L., Costa, M.M. and Grift, T. (2022) Smart-Map: An Open-Source QGIS Plugin for Digital Mapping Using Machine Learning Techniques and Ordinary Kriging. Agronomy, 12, Article No. 1350. https://doi.org/10.3390/agronomy12061350</mixed-citation></ref><ref id="scirp.126582-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Wang, Z., Shi, W., Zhou, W., Li, X. and Yue, T. (2020) Comparison of Additive and Isometric Log-Ratio Transformations Combined with Machine Learning and Regression Kriging Models for Mapping Soil Particle Size Fractions. Geoderma, 365, Article ID: 114214. https://doi.org/10.1016/j.geoderma.2020.114214</mixed-citation></ref><ref id="scirp.126582-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Takoutsing, B. and Heuvelink, G.B.M. (2022) Comparing the Prediction Performance, Uncertainty Quantification and Extrapolation Potential of Regression Kriging and Random Forest While Accounting for Soil Measurement Errors. Geoderma, 428, Article ID: 116192. https://doi.org/10.1016/j.geoderma.2022.116192</mixed-citation></ref><ref id="scirp.126582-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Hengl, T., Nussbaum, M., Wright, M.N., Heuvelink, G.B.M. and Gr&amp;#228;ler, B. (2018) Random Forest as a Generic Framework for Predictive Modeling of Spatial and Spatio-Temporal Variables. PeerJ, 6, e5518. https://doi.org/10.7717/peerj.5518</mixed-citation></ref><ref id="scirp.126582-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Liu, X., Kounadi, O. and Zurita-Milla, R. (2022) Incorporating Spatial Autocorrelation in Machine Learning Models Using Spatial Lag and Eigenvector Spatial Filtering Features. ISPRS International Journal of Geo-Information, 11, Article No. 242. https://doi.org/10.3390/ijgi11040242</mixed-citation></ref><ref id="scirp.126582-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Dubé, J. and Legros, D. (2013) A Spatio-Temporal Measure of Spatial Dependence: An Example Using Real Estate Data. Papers in Regional Science, 92, 19-30.</mixed-citation></ref><ref id="scirp.126582-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Kumar, S., Pai, P.S. and Rao, B.R.S. (2012) Radial-Basis-Function-Network-Based Prediction of Performance and Emission Characteristics in a Bio Diesel Engine Run on WCO Ester. Advances in Artificial Intelligence, 2012, Article ID: 610487. https://doi.org/10.1155/2012/610487</mixed-citation></ref><ref id="scirp.126582-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Montazer, G.A., Giveki, D., Karami, M. and Rastegar, H. (2018) Radial Basis Function Neural Networks: A Review. Computer Reviews Journal, 1, 52-74.</mixed-citation></ref><ref id="scirp.126582-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Schonlau, M. and Zou, R.Y. (2020) The Random Forest Algorithm for Statistical Learning. The Stata Journal, 20, 3-29. https://doi.org/10.1177/1536867X20909688</mixed-citation></ref><ref id="scirp.126582-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Li, Y., Zou, C., Berecibar, M., Nanini-Maury, E., Chan, J.C.-W., Van den Bossche, P., Van Mierlo, J. and Omar, N. (2018) Random Forest Regression for Online Capacity Estimation of Lithium-Ion Batteries. Applied Energy, 232, 197-210. https://doi.org/10.1016/j.apenergy.2018.09.182</mixed-citation></ref><ref id="scirp.126582-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Al Mamun, A., Sohel, M., Mohammad, N., Sunny, M.S.H., Dipta, D.R. and Hossain, E. (2020) A Comprehensive Review of the Load Forecasting Techniques Using Single and Hybrid Predictive Models. IEEE Access, 8, 134911-134939.https://doi.org/10.1109/ACCESS.2020.3010702</mixed-citation></ref><ref id="scirp.126582-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">Anguita, D., Ghelardoni, L., Ghio, A., Oneto, L. and Ridella, S. (2012) The ‘K’ in K-Fold Cross Validation. 20th European Symposium on Artificial Neural Networks, Computational Intelligence and Machine Learning (ESANN), Bruges, 25 to 27 April 2012, 441-446.</mixed-citation></ref><ref id="scirp.126582-ref22"><label>22</label><mixed-citation publication-type="book" xlink:type="simple">Berrar, D. (2019) Cross-Validation. In: Ranganathan, S., Gribskov, M., Nakai, K. and Christian Sch&amp;#246;nbach, C., Eds., Reference Module in Life Sciences Encyclopedia of Bioinformatics and Computational Biology, Vol. 1, Elsevier, Amsterdam, 542-545. https://doi.org/10.1016/B978-0-12-809633-8.20349-X</mixed-citation></ref><ref id="scirp.126582-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">Laradji, I.H., Alshayeb, M. and Ghouti, L. (2015) Software Defect Prediction Using Ensemble Learning on Selected Features. Information and Software Technology, 58, 388-402. https://doi.org/10.1016/j.infsof.2014.07.005</mixed-citation></ref><ref id="scirp.126582-ref24"><label>24</label><mixed-citation publication-type="other" xlink:type="simple">Xu, Z., Huang, G., Weinberger, K.Q. and Zheng, A.X. (2014) Gradient Boosted Feature Selection. Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, New York, 24-27 August 2014, 522-531.</mixed-citation></ref><ref id="scirp.126582-ref25"><label>25</label><mixed-citation publication-type="other" xlink:type="simple">Friedman, J.H. (2001) Greedy Function Approximation: A Gradient Boosting Machine. Annals of Statistics, 29, 1189-1232. https://doi.org/10.1214/aos/1013203451</mixed-citation></ref></ref-list></back></article>