sap中泰國有預扣稅設置嗎_泰國餐廳密度細分:帶有K-means聚類的python

sap中泰國有預扣稅設置嗎

Hi! I am Tung, and this is my first stories for my weekend project. What inspired this project is that I have studied to become data scientist for almost two years now mostly from Youtube, coding sites and of course, Medium ,but my learning is just not enough, I need to show what I learnt, so I am here at Medium to post my Weekend project once a week.

嗨! 我是董先生,這是我周末計劃的第一個故事。 激發這個項目的原因是,我已經學習成為數據科學家近兩年了,主要是從Youtube,編碼站點,當然還有中級,但是我的學習還不夠,我需要展示我學到的東西,所以我在這里在Medium每周發布一次我的Weekend項目。

Disclaimer: The code is provided at the end of the story, I like to keep the story well-fit for both programmer and non-programmer, so I will not show code in this medium.

免責聲明:代碼是在故事的結尾提供的,我希望故事適合程序員和非程序員,因此我不會在這種媒介中顯示代碼。

背景 (Background)

I happen to learn the spatial data from utilize Foursquare API, I thought that it would actually be really useful if I can apply something out of it and, of course, it must be related to business. So I thought what actually be useful application with the location data, then tourism popped up, followed by accommodation, restaurant, pub &bar and else. The tourism location seem legit but it is pain to learn about tourism site, and anyplace is entertainment anyways how can I define a tourism and non-tourism place.( sure, I could, it was just too much for my sweet weekend.) So I want something more simple, something unique, that just gives away its distinction of itself with others. Pub & bar could be like Jazz, rock, modern or else, that sound mass-media stuff but I am not a fan of music, so passed. Accommodation, I don’t know anything about this business side which is surely hard pass. Then I left with restaurant, luckily, it just happen that I live in the country that is rich of culture of beautiful, famous and delicious cuisine, Thailand.

我碰巧是從利用Foursquare API學習空間數據的,我認為如果可以應用其中的某些東西,它實際上將非常有用,當然,它必須與業務有關。 因此,我認為使用位置數據實際上是有用的應用程序,然后出現旅游業,然后是住宿,餐廳,酒吧和酒吧等。 旅游地點似乎合法,但是要了解旅游地點是一件痛苦的事,無論如何在任何地方都是娛樂場所,如何定義旅游和非旅游地點。(當然,我的甜蜜周末實在太多了。)我想要一些更簡單,獨特的東西,而這僅僅是它與他人之間的區別。 Pub&bar可能像爵士,搖滾,現代音樂之類,聽起來像是大眾媒體,但我不是音樂迷,所以過去了。 住宿,我對這個業務方面一無所知,這肯定很難。 幸運的是,我離開了飯店,碰巧我住在這個有著美麗,著名和美味佳肴的泰國文化。

I really don’t know why my country’ cuisine happen to be famous in many places, Westerners just crazy about our cuisine, but darn sure it partially because of its deliciousness. Now that I pick my topic “Thai restaurant”, what left is where. It could be anywhere in the world except my country, but It should be some place that is totally far away from my country. But not so much far away in term of cultural difference. So It should be on the side of North American, so I just search for what country that is famous in cultural diversity and it appear that Canada ranks first in North america. And then I search for most diverse city in Canada. Ta Da! it is Toronto.

我真的不知道為什么我國的美食在許多地方都出名,西方人只是為我們的美食而瘋狂,但由于其美味而不能肯定。 現在,我選擇主題“泰國餐廳”,剩下的就是位置。 它可能在世界上除我的國家以外的任何地方,但應該在一個完全遠離我的國家的地方。 但是就文化差異而言,相差不遠。 因此,應該在北美這邊,所以我只是尋找哪個在文化多樣性方面著名的國家,而加拿大似乎在北美排名第一。 然后,我搜索加拿大最多樣化的城市。 塔達! 是多倫多。

Image for post

I still awed by google search every time I see how fast it search, I happen to create a search algorithm which will be the post for next week so just a head-up.

每當我看到搜索速度時,我仍然對Google搜索感到敬畏,我碰巧創建了一個搜索算法,該算法將在下周發布,因此請多加注意。

目的 (Objective)

Now that I have the full topic. I need business objective, what would be something interesting to be know for Thai restaurant in Toronto. I just got the Idea that Thai restaurant in foreigner must not be authentic as at my country this is quite the same for many of other countries’ cuisine such as Japanese, Chinese, Indian, Italian and else, that compensate their authenticity for foreigner taste bud. As I hypothesize the more diverse the society cuisine, the more authenticity it need to be compensated. Thai food is not that hard to make, such a famous dish as Som-Tum, Tom Yum Kung, Tom Kha Kai. It just happen that the combination of ingredient is rare in those country, and this make it an added-value to Western consumer. As a starting point, Thai cuisine is already established it market in Toronto, this might be that chance for entering the market with a unique Thai restaurant that serve real Thai dishes. Now it is clear that I want to open the restaurant, what can a data science tools help us getting closer to the goal.

現在,我有完整的主題。 我需要業務目標,這對于多倫多的泰國餐館來說是一件有趣的事情。 我剛剛想到,外國人的泰國餐館一定不能像我所在的國家那樣真實,這與其他許多國家/地區的菜肴(例如日本,中國,印度,意大利和其他國家)完全一樣,可以彌補他們對外國人味蕾的真實性。 我假設社會美食越多樣化,就需要對它的真實性進行補償。 泰國菜并不難做,像Som-Tum,Tom Yum Kung,Tom Kha Kai這樣的著名菜。 碰巧的是,在這些國家,成分的組合很少見,這使它成為西方消費者的附加值。 首先,泰國美食已經在多倫多建立了市場,這可能是一個機會,可以使用一家獨特的泰國餐廳來提供真正的泰國菜。 現在很明顯,我想開餐廳,數據科學工具可以幫助我們更接近目標。

為什么要定位 (Why location)

If I have to give answer of what is the most important factors for any restaurant to be success, I would say that it is location. (Yes, yes, yes, for multivariate analysis, this is hard to just say it out loud. but I simply state the obvious.) Imagine that, if we open the restaurant as monopoly, we could gain a fortune from our uniqueness, but if we open Thai restaurant in high-Thai-restaurant density, for example Thailand, we lose the uniqueness to the crowd. I would not want that, anyone would not want that, but we happen to see a lot of people do that, so what is the benefit that is worth to lose our uniqueness to the crowd.

如果我必須回答任何一家餐廳取得成功的最重要因素是什么,我會說這是地理位置。 (是的,是的,是的,對于多變量分析,很難大聲說出來。但是我只想簡單地陳述一下。)想象一下,如果我們以壟斷地位開張餐廳,就可以從我們的獨特性中獲利,但是如果我們以泰國等高泰國餐廳的密度開設泰國餐廳,我們就會失去人群的獨特性。 我不想要那個,任何人都不想那個,但是我們碰巧看到很多人這樣做,所以值得我們在人群中失去獨特性的好處是什么。

It is the market, the existence of Thai restaurant is implied that their is customer for Thai dishes. And the reason that Thai restaurant might happen to open near to each other is because of the customer. There is more costly for a new restaurant to change people preference, it is much more efficient and less costly to simply open where the customer already exist. So where exactly is the best place to open the restaurant. To answer that we first need to know the density of Thai restaurant at Toronto. Now let the coding begin.

在市場上,泰國餐廳的存在暗示著他們是泰國菜的顧客。 泰國餐廳可能碰巧開門的原因是顧客。 一家新餐廳改變人們的喜好成本更高,僅在已有顧客的地方開店,效率更高,成本更低。 因此,確切的說是開餐廳的最佳地點。 要回答這個問題,我們首先需要知道多倫多泰國餐廳的密度。 現在開始編碼。

數據 (Data)

The data that will be used here is the postal code for location in Toronto, which we can easily obtain through Wikipedia. The data will look like this.

此處使用的數據是多倫多的郵政編碼,我們可以通過Wikipedia輕松獲得。 數據將如下所示。

Image for post

First, we need to clean the data, you can see it here that the Borough and Neighbourhood columns contain missing value which stated by the Postal code, the missing value here is not giving us any more of explanation power or segmentation benefit, so that all we can do is simply delete them. There are neighbourhoods that share the Postal code, so we just combine it together.

首先,我們需要清理數據,您可以在此處看到“自治市鎮”和“鄰域”列包含郵政編碼所說明的缺失值,此處的缺失值并沒有給我們更多的解釋能力或細分優勢,因此我們可以做的就是刪除它們。 有些社區共享郵政編碼,因此我們將其組合在一起。

Image for post

Now we assign the latitude and longitude for this neighbourhood, so that we can use it in Foursquare API to find the location of restaurant nearby.

現在,我們為該鄰域分配緯度和經度,以便可以在Foursquare API中使用它來查找附近餐廳的位置。

Image for post

With this we can start plotting the Borough and Neighbourhood in the map as visualization. This map visualization is used by folium library.

有了這個,我們就可以開始在地圖上繪制自治市鎮和鄰里關系了。 葉片庫使用此地圖可視化。

Image for post

The color here does not have any meaning for suggestion opening the restaurant. It is the colors classified by the 4 different Boroughs. Now it is time to find Thai restaurant in these Boroughs. Using the Foursquare API we can obtain venue nearby this 4 Boroughs.

這里的顏色對建議開設餐廳沒有任何意義。 它是按4個不同自治市鎮分類的顏色。 現在是時候在這些自治市鎮找到泰國餐館了。 使用Foursquare API,我們可以在這四個自治市鎮附近找到場地。

Image for post

Here is the venue from Foursquare, but this is too much of uninterested stuff, what we need is the Thai restaurant.

這是Foursquare的場地,但這太多了無趣的東西,我們需要的是泰國餐廳。

Image for post

The venue is categorized into 250 categories, which included Thai restaurant, the data is simply dummy variable that has value of 1 if it is that category and 0 if it is not. So it would be just a datasets of row contains 249 0s and single 1.

該場所被分為250個類別,其中包括泰國餐廳,數據只是該變量的虛擬變量,如果是該類別,則值為1;如果不是,則為0。 因此,這將僅僅是包含249個0和單個1的行的數據集。

Image for post

Here we acquire the number of Thai restaurant in Toronto, which is 13. The number make me feel ambiguous, it does not imply that Thai cuisine is doing well or just getting start. I don’t know whether I can use Foursquare API for historical datasets on location, but that would be one hell of cool analysis.

在這里,我們獲得了多倫多的泰國餐館數量,即13。這個數字讓我感到模棱兩可,但這并不意味著泰國美食做得很好或剛剛起步。 我不知道是否可以對位置上的歷史數據集使用Foursquare API,但這將是很酷的分析之一。

分割 (Segmentation)

Now we have all data we need, the last thing we need to segment the Thai restaurant. When doing the clustering, using human rule of thumb we tend to be biased because of high conditionality, so we just stick to what is easy. But it is different for machine learning algorithm, the algorithm follow the mathematics behind them, in this case we will be using K-mean clustering.

現在,我們有了所需的所有數據,這是分割泰國餐廳的最后一件事。 在進行聚類時,使用人類的經驗法則,由于較高的條件性,我們傾向于產生偏見,因此我們只堅持簡單易行。 但是機器學習算法有所不同,該算法遵循其背后的數學原理,在這種情況下,我們將使用K均值聚類。

K-mean clustering is the clustering technique used mostly for segmentation, its algorithm start from initialize K number of point as center of segmentation or centroids, for this sense I like to use K = 3 : High, low and zero density segmentation. Then the every point in the datasets will be calculate the distance between itself and this centroid, the data point will be assign to centroids that has least distance to itself and forming a cluster. When they form a cluster the centroid will change the point to the center using mean of its cluster. Then it repeat the whole process again and again until the centroid cannot move. Then that is its best cluster it can have because if the centroid cannot move that would mean that no data point can find the centroid that is nearer than the one it is connected with, which mean the all data points are assign to its closet centroid or best clusters. This is illustrated in the map below.

K均值聚類是主要用于分割的聚類技術,其算法從初始化以分割點或質心的K個點開始,為此,我喜歡使用K = 3:高,低和零密度分割。 然后,將計算數據集中每個點與該質心之間的距離,該數據點將分配給與自身具有最小距離并形成聚類的質心。 當它們形成簇時,質心將使用其簇的均值將點更改為中心。 然后,它一次又一次地重復整個過程,直到質心無法移動為止。 這就是它可能具有的最佳群集,因為如果質心無法移動,則意味著沒有數據點可以找到比與其連接的質心更近的質心,這意味著所有數據點都分配給了其壁櫥質心或最好的集群。 如下圖所示。

Image for post

Here we have three clusters, cluster green, blue and red. Taking a look inside this three clusters, by first going through the red one.

在這里,我們有三個聚類,聚類為綠色,藍色和紅色。 首先看一下紅色的三個集群,以了解這三個集群。

Image for post

There is 11 Thai restaurant in red cluster out of 13. Which is surely a high density area. As we mentioned before, it is clearly a dead flag area that have too much competition. Now let’s look at green one.

紅色的群集中有11處泰國餐廳,其中13處肯定是高密度區域。 正如我們之前提到的,這顯然是一個競爭激烈的死角地區。 現在讓我們看看綠色的。

Image for post

The rest of the restaurants are here, this mean the green cluster is low density cluster and the blue is zero density cluster.

其余的餐廳都在這里,這意味著綠色的群集是低密度群集,藍色的是零密度群集。

我應該在哪里開餐廳? (Where should I open restaurant?)

From the three clusters, it still needs a little more data based on the customer preference instead of location data to verify the best location for opening a restaurant. However, with the given data it would seem to be enough to some extent to suggest opening restaurants either in green or blue clusters.

在這三個集群中,它仍然需要基于客戶偏好的更多數據而不是位置數據,以驗證開設餐廳的最佳位置。 但是,根據給定的數據,在某種程度上似乎足以建議以綠色或藍色集群形式開設餐廳。

The reason that it still needs more data is that the revenue generated from the restaurant is not purely based on the location of the restaurant itself, but based on the location of the potential customers. In this sense, the red area has high-density would imply that there are a lot of customers who like Thai cuisine, however opening up there might result in an intense competition that will only drive the cost instead of profit. The superior place should be the subarea (The area near the red cluster, but is not red) which is the blue area surrounding the red area.

它仍然需要更多數據的原因是,從餐館產生的收入不完全基于餐館本身的位置,而是基于潛在客戶的位置。 從這個意義上說,紅色區域具有高密度,這意味著會有很多喜歡泰國菜的顧客,但是在泰國開設這種餐館可能會導致激烈的競爭,這只會拉高成本而不是利潤。 上級位置應該是分區(紅色簇附近的區域,但不是紅色的區域),也就是圍繞紅色區域的藍色區域。

However, we still not know the exact location where should be open in blue area because it is too big, but for the green area which is surprisingly small but contain a guarantee potential customer, this might be a gold mine or just gold nuggets that a small number of restaurant is taking all the profit and by entering this market might result in low or no profit at all. For this perspective, I believe that blue cluster that is close to red cluster is that best location to open restaurant.

但是,我們仍然不知道應該在藍色區域中打開的確切位置,因為它太大了,但是對于綠色區域而言,該區域很小,但卻包含有潛在保證的客戶,這可能是金礦,或者僅僅是金塊。少數餐館會利用所有利潤,而進入這個市場可能會導致低利潤或根本沒有利潤。 從這個角度來看,我認為靠近紅色群集的藍色群集是開設餐廳的最佳位置。

Here is the code for the story.

這是故事的代碼 。

翻譯自: https://medium.com/analytics-vidhya/thai-restaurant-density-segmentation-python-with-k-means-clustering-45d299cb3dca

sap中泰國有預扣稅設置嗎

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/392042.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/392042.shtml
英文地址,請注明出處:http://en.pswp.cn/news/392042.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

自動化yaml文件_從YAML到TypeScript:開發人員對云自動化的看法

自動化yaml文件The rise of managed cloud services, cloud-native, and serverless applications brings both new possibilities and challenges. More and more practices from software development processes like version control, code review, continuous integration,…

SQL SERVER-Extendevent系統視圖

--獲得擴展事件的事件select name,description from sys.dm_xe_objects where object_typeevent order by name--獲得各事件的字段 select c.name,c.description from sys.dm_xe_object_columns c inner join sys.dm_xe_objects o on o.namec.object_name where o.name…

Java—簡單的注冊頁面

根據所提供的界面&#xff0c;編寫 register.html 文件 源代碼 empty.jsp <% page contentType"text/html;charsetUTF-8" language"java" %> <html> <head><title>error</title> </head> <body> <H1><…

【深度學習系列】用PaddlePaddle和Tensorflow實現經典CNN網絡AlexNet

上周我們用PaddlePaddle和Tensorflow實現了圖像分類&#xff0c;分別用自己手寫的一個簡單的CNN網絡simple_cnn和LeNet-5的CNN網絡識別cifar-10數據集。在上周的實驗表現中&#xff0c;經過200次迭代后的LeNet-5的準確率為60%左右&#xff0c;這個結果差強人意&#xff0c;畢竟…

圖片獲取像素坐標html,HTML5畫布Canvas圖片抽取、像素信息獲取、命中檢測

今天主要介紹canvas中比較強大的功能比如將畫布內容抽取為圖片獲取、修改畫布的像素信息以及畫布的命中檢測首先我仍然需要創建畫布圖片抽取首先要明確的一點是toDataURL()是canvas對象自身的方法而不是環境對象的這個方法會將canvas的內容抽取為一張圖片(base64編碼)我們來看一…

CentOS6 下Samba服務器的安裝與配置

原地址&#xff1a;http://www.cnblogs.com/mchina/archive/2012/12/18/2816717.html 一、簡介 Samba是一個能讓Linux系統應用Microsoft網絡通訊協議的軟件&#xff0c;而SMB是Server Message Block的縮寫&#xff0c;即為服務器消息塊 &#xff0c;SMB主要是作為Microsoft的網…

傅里葉變換 直觀_A / B測試的直觀模擬

傅里葉變換 直觀Many of us have heard, read, or even performed an A/B Test before, which means we have conducted a statistical test at some point. Most of the time, we have worked with data from first or third-party sources and performed these tests with ea…

tableau for循環_Tableau for Data Science and Data Visualization-速成課程

tableau for循環Tableau is software that can help you see and understand your data. It is used for data science and data visualization. Tableau allows you to connect to almost any database, drag and drop to create visualizations, and share with a click.Tabl…

請求接口時使用時間戳

&tnew Date().getTime()轉載于:https://www.cnblogs.com/Glant/p/11271960.html

Java—servlet簡單使用

【步驟 1】創建一個名為 input.html 的 HTML 頁面&#xff0c;其中包括一個表單&#xff0c;表單中包含兩 個文本域&#xff0c;分別供用戶輸入學號和姓名&#xff0c;該頁面也包含提交和重置按鈕。 【步驟 2】定義一個名為 com.demo.Student 類&#xff0c;其中包括學號 sno 和…

phpstrom+phpstudy+postman

1.打開phpstudy xdebug 擴展 2.修改php.ini [XDebug]xdebug.profiler_output_dir"D:\phpStudy\tmp\xdebug"xdebug.trace_output_dir"D:\phpStudy\tmp\xdebug"zend_extension"D:\phpStudy\php\php-5.5.38\ext\php_xdebug.dll";是否允許Xdebug跟蹤…

SIP協議

SIP協議 SIP協議主要包括 SIP頭 SIP內容 和附加內容三個部分 項目格式備注示例SIP頭一行&#xff0c;以\r\n結尾REGISTER sip:172.30.2.35 SIP/2.0\r\nSIP內容很多行&#xff0c;每行為Key&#xff0c;Value的形式CSeq: 1 REGISTER\r\n附加內容很多行1 SIP頭 項目格式含義示例I…

android emmc 命令,使用CoreELEC的ceemmc工具將系統寫入emmc

最近在折騰電視盒子&#xff0c;CoreELEC是專門為晶晨CPU開發系統&#xff0c;個人覺的非常不錯&#xff0c;相關資料可以百度。這里介紹將卡載系統刷入emmc內置存儲的方法。因為找不到相關的教程&#xff0c;只在官網上找到了ceemmc這個工具的使用說明&#xff0c;所以搬過來。…

ios 自定義字體_如何僅用幾行代碼在iOS應用中創建一致的自定義字體

ios 自定義字體by Yuichi Fujiki藤木雄一 In this article, youll learn how to create a unified custom look throughout your app with these simple tricks.在本文中&#xff0c;您將學習如何使用這些簡單的技巧在整個應用程序中創建統一的自定義外觀。 我們想做什么 (Wh…

truncate 、delete與drop區別

相同點&#xff1a; 1.truncate和不帶where子句的delete、以及drop都會刪除表內的數據。 2.drop、truncate都是DDL語句(數據定義語言),執行后會自動提交。 不同點&#xff1a; 1. truncate 和 delete 只刪除數據不刪除表的結構(定義)drop 語句將刪除表的結構被依賴的約束(const…

Java—jsp編程

1. 編寫 login.jsp&#xff0c;登錄時只輸入一個昵稱。但要檢查昵稱是否已經被其他用戶使用。 源代碼 Login.jsp <% page contentType"text/html;charsetUTF-8" language"java" %><%request.setCharacterEncoding("UTF-8"); //設置編…

Java 8 Optional類深度解析

2019獨角獸企業重金招聘Python工程師標準>>> 身為一名Java程序員&#xff0c;大家可能都有這樣的經歷&#xff1a;調用一個方法得到了返回值卻不能直接將返回值作為參數去調用別的方法。我們首先要判斷這個返回值是否為null&#xff0c;只有在非空的前提下才能將其作…

鴿子 迷信_人工智能如何幫助我戰勝鴿子

鴿子 迷信鴿子回避系統 (Pigeon Avoidance System) Disclaimer: You are reading Part 1 that gives an overview of the project. Part 2 describes the technical setup and data collection. Part 3 is about how to train the Pigeon Recognition Model and run it on Rasp…

華為鴻蒙會議安排,2020華為HDC日程確定,鴻蒙、HMS以及EMUI 11成最關注點

原標題&#xff1a;2020華為HDC日程確定&#xff0c;鴻蒙、HMS以及EMUI 11成最關注點HDC&#xff1a;華為開發者大會&#xff0c;目前已經確定將在9月10日正式開幕。日前華為已經在其官網公布了HDC的日程&#xff0c;從現在的消息看華為開發者大會有三大點最受業內關注。鴻蒙操…

反射、元類

一、反射 1、什么是反射&#xff1a;就是反省&#xff0c;自省的意思 反射指的是一個對象應該具備&#xff0c;可以增、刪、改、查屬性的能力&#xff0c;通過字符串來操作屬性 涉及的四個函數&#xff0c;這四個函數就是普通的內置函數&#xff0c;只是沒有下劃線而已&#xf…