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

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輕松獲得。 數據將如下所示。

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

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中使用它來查找附近餐廳的位置。

With this we can start plotting the Borough and Neighbourhood in the map as visualization. This map visualization is used by folium library.
有了這個,我們就可以開始在地圖上繪制自治市鎮和鄰里關系了。 葉片庫使用此地圖可視化。

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,我們可以在這四個自治市鎮附近找到場地。

Here is the venue from Foursquare, but this is too much of uninterested stuff, what we need is the Thai restaurant.
這是Foursquare的場地,但這太多了無趣的東西,我們需要的是泰國餐廳。

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的行的數據集。

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

Here we have three clusters, cluster green, blue and red. Taking a look inside this three clusters, by first going through the red one.
在這里,我們有三個聚類,聚類為綠色,藍色和紅色。 首先看一下紅色的三個集群,以了解這三個集群。

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處肯定是高密度區域。 正如我們之前提到的,這顯然是一個競爭激烈的死角地區。 現在讓我們看看綠色的。

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,一經查實,立即刪除!