使用K-Means对美因河畔法兰克福的社区进行聚类
介紹 (Introduction)
This blog post summarizes the results of the Capstone Project in the IBM Data Science Specialization on Coursera. Within the project, the districts of Frankfurt am Main in Germany shall be clustered according to their venue data using the K-Means clustering algorithm. The first section describes the Business problem that we will be dealing with. Then we shall take a look at the data that can be used to solve the problem and the methodology for finding a solution.
這篇博客文章總結(jié)了Coursera上IBM Data Science Specialization中Capstone項(xiàng)目的結(jié)果。 在項(xiàng)目內(nèi),應(yīng)使用K-Means聚類算法根據(jù)其場地?cái)?shù)據(jù)對德國美因河畔法蘭克福地區(qū)進(jìn)行聚類。 第一部分描述了我們將要處理的業(yè)務(wù)問題。 然后,我們將研究可用于解決問題的數(shù)據(jù)和找到解決方案的方法。
業(yè)務(wù)問題 (Business Problem)
A client is interested in opening a franchise of their Asian restaurant chain in the city of Frankfurt am Main, preferably close to the city center. It will be their first restaurant in the city, and they want us to find out which would be the best neighborhood/district to open an Asian restaurant in the city. Additionally, the results of the clustering algorithm t can also be used by someone interested in moving to Frankfurt and wanting to know about the cuisines available in the various districts.
客戶有興趣在美因河畔法蘭克福市(最好是靠近市中心)開設(shè)其亞洲餐廳連鎖店的特許經(jīng)營權(quán)。 這將是他們在這座城市的第一家餐廳,他們希望我們找出哪一個(gè)是在城市開設(shè)亞洲餐廳的最佳社區(qū)/地區(qū)。 另外,聚類算法t的結(jié)果也可以供有興趣移居法蘭克福并希望了解各個(gè)地區(qū)可用美食的人使用。
數(shù)據(jù) (Data)
Following datasets have been used in this project:
在該項(xiàng)目中使用了以下數(shù)據(jù)集:
Street Directory of the city of Frankfurt am Main: https://offenedaten.frankfurt.de/dataset/strassenverzeichnis-der-stadt-frankfurt-am-main
美因河畔法蘭克福市街道目錄: https : //offenedaten.frankfurt.de/dataset/strassenverzeichnis-der-stadt-frankfurt-am-main
Demographics of Frankfurt am Main Neighborhoods : https://offenedaten.frankfurt.de/dataset/stadtteilprofile-bevoelkerung
法蘭克福主要社區(qū)的人口統(tǒng)計(jì)學(xué): https : //offenedaten.frankfurt.de/dataset/stadtteilprofile-bevoelkerung
Election Atlas 2015 — GeoJSON Frankfurt neighborhoods: https://offenedaten.frankfurt.de/dataset/wahlatlas-2015-geodaten/resource/84dff094-ab75-431f-8c64-39606672f1da
2015年選舉地圖集-法蘭克福GeoJSON社區(qū): https : //offenedaten.frankfurt.de/dataset/wahlatlas-2015-geodaten/resource/84dff094-ab75-431f-8c64-39606672f1da
數(shù)據(jù)收集與清理 (Data Gathering and cleaning)
We will analyze the districts of the city of Frankfurt am Main in this project. The datasets are available as CSV files which can be converted into a pandas dataframe using the pd.read_csv function inbuilt in pandas.
我們將在此項(xiàng)目中分析美因河畔法蘭克福市的地區(qū)。 數(shù)據(jù)集以CSV文件形式提供,可以使用內(nèi)置在pandas中的pd.read_csv函數(shù)將其轉(zhuǎn)換為pandas數(shù)據(jù)框。
Data 1: Street directory of Frankfurt am Main:
數(shù)據(jù)1:美因河畔法蘭克福的街道目錄:
This dataset will be used to extract the district names and postcodes in Frankfurt. It is available as a CSV file and can be accessed via the link given above. Frankfurt contains 46 city districts. This is a huge dataset containing 4540 rows and 15 columns. Therefore, it was necessary to shorten and clean it by keeping only the data that is required. It is a street directory, which is why the dataset is so big. It was shortened to extract only the district names and postcodes. The resultant dataset contained 46 rows (one for each district) and 3 columns.
該數(shù)據(jù)集將用于提取法蘭克福的地區(qū)名稱和郵政編碼。 它以CSV文件的形式提供,可以通過上面給出的鏈接進(jìn)行訪問。 法蘭克福包含46個(gè)市區(qū)。 這是一個(gè)巨大的數(shù)據(jù)集,包含4540行和15列。 因此,有必要通過僅保留所需的數(shù)據(jù)來縮短和清理它。 這是街道目錄,因此數(shù)據(jù)集如此之大。 縮短了提取區(qū)域名稱和郵政編碼的時(shí)間。 結(jié)果數(shù)據(jù)集包含46行(每個(gè)區(qū)一個(gè))和3列。
Data 2 :
數(shù)據(jù)2:
The geographical coordinates of the districts will be utilized as input for Foursquare API that will be leveraged to extract information for each district respectively. We will use the Foursquare API to explore the districts in Frankfurt. We use Foursquare API to get the most common venues for each district. Foursquare returns a JSON file, from which required data needs to be extracted. We only extract the venue name, category, and geographical coordinates for each venue. These are then stored in a separate dataframe, for use in clustering.
地區(qū)的地理坐標(biāo)將被用作Foursquare API的輸入,Foursquare API將被用于分別提取每個(gè)地區(qū)的信息。 我們將使用Foursquare API探索法蘭克福地區(qū)。 我們使用Foursquare API獲取每個(gè)地區(qū)最常見的場所。 Foursquare返回一個(gè)JSON文件,需要從中提取所需的數(shù)據(jù)。 我們僅提取每個(gè)場地的場地名稱,類別和地理坐標(biāo)。 然后將它們存儲在單獨(dú)的數(shù)據(jù)框中,以用于群集。
Data 3: Frankfurt Demographics:
資料3:法蘭克福客層:
This dataset contains the district-wise distribution of population for the city of Frankfurt. It also contains useful data about the percentage of foreigners and specifically, population of various ethnicities in the districts. It contains 46 rows (one for each district) and 164 columns. It needs to be shortened to analyze. Only the required columns were picked from this dataset, which contained information about the total population of each district, population of foreigners, and so on. Moreover, the column names are in German. These were translated into English for easy understanding.
該數(shù)據(jù)集包含法蘭克福市的區(qū)域人口分布。 它還包含有關(guān)外國人百分比,特別是各地區(qū)不同種族人口的有用數(shù)據(jù)。 它包含46行(每個(gè)區(qū)一個(gè))和164列。 需要縮短分析時(shí)間。 從此數(shù)據(jù)集中僅選擇了必需的列,其中包含有關(guān)每個(gè)地區(qū)的總?cè)丝?#xff0c;外國人的人口等信息。 此外,列名是德語。 這些被翻譯成英文以便于理解。
Data 4: Frankfurt neighborhoods GeoJSON:
數(shù)據(jù)4:法蘭克福社區(qū)GeoJSON:
The geoJSON file is required for plotting the Choropleth maps to analyze the demographics of Frankfurt districts. The district names in this file must match the district names in the dataset which is intended to be plotted. After checking, it was found that the districts of Bahnhofsviertel and Gutleutviertel are combined into a single district in the geoJSON file. Thus, the 2 district rows were merged in the demographics dataset. Also, there was an issue with the German letters containing umlauts, i.e. ü, ?, ?. Hence, districts containing these letters were also renamed as per the characters found in their equivalent names in the geoJSON file.
繪制Choropleth地圖以分析法蘭克福地區(qū)的人口統(tǒng)計(jì)信息時(shí),需要geoJSON文件。 該文件中的區(qū)域名稱必須與要繪制的數(shù)據(jù)集中的區(qū)域名稱匹配。 檢查之后,發(fā)現(xiàn)在geoJSON文件中,Bahnhofsviertel和Gutleutviertel的區(qū)域合并為一個(gè)區(qū)域。 因此,這2個(gè)地區(qū)行已合并到人口統(tǒng)計(jì)數(shù)據(jù)集中。 另外,包含變音符號(即ü,?,?)的德語字母也存在問題。 因此,包含這些字母的地區(qū)也根據(jù)geoJSON文件中相同名稱中的字符進(jìn)行了重命名。
方法 (Methodology)
Analytical Approach
分析方法
We shall first use k-means clustering to cluster the neighborhoods in Frankfurt. Frankfurt has 46 districts. We shall use the geocoder to get the geographical coordinates for each of these districts. We will use Foursquare API to explore the districts using their coordinates and get the most common venues in each district. Based on this information, we shall cluster the districts using k-means and take a look at each cluster. We need to look at clusters with a greater number of Asian and similar cuisine restaurants, as that indicates that there is demand for Asian cuisine in that cluster.
我們將首先使用k-means聚類對法蘭克福的社區(qū)進(jìn)行聚類。 法蘭克福有46個(gè)區(qū)。 我們將使用地理編碼器獲取這些地區(qū)中每個(gè)地區(qū)的地理坐標(biāo)。 我們將使用Foursquare API使用坐標(biāo)來探索區(qū)域,并獲取每個(gè)區(qū)域中最常見的場所。 基于此信息,我們將使用k均值對區(qū)域進(jìn)行聚類,并查看每個(gè)聚類。 我們需要查看具有更多亞洲和類似美食餐廳的集群,因?yàn)檫@表明該集群中對亞洲美食有需求。
Then we shall use the demographics data to find the districts with a greater population and compare that with the cluster data. We shall find districts that have more Asian restaurants as well as a sizeable Asian population, as these will be ideal for opening a new Asian restaurant. Additionally, we shall also look at closeby districts with lesser Asian restaurants but a sizeable Asian population, as this is also a good prospect, due to less competition in the area.
然后,我們將使用人口統(tǒng)計(jì)數(shù)據(jù)查找人口較多的地區(qū),并將其與聚類數(shù)據(jù)進(jìn)行比較。 我們將找到擁有更多亞洲餐廳以及大量亞洲人口的地區(qū),因?yàn)檫@些地區(qū)對于開設(shè)新的亞洲餐廳非常理想。 此外,我們還將關(guān)注亞洲餐館較少但亞洲人口眾多的附近地區(qū),因?yàn)橛捎谠摰貐^(qū)競爭較少,這也是一個(gè)很好的前景。
Photo by oxana v on Unsplash oxana v在Unsplash上的照片The street directory dataset is scraped and sliced to ultimately obtain just a list of districts in Frankfurt am Main along with their postal codes.
街道目錄數(shù)據(jù)集將被剪切和切片,最終僅可獲得美因河畔法蘭克福的地區(qū)列表以及其郵政編碼。
We require the geographical coordinates of the districts to plot on a map using Folium. These are not readily available in the dataset. We obtain the latitude and longitude for each district using Geopy- geopy is a Python 2 and 3 client for several popular geocoding web services.
我們要求使用Folium在地圖上繪制區(qū)域的地理坐標(biāo)。 這些在數(shù)據(jù)集中并不容易獲得。 我們使用Geopy獲得每個(gè)地區(qū)的緯度和經(jīng)度。geopy是Python 2和3客戶端,用于幾種流行的地理編碼Web服務(wù)。
Geopy makes it easy for Python developers to locate the coordinates of addresses, cities, countries, and landmarks across the globe using third-party geocoders and other data sources to get the data.
Geopy使Python開發(fā)人員可以使用第三方地理編碼器和其他數(shù)據(jù)源輕松獲取全球地址,城市,國家和地標(biāo)的坐標(biāo),以獲取數(shù)據(jù)。
Map of districts in Frankfurt am Main plotted using Folium使用Folium繪制的美因河畔法蘭克福地區(qū)地圖Next, the top 100 venues shall be fetched for each postal code. For this task, an API call to the Foursquare API is performed. The Foursquare API offers location data from all over the world for business purposes as well as for developers. The required format of the URL for performing an API call to the Foursquare API is displayed below. A developer only needs a free developer account.
接下來,應(yīng)為每個(gè)郵政編碼獲取前100個(gè)場所。 對于此任務(wù),執(zhí)行對Foursquare API的API調(diào)用。 Foursquare API提供了來自世界各地的位置數(shù)據(jù),用于商業(yè)目的以及開發(fā)人員。 下面顯示了執(zhí)行對Foursquare API的API調(diào)用所需的URL格式。 開發(fā)人員只需要一個(gè)免費(fèi)的開發(fā)人員帳戶。
Python code for making a call to the Foursquare API用于調(diào)用Foursquare API的Python代碼The received venues are stored in a new dataframe. We check for the number of unique venue categories present in the data returned by Foursquare. It turns out there are 188 unique venue categories in Frankfurt.
接收到的場所將存儲在新的數(shù)據(jù)框中。 我們檢查Foursquare返回的數(shù)據(jù)中存在的唯一場所類別的數(shù)量。 事實(shí)證明,法蘭克福有188個(gè)獨(dú)特的場館類別。
Next up, we need to prepare the data for the K-means clustering algorithm. It cannot work with textual data or more commonly known as categorical data. Hence we need to encode the data using one-hot encoding. The encoded data is then grouped by District name in order to have 1 row for each district. When the data gets grouped, the one-hot encoded categories get summed up if a venue category appears more than once within a district. In order to have values at the same scale and smaller than one, the mean of the frequency of occurrence of each category is calculated and stored.
接下來,我們需要為K-means聚類算法準(zhǔn)備數(shù)據(jù)。 它不能與文本數(shù)據(jù)或更常用的分類數(shù)據(jù)一起使用。 因此,我們需要使用一鍵編碼對數(shù)據(jù)進(jìn)行編碼。 然后按地區(qū)名稱對編碼數(shù)據(jù)進(jìn)行分組,以便每個(gè)地區(qū)有1行。 對數(shù)據(jù)進(jìn)行分組后,如果場所類別在一個(gè)區(qū)域中出現(xiàn)多次,則將對一鍵編碼類別進(jìn)行匯總。 為了使值具有相同的標(biāo)度并且小于1,計(jì)算并存儲每個(gè)類別的出現(xiàn)頻率的平均值。
In order to get more insights into the data, the top 10 most common venues for each district are obtained and a separate dataframe is created to store these.
為了更深入地了解數(shù)據(jù),獲取了每個(gè)地區(qū)的前10個(gè)最常見的場所,并創(chuàng)建了一個(gè)單獨(dú)的數(shù)據(jù)框來存儲這些場所。
Dataframe containing top 10 most common venues for each district數(shù)據(jù)框包含每個(gè)區(qū)的前10個(gè)最常見的場所使用K均值聚類 (Clustering using K-means)
The one-hot encoded and grouped data is the input to the K-means algorithm and the number of clusters is set to five. We use the scikit-learn library for the K-means algorithm. The district column is dropped as it is textual data and we need to cluster using only the encoded values. The resulting cluster labels are then additionally stored in the data frame containing the ten most common venues for each district.
一鍵編碼和分組的數(shù)據(jù)是K-means算法的輸入,并且簇?cái)?shù)設(shè)置為五個(gè)。 我們將scikit-learn庫用于K-means算法。 區(qū)域列被刪除,因?yàn)樗俏谋緮?shù)據(jù),因此我們只需要使用編碼后的值進(jìn)行聚類。 然后,將生成的聚類標(biāo)簽另外存儲在包含每個(gè)地區(qū)十個(gè)最常見場所的數(shù)據(jù)框中。
Python code for K-means clustering用于K均值聚類的Python代碼 Dataframe containing the cluster labels along with the top 10 venues for each district數(shù)據(jù)框包含群集標(biāo)簽以及每個(gè)區(qū)的前10個(gè)場所The dataframe containing the cluster labels and top venues is then merged with the dataframe containing latitude and longitude as seen in image above. This data was then used to visualize the clusters on a map using Folium.
然后,將包含聚類標(biāo)簽和頂部地點(diǎn)的數(shù)據(jù)框與包含緯度和經(jīng)度的數(shù)據(jù)框合并,如上圖所示。 然后使用Folium將這些數(shù)據(jù)用于在地圖上可視化群集。
Map of clustered districts — Frankfurt am Main集聚區(qū)地圖—美因河畔法蘭克福We then look at each cluster and based on the most common venues, we can name them and make decisions on which cluster is suitable for opening a new Asian restaurant.
然后,我們查看每個(gè)集群,并根據(jù)最常見的場所進(jìn)行命名,并確定哪個(gè)集群適合開設(shè)新的亞洲餐廳。
觀察結(jié)果 (Observations)
We observe that the purple and light green clusters contain the most districts and the most number of venues. While the light green cluster contains more restaurants, the purple cluster contains more hotels, which indicates tourists. We can see that a variety of cuisines are offered in the light green cluster, indicating that they cater to a variety of customers. Most of the districts are located close to the city center. These factors make this cluster the most eligible for opening a new Asian restaurant.
我們觀察到紫色和淺綠色的群集包含最多的區(qū)域和最多的場所。 淺綠色的群集包含更多的餐廳,而紫色的群集包含更多的酒店,表示游客。 我們可以看到,淺綠色群集中提供了多種美食,表明它們可以滿足各種客戶的需求。 大多數(shù)地區(qū)都靠近市中心。 這些因素使該集群最有資格開設(shè)新的亞洲餐廳。
The purple cluster, on the other hand, although it does not contain many restaurants, has a lot of hotels and is pretty close to the city center. Presence of hotels indicates an influx of tourists, some of them Asian, meaning more prospective customers and if one finds a location not too far from the city center, an Asian restaurant here could flourish.
另一方面,紫色群集雖然沒有很多餐廳,但擁有許多旅館,并且非常靠近市中心。 旅館的存在表明游客的涌入,其中一些是亞洲人,這意味著潛在的顧客更多,如果發(fā)現(xiàn)離市中心不遠(yuǎn)的地點(diǎn),這里的亞洲餐館可能會興旺。
To know which district specifically would be perfect for opening an Asian restaurant, we look at the district-wise demographics of Frankfurt am Main, and then explore districts from both the light green and purple clusters.
要了解哪個(gè)區(qū)域最適合開設(shè)亞洲餐廳,我們先看一下美因河畔法蘭克福的區(qū)域人口統(tǒng)計(jì)信息,然后從淺綠色和紫色群集中探索區(qū)域。
數(shù)據(jù)探索-法蘭克福人口統(tǒng)計(jì) (Data Exploration — Frankfurt demographics)
The demographics dataset contains district-wise distribution of population for the city of Frankfurt. It also contains useful data about the percentage of foreigners and specifically, population of various ethnicities in the districts. Only the required columns were picked from this dataset, which contained information about the total population of each district, population of foreigners, and so on. This dataset was then merged with the dataset containing the latitude and longitudes of the districts. The resulting dataset is as seen below.
人口統(tǒng)計(jì)數(shù)據(jù)集包含法蘭克福市的區(qū)域人口分布。 它還包含有關(guān)外國人百分比,特別是各地區(qū)不同種族人口的有用數(shù)據(jù)。 從該數(shù)據(jù)集中僅選擇了必需的列,其中包含有關(guān)每個(gè)地區(qū)的總?cè)丝?#xff0c;外國人的人口等信息。 然后將此數(shù)據(jù)集與包含地區(qū)緯度和經(jīng)度的數(shù)據(jù)集合并。 結(jié)果數(shù)據(jù)集如下所示。
Frankfurt demographics data overview法蘭克福人口統(tǒng)計(jì)數(shù)據(jù)概述使用Choropleth映射進(jìn)行數(shù)據(jù)可視化 (Data visualization using Choropleth maps)
The data from the demographics dataset is then plotted on a Choropleth map to visualize the population distribution across the city of Frankfurt. This data will then be used to select districts based on the earlier clustering results to explore further.
然后,將人口統(tǒng)計(jì)數(shù)據(jù)集中的數(shù)據(jù)繪制在Choropleth地圖上,以可視化法蘭克福市的人口分布。 然后,將根據(jù)較早的聚類結(jié)果將這些數(shù)據(jù)用于選擇地區(qū),以進(jìn)行進(jìn)一步的探索。
District-wise population distribution — Frankfurt am Main地區(qū)人口分布—美因河畔法蘭克福From this map, we observe that the central districts have the highest populations in Frankfurt, along with the district of Flughafen on the outskirts.
從這張地圖中,我們觀察到法蘭克福以及法蘭克福郊區(qū)的Flughafen地區(qū)人口最多。
Next, we take a look at the distribution of Asian and Australian population in Frankfurt.
接下來,我們來看看法蘭克福的亞洲和澳大利亞人口分布。
District-wise distribution of Asian and Australian population — Frankfurt am Main亞洲和澳大利亞人口的地區(qū)分布—美因河畔法蘭克福We can see from the above maps, that the districts of Bockenheim and Gallus have the highest population of Asians and Australians. Out of these, Bockenheim comes under the light green cluster, and Gallus comes under the purple cluster. These 2 neighborhoods are then explored to find out the number of Asian or similar cuisine restaurants in these districts.
從上面的地圖我們可以看到,博肯海姆和蓋洛斯地區(qū)的亞洲人和澳大利亞人數(shù)量最多。 其中,博肯海姆位于淺綠色的星團(tuán)之下,而蓋洛斯位于紫色的星團(tuán)之下。 然后探索這兩個(gè)街區(qū),以找出這些地區(qū)中亞洲或類似餐廳的數(shù)量。
Bockenheim
博肯海姆
2. Gallus
2.捷拉斯
Asian or similar cuisine restaurants in Gallus加盧斯亞洲料理或類似餐廳3. Niederrad
3.尼德拉德
Asian or similar cuisine restaurants in Niederrad尼德拉德亞洲風(fēng)味餐廳結(jié)果和討論 (Results and Discussion)
By clustering the districts in Frankfurt and subsequently analyzing the district-wise demographics of the city, and then merging the two findings, we could arrive at 3 prospective neighborhoods that would be ideal for opening an Asian restaurant in the city.
通過將法蘭克福的各個(gè)區(qū)域進(jìn)行聚類,然后分析該城市的區(qū)域人口統(tǒng)計(jì)資料,然后合并這兩個(gè)發(fā)現(xiàn),我們可以得出3個(gè)潛在的社區(qū),這對于在該城市開設(shè)亞洲餐廳非常理想。
1. Bockenheim:
1.博肯海姆:
Bockenheim falls in the light green cluster and is very close to the city center. It has 7 Asian restaurants which shows that there is a lot of demand for Asian cuisine in the area. It also has the highest population of Asians in the city at 1586.
博肯海姆(Bockenheim)落在淺綠色的集群中,非常靠近市中心。 它擁有7家亞洲餐廳,這表明該地區(qū)對亞洲美食的需求很大。 1586年,該市也是亞洲人口最多的城市。
2. Gallus:
2.捷拉斯:
Gallus is in the purple cluster containing a greater number of hotels. It is not far from the city center and has 5 Asian restaurants indicating that there is demand here as well. It has the second-highest population of Asians in the city at 1512. Hence, this seems like a better option than Bockenheim for opening an Asian restaurant owing to lesser competition, similar Asian population, and more prospective customers in the form of tourists.
捷拉斯位于包含大量酒店的紫色集群中。 它距離市中心不遠(yuǎn),有5家亞洲餐廳,表明這里也有需求。 在1512年,它是該市第二大亞裔人口。因此,這似乎比博肯海姆(Bockenheim)開設(shè)亞洲餐館更好的選擇,原因是競爭較少,亞洲人口相似,并且游客形式更趨于潛在客戶。
3. Niederrad:
3.尼德拉德:
Niederrad is also in the purple cluster having more hotels. It is also not far from the city center but has only 1 Asian restaurant — much less than both Bockenheim and Gallus. Niederrad also has a sizeable Asian population at 929, although a bit less than the other 2 districts in contention. Since it is in the purple cluster, we can expect more tourists in this district. We see that there are 3 hotels in the area. This translates to more prospective customers. Hence, this also seems like a good alternative to Gallus owing to much lesser competition, proximity to the city center, and more tourists.
尼德拉德(Niederrad)也在紫色集群中,擁有更多的酒店。 它也離市中心不遠(yuǎn),但是只有1家亞洲餐廳-比Bockenheim和Gallus都少得多。 尼德拉德(Niederrad)在929年的亞洲人口也相當(dāng)可觀,盡管在爭奪中比其他兩個(gè)地區(qū)要少一些。 由于它位于紫色集群中,因此我們可以期望這個(gè)地區(qū)有更多游客。 我們發(fā)現(xiàn)該地區(qū)有3家酒店。 這轉(zhuǎn)化為更多潛在客戶。 因此,由于競爭少,靠近市中心且游客多,這似乎是捷拉斯的一個(gè)不錯(cuò)的選擇。
結(jié)論: (Conclusion:)
The neighborhoods in Frankfurt am Main were clustered and displayed on a map containing the results. The demographics were studied and based on the findings, 3 districts were found to be ideal as a solution to the Business problem of opening an Asian restaurant. The client can choose any of the 3 neighborhoods to open an Asian restaurant, based on their preferences, confidence, and affinity to risk-taking.
美因河畔法蘭克福的社區(qū)被聚類并顯示在包含結(jié)果的地圖上。 研究了人口統(tǒng)計(jì)信息,并根據(jù)調(diào)查結(jié)果,發(fā)現(xiàn)了3個(gè)地區(qū)是解決開設(shè)亞洲餐廳的業(yè)務(wù)問題的理想選擇。 客戶可以根據(jù)自己的喜好,信心和對冒險(xiǎn)的意愿,選擇3個(gè)街區(qū)中的任何一個(gè)開設(shè)亞洲餐廳。
翻譯自: https://medium.com/swlh/clustering-neighborhoods-in-frankfurt-am-main-using-k-means-bb805545fd00
總結(jié)
以上是生活随笔為你收集整理的使用K-Means对美因河畔法兰克福的社区进行聚类的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 梦到进医院什么预兆
- 下一篇: 梦到房塌了意味着什么