<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>SOME ASPECTS OF MACHINE LEARNING IN LOCATION TASKS</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Kateryna Kononova</string-name>
          <email>kateryna.kononova@karazin.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Economic Cybernetics and Applied Economics, V. N. Karazin Kharkiv National University</institution>
        </aff>
      </contrib-group>
      <fpage>50</fpage>
      <lpage>57</lpage>
      <abstract>
        <p>As a result of the study, locations for Pan-Asian food delivery service in Kharkiv have been found so that their network evenly covered the entire city; and different units were at an acceptable distance from each other. The company's order database allowed us to apply ML algorithms, in particular, clustering methods to find optimal locations. Three clustering models were developed and a series of experiments were conducted with each of them. The analysis of the model results allowed us to confirm both hypotheses put forward in the paper, namely: 1) reducing dimension does not skew clustering results obtained on the full database; 2) urban traffic has a significant impact on clustering results. This made us recommend pre-group the data and consider urban traffic in location tasks for the referred company.</p>
      </abstract>
      <kwd-group>
        <kwd>Location task</kwd>
        <kwd>Machine Learning</kwd>
        <kwd>Clustering</kwd>
        <kwd>Shift Means</kwd>
        <kwd>Kmeans</kwd>
        <kwd>API</kwd>
        <kwd>Google maps</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>The company’s success significantly depends on the location. It affects not only the
cost of rent, access to materials, workers, transportation, but also the perception of the
brand and expansion of the customer number.</p>
      <p>
        Location databases have enabled companies to do initial screening themselves,
hence reducing their need to rely on external experts to providing only very specific
information on locations [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Machine Learning (ML) algorithms are effectively used
for finding the right locations using accumulated companies’ data; especially,
clustering methods, which within the geomarketing approach, use spatial data
(coordinates, address, registry or other bindings) along with general information.
      </p>
      <p>
        Various theoretical aspects of ML application in the location tasks are explored in
the scientific literature. Montejano et al. overviewed different location models used
within the geomarketing field, exemplifying it through the use of Geographic
Information Systems (GIS) [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Serajnik et al. performed the statistical analysis,
evaluated geodata and carried out spatial analysis with a subsequent cartographic
visualization to define mall location strategy [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Rosu et al. used quantitative
models for measuring accessibility to the existing shopping centers in the city,
calculating thus their catchment area, for identifying a suitable location for a new
shopping center [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>
        A lot of papers are devoted to the location task analysis in food retail. To propose
new locations for the supermarkets, Grassi [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] analyzed four conditions that are
prioritizing for new locations: the supermarket area of influence, road access,
competition and income of the target audience. Based on the analytic hierarchy
process method and spatial analysis of GIS, Xiao [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] built a methodology for the
process of selecting a supermarket site location. Bekti [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and Baviera-Puig provided
an application of the spatial methods for retail marketing strategy development for the
supermarkets [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        Geomarketing algorithms are also widely used in international and domestic
business practices. For example, WIGeoGIS [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] helps to choose the best GIS system
and the relevant market data, as well as implements of mapping solution for location
analysis. Ukrainian company GeoDesign [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] offers a business strategy development
using spatial data.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Hypothesis</title>
      <p>The object of the study is the Pan-Asian food delivery service, which is tasked with
finding optimal locations for a network of its units. The company is represented in
several cities of Ukraine, including Kharkiv where it already has three divisions.</p>
      <p>The company is rising rapidly, the number of its customers is growing, so the
current production capacity is no longer sufficient to meet the orders flow in strict
delivery time limits. Therefore, the company has a need to open two new divisions so
that the load at all units was uniform, and the delivery time took no more than 15
minutes. It was decided to renovate the company structure completely closing the old
units and opening new ones in the optimal locations.</p>
      <p>Delivery time is a key location factor for this company. Thus, it was important to
test the impact of urban traffic on model results.</p>
      <p>To find the optimal locations, data on the orders made in Kharkiv last year at peak
hours (from 15-00 to 21-00) were collected. During this period 36095 orders were
received from 9002 customers (table 1).</p>
      <p>To find dense areas of the customers, we decided to design clustering models.</p>
      <p>
        Since it was decided to use Google Maps API [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] to consider urban traffic in the
model, it was crucial to optimize the number of requests sent online at each stage of
the clustering algorithm. Hence, it was necessary to choose the method of combining
points into a cluster, and decide if it should be based on pairwise distances or centroid
method. The advantage of the first-type methods is that they do not need recalculating
distances every time after combining, which significantly reduces the computational
complexity of the algorithm.
      </p>
      <p>However, according to preliminary estimates, the use of pairwise distances
methods requires more than 81 million requests for a base of 9,000 clients; while for
the five clusters detecting, centroid methods require about 45,000 requests for each
iteration (and given that 30-40 iterations are needed for the algorithm convergence,
we get about 1.5 million requests only). Thus, the centroid method has been chosen.</p>
      <p>Nevertheless, the question of query optimization remained open. To solve this
problem, it was decided to test the hypothesis that dimension reduction does not skew
the results of clustering.</p>
      <p>Thus, the following two hypotheses were put forward for consideration in the
paper:
1)
reducing dimension does not skew clustering results obtained on the full
database;
2) urban traffic has a significant impact on clustering results.</p>
      <p>Three clustering experiments were performed to test these hypotheses:
 full sample clustering,
 pre-grouped sample clustering,
 clustering based on the urban traffic data.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Full sample clustering</title>
      <p>
        Mean Shift algorithm based on the centroid method was selected for clustering. Mean
shift clustering is a sliding-window-based algorithm that attempts to find dense areas
of data points. It is a centroid-based algorithm meaning that the goal is to locate the
center points of each class, which works by updating candidates for center points to
be the mean of the points within the sliding-window. These candidate windows are
then filtered in a post-processing stage to eliminate near-duplicates, forming the final
set of center points and their corresponding groups [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>
        To use this algorithm with geographical coordinates, one has to select a distance
metric. Since the size of the sliding window was given in kilometers, it was decided to
use the Haversine metric [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]:
(√
(
)
( )
( )
(
))
where d is the distance between points (in km);
r is the globe radius (6371 km);
x1, x2 is the longitude of two points;
y1, y2 is the latitude of two points.
      </p>
      <p>The results of the baseline clustering model obtained on the full dataset are
presented in Table 2 and Figure 1.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Pre-grouped sample clustering</title>
      <p>
        To check the first hypothesis, a weighted clustering method was used to reduce the
dimension. A centroid calculated by a weighted value considers each customer to
have individual value. The centroid is not created in the center of all customers but in
the center of the customers who most satisfy the value, one has weighted [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>Using a k-means algorithm with the Haversine metric to detect 500 clusters, the
coordinates of the weighted centers were obtained.</p>
      <p>Figure 2 presents the initial points (marked red), and the weighted centers (marked
purple).</p>
      <p>Next, the set of 500 points was clustered using the Mean Shift algorithm and the
following estimates were obtained (Figure 3, Table 3).</p>
      <p>Comparative analysis of the first and second clustering results showed that the
reduction of dimension does not lead to its significant skew, the obtained clusters
coincide by 97%. This allowed us to use the pre-grouped dataset for the calculations,
which require urban traffic data.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Clustering based on the urban traffic data</title>
      <p>
        To consider urban traffic data, the clustering algorithm has been modified – to
measure the distance between the two points instead of the Haversine metric we used
data provided by Google Maps [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>Working with the Google Maps API, the following settings were specified: type of
transport was ‘car’; forecast time was ‘02.12.2019 18:00’; forecast type was ‘most
likely’ (‘pessimistic’ and ‘optimistic’ estimates were also tested).</p>
      <p>As a result of the clustering model with regard to urban traffic, the following
estimates were obtained (Figure 4, Table 4).</p>
      <p>Cluster</p>
      <p>Comparative analysis of three clustering experiments showed that traffic data
significantly affects the clustering results. This leads to the conclusion that it is
necessary to consider this factor in location tasks for the referred company.</p>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusions</title>
      <p>As a result of the study, locations for Pan-Asian food delivery service in Kharkiv have
been found so that their network evenly covered the entire city; and different units
were at the acceptable distance from each other (less than 15 minutes by car).</p>
      <p>To find the locations, data about 36095 orders from 9002 customers were
collected. The location database has enabled us to do screening using ML algorithms,
in particular, clustering methods, which within a geomarketing approach, use spatial
data along with general information.</p>
      <p>Two hypotheses have been put forward for consideration, namely:
1) reducing dimension does not skew clustering results obtained on the full
database;
2) urban traffic has a significant impact on clustering results.</p>
      <p>Three clustering models were developed and a series of experiments were
conducted with each of them.</p>
      <p>Comparative analysis of the first and second clustering results showed that the
reduction of dimension does not lead to its significant skew. This allows us to use the
pre-grouped dataset for the calculations based on urban traffic data.</p>
      <p>To calculate the distance between two points with regard to urban traffic, the
Haversine metric has been replaced with Google Maps data. The analysis of the
experiments showed that traffic data significantly affects the clustering results.</p>
      <p>Thus, as a result of the study, both hypotheses were confirmed. This made us
recommend pre-group the data and consider urban traffic in location tasks for the
referred company.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. ArcGIS. (
          <year>2019</year>
          ).
          <article-title>Find optimal store locations</article-title>
          . Retrieved from http://desktop.arcgis.com/ru/arcmap/latest/extensions/business-analyst/
          <article-title>find-optimal-storelocations-mean-store</article-title>
          .htm.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Baviera-Puig</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Buitrago-Vera</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Escriba-Pere</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          (
          <year>2016</year>
          ).
          <article-title>Geomarketing Models in Supermarket Location Strategie</article-title>
          .
          <source>Journal of Business Economics and Management</source>
          ,
          <volume>17</volume>
          (
          <issue>6</issue>
          ),
          <fpage>1205</fpage>
          -
          <lpage>1221</lpage>
          . DOI:
          <volume>10</volume>
          .3846/16111699.
          <year>2015</year>
          .
          <volume>1113198</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Bekti</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pratiwi</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Jatipaningrum</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          (
          <year>2018</year>
          ).
          <article-title>Multiplicative Competition Interaction Model to obtained Retail Consumer Choice based on Spatial Analysis</article-title>
          .
          <source>IOP Conference Series: Earth and Environmental Science</source>
          ,
          <volume>187</volume>
          (
          <issue>1</issue>
          ),
          <fpage>1</fpage>
          -
          <lpage>9</lpage>
          . DOI:
          <volume>10</volume>
          .1088/
          <fpage>1755</fpage>
          - 1315/187/1/012041.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. Geodesign.info. (
          <year>2019</year>
          ). Retrieved from https://geodesign.info/.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Google</given-names>
            <surname>Maps</surname>
          </string-name>
          . (
          <year>2019</year>
          ). Retrieved from https://www.google.com/maps/.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Grassi</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          (
          <year>2010</year>
          ). Estratégias de localização de uma rede de supermercados:
          <article-title>o geomarketing aplicado à companhia zaffari em Porto Alegre. Porto Alegre, Brasilia: Universidade Federal do Rio Grande do Sul</article-title>
          .
          <source>DOI: 10.13140/RG.2.2.23534.31041.</source>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Heil</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          (
          <year>2012</year>
          ).
          <article-title>Location strategy</article-title>
          . Retrieved from https://www.referenceforbusiness.com/management/Int-Loc/Location-Strategy.html.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Montejano</surname>
            ,
            <given-names>J.A.</given-names>
          </string-name>
          , &amp; Cruz Bello,
          <string-name>
            <surname>G.M.</surname>
          </string-name>
          (
          <year>2018</year>
          , February 5).
          <source>Geomarketing Localization Models. Espacialidades</source>
          , Revista de temas Contemporáneos sobre lugares, política y cultura,
          <volume>8</volume>
          (
          <issue>1</issue>
          ),
          <fpage>95</fpage>
          -
          <lpage>120</lpage>
          . Retrieved from http://espacialidades.cua.uam.mx/vol/08/2018/01/06_Montejano_y_Cruz.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Rosu</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Blăgeanu</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Ionuţ-Ciprian</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          (
          <year>2013</year>
          ).
          <article-title>Geomarketing. A New Approach in Decision Marketing: Case Study - Shopping Centres in IASI</article-title>
          . Lucrările seminarului geografic 'Dimitrie Cantemir',
          <volume>36</volume>
          ,
          <fpage>123</fpage>
          -
          <lpage>133</lpage>
          . Retrieved from https://www.researchgate.net/publication/291956981_ GEOMARKETING_
          <article-title>- A_NEW_APPROACH_IN_DECISION_ MARKETING_CASE_STUDY_- _SHOPPING_CENTRES_IN_IASI</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Seif</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          (
          <year>2018</year>
          ).
          <article-title>The 5 Clustering Algorithms Data Scientists Need to Know</article-title>
          . Retrieved from https://towardsdatascience.com/the-5
          <article-title>-clustering-algorithms-data-scientists-need-toknow-a36d136ef68.</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Serajnik</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Amaduzzi</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Paulus</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          (
          <year>2014</year>
          ).
          <article-title>Geomarketing. Analyses of the Città Fiera Ma</article-title>
          .
          <source>GI_Forum</source>
          ,
          <volume>1</volume>
          ,
          <fpage>105</fpage>
          -
          <lpage>114</lpage>
          . DOI:
          <volume>10</volume>
          .1553/giscience2014s105.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Sinnott</surname>
            <given-names>R.W.</given-names>
          </string-name>
          (
          <year>1984</year>
          ).
          <article-title>Virtues of the Haversine</article-title>
          .
          <source>Sky and Telescope</source>
          <volume>68</volume>
          (
          <issue>2</issue>
          ),
          <fpage>159</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Wigeogis</surname>
          </string-name>
          . (
          <year>2019</year>
          ).
          <article-title>Transparency and success. Geomarketing supports retailers</article-title>
          . Retrieved from https://www.wigeogis.com/en/retail_geomarketing/.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Xiao</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Ye</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          (
          <year>2019</year>
          ).
          <article-title>Combining GIS and the Analytic Hierarchy Process to Analyze Location of hypermarke</article-title>
          .
          <source>IOP Conference Series: Earth and Environmental Science</source>
          ,
          <volume>237</volume>
          ,
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          . DOI:
          <volume>10</volume>
          .1088/
          <fpage>1755</fpage>
          -1315/237/3/032012.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>