<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lukas Tuong on Medium]]></title>
        <description><![CDATA[Stories by Lukas Tuong on Medium]]></description>
        <link>https://medium.com/@tuonggreenager?source=rss-b2f843da19c6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wo0PbmSVEWxWeGcZS3pKyg.jpeg</url>
            <title>Stories by Lukas Tuong on Medium</title>
            <link>https://medium.com/@tuonggreenager?source=rss-b2f843da19c6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 23:52:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tuonggreenager/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cervical Cancer Prediction and Boruta analysis (R)]]></title>
            <link>https://medium.com/data-science/cervical-cancer-prediction-and-boruta-analysis-r-7214282ea1f8?source=rss-b2f843da19c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7214282ea1f8</guid>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[editors-pick]]></category>
            <category><![CDATA[r]]></category>
            <category><![CDATA[womens-health]]></category>
            <dc:creator><![CDATA[Lukas Tuong]]></dc:creator>
            <pubDate>Tue, 23 Mar 2021 08:42:25 GMT</pubDate>
            <atom:updated>2021-03-23T18:42:41.621Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Celebrate Women History Month by learning what are the factors that lead to cervical cancers with Boruta feature engineering and Classification prediction models</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*p27bMePaTpm6fwTI_aYbBw.jpeg" /><figcaption>Cervical cancer (Image by <a href="https://unsplash.com/@nci">National Cancer Institute</a> on Unsplash</figcaption></figure><h4><strong>Introduction</strong></h4><p>Since it is nearly the end of Women History Month, I would like to celebrate it by shining a light on an urging health issue that still threatens many women to this day. In America, there are 11,000 new cases of invasive cervical cancers being found annually. Despite the fact that the number of new cases is on the downward trend over the past decade, it still kills about 4,000 women in America and 300,000 women globally. <a href="https://doi.org/10.3322/caac.21628">(Fontham et al., 2020)</a> The sooner one discovers it, the more chances they have to survive. Therefore, in order to effectively eliminate such diseases, we need to create a Machine Learning algorithm that can detect cancer as soon as possible. As a result, for the final project, I will be analyzing to analyze the dataset: Cervical cancer (Risk Factors) from UCI. <a href="https://archive.ics.uci.edu/ml/datasets/Cervical+cancer+%28Risk+Factors%29">(“UCI Machine Learning Repository: Cervical cancer (Risk Factors) Data Set,” 2017)</a> The dataset was collected at ‘Hospital Universitario de Caracas’ in Caracas, Venezuela. I am planning to do a mix of EDA, Feature Importance Analysis with Boruta, and Classification prediction models</p><h4><strong>Data Preparation</strong></h4><p>We will start our project by loading the necessary libraries and reading the dataset. There are 8 libraries that we are going to use, 1 for visualization, 3 for data manipulation, 1 for feature importance analysis, and 3 for the prediction models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*ph_EK172WjWCsLg8_6AkEw.png" /><figcaption>(Image by author)</figcaption></figure><p>Cervical cancer has 858 inputs with 36 variables ranging from demographic information, habits to historic medical records. Some variables have missing data as patients refused to answer due to privacy concerns. It is noteworthy that many variables were interpreted as factors, caused by the “?” populated as placeholders for the missing values</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*gx8c5Kf0K3Eu1qrpHQLnZw.png" /><figcaption>(Image by author)</figcaption></figure><p>So, before going any further, I will check the integrity of the data, since it can hide the actual summary statistics that we are looking for. There is a wide array of functions to indicate Missing values such as NAs, zeros, negative values, or blank strings, so it is easier to create a function that deals specifically with the NAs and then plot the completude (non missingness) of the data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*iTOeTwqmnA5G69vF4XjyNg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*z872gu1oCNL1yV0dHip3nw.png" /><figcaption>(Image by author)</figcaption></figure><h4><strong>Data Manipulation</strong></h4><p>After we know the data a little bit better, it is much better to take care of the missing values to enable a closer exploratory data analysis. First, we create a function to identify all the columns that need repair, then a function to fix the missing values. The reason why x=”-1” is to allow numeric operations to be performed on them after “?” caused them all to be factors. “-1” is also a good placeholder since it distinctively shows there is something with that input. Then we apply the two functions onto the columns and we can establish an attribute that represents cervical cancer later on.</p><p>In addition, we create a correlation map to reject unimportant variables. After that, we need to cut off the correlation of anything combos that are less than 0.7. The final result will look like this, indicating that in general, these created highly correlated combos of variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*uX8qYfqxJAmrZPpHbTMJPA.png" /><figcaption>(Image by author)</figcaption></figure><p>The last four columns (“Hinselmann”, “Schiller”,“Cytology”,“Biopsy”) indicate the results of the cervical exams. A positive result does not mean that the patient suffers from Cervical cancer, but the likelihood increases the more positives a patient receives. Therefore I would create a Variable called “CervicalCancer” that is created according to such formula:</p><blockquote><strong>CervicalCancer = Hinselman + Schiller + Citology + Biopsy</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*UR_ufJaYeGNtrbDrNtyOQg.png" /><figcaption>(Image by author)</figcaption></figure><h4>Exploratory Data Analysis (EDA)</h4><p>After creating the “CervicalCancer” column, we can see that approximately 90% of the patients do not have any symptoms and only 1% actually show serious conditions by showing all 4 of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*ICv_oMAGl0acAMd02Sx6gg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*1sfglMwguI6O2u7wDJMnLw.png" /><figcaption>(Image by author)</figcaption></figure><p>After creating the “CervicalCancer” column, we can see that approximately 90% of the patients do not have any symptoms and only 1% actually show serious conditions by showing all 4 of them.</p><p>Thus, we can say that the accuracy of a baseline model, predicting everybody will not have cancer would have a high accuracy of 88%</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*7Cpgmye7AFWvdo8PUrxLpg.png" /><figcaption>(Image by author)</figcaption></figure><p>When we look at the age of the patients in the density plot, there is a notable desolation of the peak in every density plot, indicating that the correlation between “ Age” and “CervicalCancer” is strong</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*xfmILra3dMXAYLrBSNQ-wQ.png" /><figcaption>(Image by author)</figcaption></figure><p>Additionally, when one looks at the “Hormonal contraceptives years” and “CervicalCancer”, there is also a decreasing height of the peaks and the right skewness of the density plot also suggests a strong correlation also. While we could potentially do this for every single one of them, it is much better to carry out a much faster approach to finding the features that most influence “CervicalCancer” like Boruta</p><h4><strong>Feature Importance Analysis with Boruta</strong></h4><p>Boruta method assessed the feature importance by performing shuffling of predictors’ values and joining them with the original predictors and construct a random forest on the merged dataset. After that, we will make a comparison between the original variables with the randomized variables to measure their importance and choose the one with the higher importance ratio than that of the randomized variables.<em> .</em><a href="https://www.listendata.com/2017/05/feature-selection-boruta-package.html">(Deepanshu Bhalla, 2017)</a> One often consider Robuta over other feature selection packages in R thanks to its various advantage:</p><blockquote>· Suitable for classification and regression analysis because it takes into account multi-variable relationships</blockquote><blockquote>· An enhancement on random forest variable importance measure and can handle interplay between variables as well as changing nature of random forest importance measure</blockquote><p>In this exercise, the Boruto process starts with creating a copy of the original dataset but removes the medical results columns. Then we set the seed and use Boruta() function. The plot is as followed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*rkz1oODJ8oO0dhuAYFip_Q.png" /><figcaption>(Image by author)</figcaption></figure><p>We confirmed 15, eliminated 7, and 10 are put as tentative.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*RccfZmjYyjUXLZRYFsuWiA.png" /><figcaption>(Image by author)</figcaption></figure><p>And here are the variables that are confirmed to make a difference to the dependent variables</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*hSq85NC9Z7b3O3L0_gW6Hg.png" /><figcaption>(Image by author)</figcaption></figure><p>The data frame of the final result derived from Boruta can be found in the R file</p><h4><strong>Prediction Models</strong></h4><p>We will create a new variable “C_cervical_cancer” with all the aforementioned “Confirmed” variables and the “CervicalCancer”. We assign the values to yes or no for the potential for cancers. Since this is a very critical type of cancer and given to a small sample of potential cancer patients, it is better that we take all symptoms (1–4) seriously instead of leaving anything out and assign them with 1, the rest is 0. Then we encode the target features as factors and split the dataset into the training and test set of 0.75/0.25 ratio for predictions.</p><p><em>· </em><strong><em>Support Vector Machine</em></strong></p><p>Support Vector Machine (SVM) aims at finding a hyperplane in N-dimensional space (N- the number of features that distinctly categorizes the data points. There are numerous possible hyperplanes to classify them but we want to find a plane with the maximum margin (distance between data points of both classes). Once achieved, future data points can perform reinforcement and classify with more confidence, evidently shown in the picture below.<a href="https://towardsdatascience.com/support-vector-machine-introduction-to-machine-learning-algorithms-934a444fca47">(Rohith Gandhi, 2018)</a>. In this project, we choose type as “C-classification” and kernel as “linear”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mQ65Pr252jgZboGqdup8g.png" /><figcaption>(Source: <a href="https://towardsdatascience.com/support-vector-machine-vs-logistic-regression-94cc2975433f">https://towardsdatascience.com/support-vector-machine-vs-logistic-regression-94cc2975433f</a>)</figcaption></figure><p><em>· </em><strong><em>Decision Tree</em></strong></p><p>The decision Tree model makes judgments by breaking the inputs into smaller decisions. A decision tree is strength lies in the fact that its process has understandable rules and conduct classification task regardless of computational power. It works well with both continuous and categorical variables to provide the researcher a clear indication of which independent variables are indispensable. Regardless, it is not recommended to use continuous attributes too often, which can produce errors and sometimes energy-consuming even on a small number of training examples. Decision Tree is used in tasks like animal picture classification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*xOB1fKdJJ6KoQXmo9fsd-A.png" /><figcaption>(Source: <a href="https://www.aitimejournal.com/@akshay.chavan/a-comprehensive-guide-to-decision-tree-learning">https://www.aitimejournal.com/@akshay.chavan/a-comprehensive-guide-to-decision-tree-learning</a>)</figcaption></figure><p><em>· </em><strong><em>Random Forest</em></strong></p><p>This is an advanced version of the Decision tree, except the questions that are posed, include some randomness. The algorithm creates a “forest”, an ensemble of mini decision trees through the “bagging method. Then all the trees are merged together to get a more accurate and stable prediction. Unfortunately, Random forest often over-fits when dealing with noisy data. <a href="https://medium.com/fuzz/machine-learning-classification-models-3040f71e2529">(Kirill Fuchs, 2017)</a>. In this project, we choose the number of trees is 500</p><p><em>· </em><strong><em>Models comparison and Precision vs. Recall trade-off</em></strong></p><p>After running all the models we can build the Confusion Matrix tables as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*xD5drwPOFwsh-NAi5kCLjA.png" /><figcaption>(Image by author)</figcaption></figure><p>We will use precision and recall as metrics for our models’ performance assessment. Precision (specificity) is about ensuring the model’s accuracy, indicating the fraction of relevant examples among the retrieved example. Recall (sensitivity), on the other hand, is about the model’s ability to get the right instances. Precision and Recall range from 0–1 and the higher they are the better. It is noteworthy that there is a trade-off, meaning that when precision rises, the recall fails and vice versa. Researchers often use an abstract metric like F1 score, which is the combination of both to make the decision. However, in such dangerous cases like identifying Cervical cancer patients, Recall is more important than precision because the cost of wrong treatment might be high, but not at high as the opportunity cost of wrongly passing up a potential cancer patient. Luckily, I would choose the Random forest method due to the fact that it has the highest recall rate (0.8826) and precision rate (0.5) compared to the rest. <a href="https://medium.com/opex-analytics/why-you-need-to-understand-the-trade-off-between-precision-and-recall-525a33919942">(Samuel Hillis &amp; Sara Hoormann, 2016)</a>. Last but not least, although I would love nothing more than to improve the accuracy of this model through GridSearch and K Folds Cross-Validation, I do not think it is a good idea given the fact that it is an extremely small dataset and we might have overfitted.</p><h4><strong>Conclusion</strong></h4><p>To sum up, Cervical cancer is one of the most life-threatening diseases out there which is responsible for thousands of deaths per year. But implementing the Random Forest method like above, I believe we can save a lot of people in the future.</p><p>— — —</p><p><strong>Github:</strong> <a href="https://github.com/Lukastuong123/R-Studio/tree/master/Project-%20Cervical%20Cancer%20Detection">https://github.com/Lukastuong123/R-Studio/tree/master/Project-%20Cervical%20Cancer%20Detection</a></p><p><strong>References and resources:</strong></p><p><strong>Deepanshu Bhalla.</strong> (2017, August 5). Feature Selection : Select Important Variables with Boruta Package. Retrieved February 22, 2021, from <a href="https://www.listendata.com/2017/05/feature-selection-boruta-package.html">https://www.listendata.com/2017/05/feature-selection-boruta-package.html</a></p><p><strong>Fontham, E. T. H., Wolf, A. M. D., Church, T. R., Etzioni, R., Flowers, C. R., Herzig, A., … Smith, R. A. </strong>(2020). Cervical cancer screening for individuals at average risk: 2020 guideline update from the American Cancer Society. <em>CA: A Cancer Journal for Clinicians</em>, <em>70</em>(5), 321–346. <a href="https://doi.org/10.3322/caac.21628">https://doi.org/10.3322/caac.21628</a></p><p><strong>Kirill Fuchs.</strong> (2017). Machine Learning: Classification Models | by Kirill Fuchs | Fuzz | Medium. Retrieved February 22, 2021, from <a href="https://medium.com/fuzz/machine-learning-classification-models-3040f71e2529">https://medium.com/fuzz/machine-learning-classification-models-3040f71e2529</a></p><p><strong>Rohith Gandhi.</strong> (2018, June 7). Support Vector Machine — Introduction to Machine Learning Algorithms. Retrieved February 22, 2021, from <a href="https://towardsdatascience.com/support-vector-machine-introduction-to-machine-learning-algorithms-934a444fca47">https://towardsdatascience.com/support-vector-machine-introduction-to-machine-learning-algorithms-934a444fca47</a></p><p><strong>Samuel Hillis, &amp; Sara Hoormann.</strong> (2016, January 16). Precision and Recall: Understanding the Trade-Off. Retrieved February 22, 2021, from <a href="https://medium.com/opex-analytics/why-you-need-to-understand-the-trade-off-between-precision-and-recall-525a33919942">https://medium.com/opex-analytics/why-you-need-to-understand-the-trade-off-between-precision-and-recall-525a33919942</a></p><p>— — —</p><p><strong>Dataset: UCI Machine Learning Repository: Cervical cancer (Risk Factors) Data Set.</strong> (2017). Retrieved February 22, 2021, from <a href="https://archive.ics.uci.edu/ml/datasets/Cervical+cancer+%28Risk+Factors%29">https://archive.ics.uci.edu/ml/datasets/Cervical+cancer+%28Risk+Factors%29</a></p><p><strong>Inspired by :</strong> <a href="https://www.kaggle.com/divyabongouni/key-cervical-cancer-predictions-with-boruta">https://www.kaggle.com/divyabongouni/key-cervical-cancer-predictions-with-boruta</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7214282ea1f8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/cervical-cancer-prediction-and-boruta-analysis-r-7214282ea1f8">Cervical Cancer Prediction and Boruta analysis (R)</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Airbnb-Part B (Python- Interactive Map, Natural Language Processing)]]></title>
            <link>https://medium.com/data-science/airbnb-part-b-python-interactive-map-natural-language-processing-48d472f14da3?source=rss-b2f843da19c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/48d472f14da3</guid>
            <category><![CDATA[seattle]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[airbnb]]></category>
            <dc:creator><![CDATA[Lukas Tuong]]></dc:creator>
            <pubDate>Thu, 25 Jun 2020 21:09:33 GMT</pubDate>
            <atom:updated>2020-07-01T22:58:46.256Z</atom:updated>
            <content:encoded><![CDATA[<h4>Analyze the Airbnb situation in Seattle through a Comparative Study with Washington DC, Regression Model, Interactive Maps<br>and Natural Language Processing. Presented constructive suggestions to city council and travelers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DyvyQ0qIYfnE1i6e4zb4-g.jpeg" /><figcaption><strong>Seattle ‘s lovely Postcards (Image by author)</strong></figcaption></figure><blockquote>Introduction from <a href="https://medium.com/@tuonggreenager/airbnb-part-a-python-visualization-comparative-study-regression-7466c0cb5a1d">part A</a></blockquote><blockquote>Since 2008, Airbnb has helped guests and hosts to travel in a more unique, personalized way. The company went from a single air mattress for rent to global cooperation valued at more than 30 billion dollars all thanks to its energetic founder- Brian Chesky. 2020 was supposed to be the golden year for Airbnb as it would go public and issue the worlds’ most sought after stocks. Tragically, Coronavirus happened. The travel sector was gutted by the pandemic. Airbnb now faces burning cash, angry hosts and an uncertain future as 2000 employees could potentially be discharged from their positions and the billion dollars debts with a high-interest rate that is being built to refund their customers. <a href="https://www.wsj.com/articles/airbnbs-coronavirus-crisis-burning-cash-angry-hosts-and-an-uncertain-future-11586365860">(Grind, 2020)</a></blockquote><blockquote>Nonetheless, things start to look up as June arrived. Airbnb reported having more nights booked for US listings between May 17 and June 3 than the same period last year. There was also a similar growth in domestic travel in countries that are successful in combating the virus: Germany, Portugal, South Korea, and New Zealand. Other companies, like Expedia and Booking.com also witnessed a jump in domestic vacation rental reservations. Months of pent-up demand is leading to a rush of summer reservations as more and more people are looking to escape their home coronavirus refuge. Now, Airbnb has more listings than it did before the crisis, focusing on exclusively traditional vacation rental markets top destinations in America. They are Big Bear Lake in Southern California, the Smoky Mountains, along the Tennessee-North Carolina border, and Port Aransas in Texas. <a href="https://www.latimes.com/business/story/2020-06-07/airbnb-coronavirus-demand">(Carville, 2020) </a>Still, any rebound is coming from a very low base with Chetsky said that he expected revenue this year to each half of 2019’s level in May’s live conference call announcement. He said going public this year is still an option but he will wait for the market to stabilize before making the final decisions.</blockquote><blockquote>As a previously trained hotelier who is living in Seattle, I want to do an analysis project on the current situation of Airbnb in Seattle in two parts. Part A will focus on the comparative study between two cities: Seattle and Washington DC. Seattle and Washington DC areas at the two ends of America that are widely known for different reasons: technological and cultural powerhouse vs political center, respectively. In addition, they share a similar population size (just over 700,000) and a number of listings (8740 and 9369). Then, in part B we will have a deeper look into Seattle’s market from perspectives of a governmental position and a traveler to recommend solutions that can benefit not only Airbnb but also the city and its citizens</blockquote><blockquote>*****************************************</blockquote><p>In part B, we will create some visualizations, interactive maps and dive into natural language processing with the Airbnb 2020 Listings dataset of Seattle. Besides the standard ones, we introduced more libraries dedicated to creating maps (folium, geopandas), visualizations (plotly, cufflinks), natural language processing (re, nltk).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*5dZyXSq0NUmFU7oAJmrudg.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>On top of the listings.csv and listings_details.csv that are mainly used for the analysis, we also employed ‘calendars’ and ‘review_details’ dataset in order to help us. As we mentioned in Part A, listings is basically the id of the advertisement. There were 7237 Airbnb listings in Seattle on April, 2020. The ‘listings’ contains 15 features while ‘listings_details’ contains 96. Instead of using all the columns that might be irrelevant, we selectively joined the number of variables that are useful to us for part B’s analysis. We also stripped “%“ off the “host_response_rate” feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*4CawiRvwdipk7UTpsCD3qg.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><h3><strong>I/ </strong>Exploratory Data Analysis(EDA)</h3><h4><strong>1)</strong> <strong>Neighborhoods</strong></h4><p>Downtown is the epicenter of all commercial and professional activities of Seattle (1250 listings), which explains why it has the second-highest amount of listings besides the Other neighborhood outside of the city. Other areas near downtown Seattle does not appear to be that popular either as there are only 775 listings in Capital Hill and 600 for the Central Area, the rest stays below 500. One theory suggests that the reason why travelers decided to stay outside of Seattle is due to the skyrocketing price of the city’s current real estate. We will unfold how this interesting fact affects other listings’ factors like price and customer’s perception of their Airbnb stay. For the interactive map, you can zoom in on the clusters to eventually find the individual locations of the listings (Github code below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*6y-H2MAO3tA1YKKuqPE-wA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*LQ3ajBaMOPGeUTo75AiOtA.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><h4><strong>2)</strong> <strong>Room types, Property type, &amp; Number of people per booking</strong></h4><p>CBRE Hotels’ American Research has stated that approximately 80% of Airbnb’s revenue in Seattle comes from entire home listings and the revenue generated by hosts with multiple entire home listings nearly doubled between 2015 and 2016. <a href="https://www.seattle.gov/Documents/Departments/Council/Issues/RegulatingShortTermRentals/Regulating-Short-Term-Rentals_Policy-Brief_2017-04.pdf">(Seattle City Council, 2017)</a> Commercial enterprises like to utilize online rental platforms to market multiple units in different locations that could potentially worsen the housing crisis time bomb that heading towards Seattle as you will see later on in the report. Unfortunately, the situation is not better in 2020 with Entire home/apt accounts for an overwhelming majority of listings (5700 in total), 3 times higher than that of Private room. Yet, Seattle is slow to pass any substantial laws, unlike New York, which aggressively prohibits any listings from being rented out more than 30 days a year as up 2017. <a href="https://techcrunch.com/2019/12/09/airbnb-zeus/">(Dalton, 2017)</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*3judLj0kfrPPgwp7gdy-Hw.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>It is noteworthy to know that there are different property listings, but not all of them are widely beloved. In order to eliminate the non-popular property types, we created an additional column called “total” to count the listings for each property type according to the room types and select those that have more than 100. After that, I dropped the ‘total’ column to get normal results. Houses and Apartments are the most common type of properties. It seems that Houses are less popular property type for Entire home/apt listings compared to Apartment, but they are more preferred when it comes to Private room renting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*wZzlFpwbsaFT4Fl_sYLhpg.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>In general, the majority of listings usually like to hos less than 5 guests, with most of them being 2 (over 2700 listings). However, it is interesting to see that a party of 6 can easily find a suitable property for the night. It is due to the fact that unlike other cities like Amsterdam, Seattle does not have a short term rental’s maximum capacity restriction of 4 out of fear for possible noise complaints or fire hazards. Thus, if you want to throw a party, Seattle is the best city for such an option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*7G3EG56644_PX44PugUaiw.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><h3><strong>II/ Advice to the Mayor of Seattle</strong></h3><p>It is no secret that Airbnb has been accused of escalating the Affordable-Housing crisis in many cities across the world. <a href="https://www.governing.com/columns/public-money/gov-airbnb-affordable-housing.html">(Shafroth, 2016)</a>. To prevent this from happening, Seattle’s Department of Finance and Administrative Services forced every Airbnb hosts to get short-term rental operator’s licenses before operating as up December 2019. <a href="https://www.airbnb.com/help/article/869/seattle-wa">(Airbnb, 2020)</a> The license is about $75/ unit, renewed annually. Each short term contracts allows you to operate up to two dwelling units:</p><ul><li><strong><em>Primary residence:</em></strong> “person’s usual place of return for housing as documented by motor vehicle registration, driver’s license, voter registration, or other such evidence.”</li><li><strong><em>Secondary residence</em>:</strong> vacation home or second home</li></ul><p>However, the guideline is not enforced upon all the listings, there are limited exceptions to the maximum number of units, including some exceptions for short-term rentals legally operated before Sept. 30, 2017. It is noted that if you operate a hotel or motel on Airbnb, the host will not be required to register for a short-term rental permit, but does need to claim a formal exemption.</p><h4><strong>1)</strong> <strong>Findings possibly illegal hotels</strong></h4><p>As Seattle’s law stated above, we can ignore the Entire home/apt value and go straight to the Private Room to see any extreme cases that have too many listings for just two residences. Bearing in mind, Airbnb does not give the address of the listings, although the field “street” is actually in the database. These are certainly not full real addresses. Airbnb actively hides the listings’ addresses and only reveals them once you confirm your booking. Therefore, one cannot say if these listings are in fact in the same house.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*EZE7Qqn8UMkCej62L6KswA.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>By running the first 20 values out of 53 Dario’s properties can be categorized into 4 different groups according to his listings’ names</p><ul><li>10 min drive to downtown</li><li>5 min drive from Downtown</li><li>3 blocks to Seattle Center</li><li>private rooms</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*Qk81OCoa2odl6iDyP2b_-w.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>Additionally, when you check the actual Longtitude and Lactitude themselves, they are highly similar to each other with a slight difference. Pictures of rooms, facilities on Airbnb’s listings cannot be distinguished from one to another:</p><ul><li><a href="https://www.airbnb.com/rooms/43434896?source_impression_id=p3_1591925255_WCNBoABCysSUpwiS&amp;guests=1&amp;adults=1">Happy Buddha Room 10 min walk to downtown</a></li><li><a href="https://www.airbnb.com/rooms/43434358?source_impression_id=p3_1591925546_k3B0Utbbpxlwc1cF&amp;guests=1&amp;adults=1">The Pop Art Room, 3 blocks to Seattle Center</a></li></ul><p>From a respective point of view, it seems like he is running a boutique hotel but classify as short-term rental’s license, which was designed especially for Airbnb, from the city center. If all the listings are legal, Dario could likely be running a hotel which would be subject to different regulation as stated above or belong to the ‘exemption’ group that signed up before Sept. 30, 2017. If not, Airbnb or the city council should have a look into the situation and investigate whether Dario is violating the rule or not. Not only Dario but also other hosts like Vera, Seyed, Shannon, Lee, etc. should be inspected.</p><h4><strong>2)</strong> <strong>Unwanted effects of professional hosts</strong></h4><p>At the moment, Seattle has no rule in place to prevent professional hosting activities. Such shortcoming opens the door for the possibility that Airbnb outsources their platform to professional hosts (third party real estate companies). Right now, 80% of the hosts have fewer than 5 listings. We assume that hosts with just a couple of more listings than 1 are likely to also be the host for a couple of friends. But there are extreme cases (312), which raises our suspicion that they are doing it professionally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*cR5LW3MSJIXWyf6I6N3koQ.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>Below, we display the hosts with more than 20 listings. If one has a look at their listings on Airbnb, they can be blown away by the standardization and professionalism of each listing that belongs to the top 3. Thus, we can safely say that these are professional hosts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*gnM1yQIVnqD2CHmzkkh4mw.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>A deeper look into the top 3 allows us to find out more about the way Airbnb operates. It seems that on top of unprofessional listings by conventional hosts who would like to collect some side income, Airbnb also frequently establishes partnerships with mid to small scale real estate companies. Airbnb allows these local companies to register their rental properties as normal listings on the platform to generate more web traffics in exchange for commissions. The terms and degree of companies’ involvement vary from one arrangement to another as the table below illustrates:</p><p><a href="https://barsala.com/"><strong><em>Corp Condos &amp; Apts/ Balsa</em></strong></a></p><blockquote>“We are a passionate team running a modern tech-enabled corp housing co that believes nicely furnished high end homes should be consistent, affordable and easy to book.”</blockquote><p>=&gt; Despite being registered as ‘Corp Condos &amp; Apts on the system, all the listings are owned by Barsala Barsala, a mid-scale real estate company that focuses on providing good-value-for-money lease contracts in the West coast. There is not much information about the relationship between Airbnb and Barsala</p><p><a href="https://zeusliving.com/"><strong><em>Zeus</em></strong></a></p><blockquote>“Zeus is reinventing corporate housing. We do this by providing a unique, hassle-free, and high-quality housing experience in each of our 1,400+ homes throughout the San Francisco Bay Area, Los Angeles, Washington” Zeus has become a permanent partner with Zeus “</blockquote><p>=&gt; As Airbnb absorbs more and more of the demand for housing, it’s exploring how to monetize opportunities beyond vacation rentals. A marketplace for longer-term corporate housing could be a huge business, but rather than building it by themselves, Airbnb has strategically invested in cooperation with one of the market leaders in properties’ longer-term rentals called Zeus Living”. It is an ingenious combination: Zeus’s available properties and Airbnb’s global promotion platform <a href="https://techcrunch.com/2019/12/09/airbnb-zeus/">(Constine, 2019)</a></p><p><a href="https://loftium.com/"><strong><em>Loftium</em></strong></a></p><blockquote>“Stay where it counts. When you book a Loftium, you’re contributing to the local community. Each Loftium is home to a local resident who hosts and lives right on-site, making sure your experience is a delightful one. All spaces are designed with your comfort in mind! We’ve made check-in and communication a breeze, and each home provides a beautiful and cozy place to rest your head during your travels. Every Loftium home and host is unique, and you’ll always get a true neighborhood experience during your stay. Visit a new community and book a Loftium in any of our cities: Seattle, Portland, Denver, San Diego, Phoenix, Chicago, Atlanta, Dallas, Charlotte, or Orlando. We can’t wait for you to visit!”</blockquote><p>=&gt; From renting room solely with Airbnb, the founders decided to build up their own property renting app to rivals and partner with Airbnb at the same time. Their business approach is to give ridiculous discounts to potential renter/buyer at pricey areas if they agree to become hosts for Airbnb. Hannah Exner and Sam Joselyn scored a magnificent apartment at the Westlake for 1000USD/month at Westlake neighborhood where prices reach above 1500USD/month <a href="https://www.geekwire.com/2019/loftium-pivots-real-estate-biz-now-offers-discounts-apartment-tenants-rent-rooms-airbnb/">(Levy, 2019)</a></p><p>Besides the obvious pondering of what effective measures that the government of Seattle will take to make sure all these business partnerships do not exacerbate the crisis, it is the question of realness and products’ differentiation. As a company prides itself on providing an authentic experience and local hidden gems, which elevated its images above fellow hospitality competitors in customers’ eyes, introducing such cookie-cutter, polished listings from real estate agencies might diminish the company’s unique value proportion. <a href="https://doi.org/10.1007/978-3-319-51168-9_56">(Lalicic &amp; Weismayer, 2017)</a>. As time flies, even most diehard Airbnb enthusiasts might seek “authenticity” somewhere else</p><h3><strong>III/ Advice to the tourists</strong></h3><h4><strong>1)</strong> <strong>Per neighborhood’s Average daily price, Review score and Safety index</strong></h4><p>In this part, we compared the average daily rate for two (ADR) and review scores according to neighborhoods. We expected the distance to the city center is the most important factor since all Seattle landmarks locate downtown. There might be a strong correlation between the distance and the review score. Other factors that might affect the review score and ADR include:</p><ul><li>Location’s safety index</li><li>Noise. If a listing is located downtown but among the noisy bars, that should cost points on the location reviews.</li><li>If the listings are located outside the city center but public transportation is well-connected, then they will get some bonus point (Seattle has developed train and bus system)</li><li>Necessity and entertainments near the location (supermarket, bars, restaurants, etc.)</li><li>Free parking included? Because it costs $20/ 2 hours on average to park downtown Seattle</li></ul><p>It is interesting to see Queen Ann is significantly expensive compared to the rest (~$285/day). Then it is Downtown (~$165/day) followed by other neighborhoods. Surprisingly, the average review scores are above 9/10 regardless of the listings’ locations, so no matter which neighborhood you choose, maximum satisfaction is always guaranteed. We believe that is because Seattle is generally small in terms of size and population (1 million in total). The city is also well-connected so take around 30 minutes to travel to and away from downtown if they happen to stay in suburban areas</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*WTxldalFVqad8QvIsVTCqA.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>Despite being less serious than San Francisco, Seattle still suffers heavily from the abundance of homeless and panhandlers. Most of them are harmless and will leave you alone. Nevertheless, it still negatively affects the public image and demotivates travelers to visit the city. In addition, visitors might experience property crime than violent crime, 7 times respectively. If you visit Seattle by car, you might experience break-ins even in parking lots. Like most cities, Seattle’s safest areas are outside of the downtown core and tend to be residential areas or residential with light commercial. Among the safest neighborhoods are Sunset Hill, Ballard, Magnolia, Alki, Magnolia, Lower Queen Ann, and Wallingford. Seattle Police department has a great map of areas of Seattle color-coded by the number of crimes committed. Dark blue areas mean more cases while Lighter areas have fewer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*mYsXSYZMbgkyTDXrKpAS7Q.png" /><figcaption><strong>Seattle’s crime rate statistics (Source: </strong><a href="https://www.seattle.gov/police/information-and-data/crime-dashboard"><strong>Seattle Police department </strong></a><strong>)</strong></figcaption></figure><p>Taking into consideration both the ADR, review score and crime statistics, customers are advised to make their Airbnb bookings in West Seattle, Magnolia, Ballard, Rainer Valley, Central Area, Seaward Park, Beacon Hill, University District, Interbay and Northgate to receive low renting prices, maximum safety, and high satisfaction by the end. I am currently living in Rainer Valley/ Beacon Hill, 20 minutes away from downtown by car or 30 min by train, everything is very nearby. The area experiences a moderate amount of gentrification so it is both safe and local for people to book Airbnb experience. Barbecuing some mouth-watering grills on a beautiful Sunday in Beacon Hill is as luxurious as life can get.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3H_OtVTIq2xFABmfiqjRpQ.jpeg" /><figcaption><strong>Mural at Rainer Valley/ Beacon Hill (Image by author)</strong></figcaption></figure><h4>2) How to use Review Scores</h4><p>Equally important to the written review, guests can submit overall star rating and set of category star ratings. Ratings are categorized into:</p><ul><li>Overall experience</li><li>Cleanliness (the most essential factor for any hospitality establishment)</li><li>Accuracy (does advertisement match with the products?)</li><li>Value (do you feel ripped off or not?)</li><li>Communication (how well hosts respond to your concerns and questions before, during and after your stays?</li><li>Arrival (did the check-in process go smoothly?)</li><li>Location</li></ul><p>Readers can find below the distribution of the scores across all those categories. One could not help but be astonished by the high scores across the board. This is very common in Airbnb as the company is well-known to provide exceptional service to their customers <a href="https://mashable.com/2015/02/25/airbnb-reviews-above-average/?europe=true">(Plautz, 2015)</a>. Because the standard is so high like that, guests should only choose listings that score 10 in at least four out of five factors. Value is the most tricky one because they have a noticeably greater number of scores 9 compared to the others, which makes the factor a bit more distinguishable than other indicators. Staying at a host that managed to score 10 on value even though they might score less on other aspects means that you are likely to hit the jackpot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*mrjbkB-RybmnyMz4rKDYCg.png" /><figcaption><strong>Distribution of the scores across all those categories (Image by author)</strong></figcaption></figure><h4>3) Finding a good host</h4><p>In order to show appreciation for their hosts’ effort, Airbnb awarded those with the highest esteem “Superhost” status. Being a Superhost means you benefit from an increase of your listings’ visibility, earning potential and even receive exclusive rewards <a href="https://www.nytimes.com/2017/01/11/technology/personaltech/the-guide-to-being-an-airbnb-superhost.html#:%7E:text=In%20the%20process%2C%20I%20have,percent%20of%20hosts%20are%20Superhosts.&amp;text=The%20designation%20as%20a%20Superhost,away%20from%20netting%20a%20profit.">(Chen, 2017)</a>. Airbnb has featured a number of Superhost s’ listings in their advertisement campaign and Superhosts are even invited to give speeches or share tips on how to earn this cool title. In order to become a Superhost, a host must have a 4.7 or higher average overall rating based on reviews from their Aibnb guests in the past year. They also need to organize at least 10 stays in the previous year or 100 nights over at least 3 stays if these reservations have longer term. Superhosts must not have any cancellations unless there were extenuating circumstances and need to respond to their customers within 24 hours. Despite much-restricted bar to overcome, Airbnb listings in Seattle knocked them out of the park by having nearly 30000 Superhosts at the moment (~45%). This is a shocking number given to Airbnb’s international Superhost rate (20.2% )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*ftKkQv8oBh7BkScX4Mz7ew.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>Since Superhosts are so popular in Seattle, it begs the question of whether or not Superhost is one of the necessary criteria when choosing a room. On the one hand, booking with a Superhost potentially means more money spent on your accommodation. On the other, as a customer, I do not want to encounter bad hosts who cancel a lot and take forever to reply. Fortunately, it is rare to meet any unresponsive hosts on Airbnb and the majority of them take less than an hour to answer, within a day is the latest. Such a quick figure partly explains why Seattle’s Airbnb is flooded with exceptional Superhosts. Therefore, being a Superhost or not is something that potential guests should not put a strong emphasis on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*d8Trs8Yt5JsP7OtvwsH5XA.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><h4>4) Availability and Average price overtime</h4><p>The ‘calendar’ file holds 365 records of price and availability for each listing that corresponds to every day of the year. To get the right result, we merge the ‘calendar’ with the ‘listings’[‘accommodates’] on the shared columns called listings_id with listing_id functions as an index on the left. A sample of the merged table is shown below, it is important to note that ‘f’ means that the owner does not want to rent out his property on this specific day or the listings has already been booked by a someone else/a third party.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*A2MPWUuQ4LaUKY-2rpTj_w.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>The number of available Accommodations is higher for the next 6 months before hitting rock bottom when going further into the future. Bearing in mind, the data was collected on April 23rd, 2020. This means that it was at the peak of the Corona Virus outbreak in America. The six months positive figure means that a lot of mean that a lot of guests have already confirmed well advance into the future before they realize the seriousness of this pandemic. Thus, there are fewer than 1100 bookings on October 16 and virtually none by the middle of January 2021. Another reason in such a drastic change in the number of available accommodations is the fact that hosts are actively looking for other alternative use of these renting properties to maintain a stable stream of revenue in face of crisis. Airbnb bookings are secondary to last on people’s minds. For the interactive map, you can zoom in on the clusters to eventually find the individual locations of the listings (Github code below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*jSR5snSBvrla3S8xD37NSg.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>Since accommodation for 2 is popular, we select only the available listings for 2 and find the average using mean() function. ADR peaks at $127 on Saturday, July 27th, and the cynical patterns is thanks to the higher prices at weekends. As time flies by, the price dropped dramatically. I suspect it was the impact of the COVID and host’s price-slash last-minute efforts is the evidence that it would take sometimes before Airbnb can make a profit once again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*75Ld9uYOcTzFzM14tN8S1A.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>However, it is not the end of the world. Seattle has reported a significant decline in positive cases and death tolls from once being the nation’s Corona Virus epicenter. It was all thanks to the efforts of Washingtonians, particularly Seattleites, who have constantly abided to the ‘Stay home’ order by the state government. Luckily, King County, which covers the majority of Seattle and was severely affected, is confident enough to apply for the second phase of the reopening plan. Hence, we are optimistic that everything will be back to normal by September/ October</p><p>Excitingly, it is also the best time to visit the city. Summer marks the city’s high season, meaning room rates are up on the roof while winter is blanketed in endless cold rainy days that can deter even the most avid sightseers. Seattle blooms most radiantly in fall where summer weather lingers as crowds disperse, leaving plenty of Airbnb room to grab <a href="https://travel.usnews.com/Seattle_WA/When_To_Visit/">(USnews, 2019)</a>. September and October are also full of festivities like Bumbershoot (September), Earshot Jazz Festival (October-November), Seattle Restaurant Week (October-November). We suggest the potential customers booking before October 15th as room rate is low and there are still many available listings. There is nothing better than to celebrate the end of a pandemic by going out to the streets, in kaleidoscopic customs and enjoy scrumptious biscuits and heartwarming chowder as true bons vivants</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-NlQtoMqScT9R4Fh1mqVnA.jpeg" /><figcaption>Fresh produce at the famous Pike Place Market (Image by author)</figcaption></figure><h3><strong>IV/ Text Mining and review comments</strong></h3><p>Natural Languages Processing (NLP), is a branch of artificial intelligence that analyzes the relationship between computers and humans using natural language. NLP is extremely useful when implementing in Deep Leering’s application like Neural Neuron Networks because it helps to read, decipher, understand, and make sense of the human languages in a manner that is valuable. <a href="https://towardsdatascience.com/your-guide-to-natural-language-processing-nlp-48ea2511f6e1">(Yse, 2019)</a> NLP has helped me to predict the feedbacks score based on the guests’ reviews of a hotel. But in this exercise, we just only want to see what the review comments entail and demonstrate the step that an NLP goes through in order to establish a concrete foundation for future research.</p><p>The ” reviews” file is not that interesting because it only includes review dates for each listing. The “review_details” includes similar information with just 4 more additional columns, Therefore, we would left-merged the ‘host_id’, ‘host_name’ together with review_details file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*1dYj9d8Q7Snldk-mKHQSBw.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>Here are the 5 hosts with the greatest number of reviews. It is interesting to see that Loftium appears one more time at the top with 4181 reviews. We believe that this is due to the company’s unique business model that they were able to generate so many constructive reviews to improve their products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*yfzgSq1LR8Gp5htbQl6rJQ.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>In order to clean any Natural Language Processing dataset, we need to follow 5 steps:</p><ul><li>Take out empty comments: with notnull()</li><li>Remove numbers: with str.replace(‘\d+’,’’)</li><li>Lowercase: with str.lower()</li><li>Remove windows new line: with str.replace(‘\r\n’,””)</li><li>Remove all the stop words with nltk library: we need to assign a variable “stop_english” with stop.word() in English designation. Then after that we use lambda function to split the whole sentence by ‘ ’ and join together again without the stop words</li><li>Remove all punctuation: with str.replace(‘[^\w\s]’,” “)</li><li>Replace x spaces by one space: with .str.replace(‘\s+’, ‘ ‘)</li></ul><p>Finally, we could see the drastic difference between the original review at index 1 and the cleaned version</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wMjMqkZ19lL8URW2mX3r3A.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>Bearing in mind that the actual process does not actually stop there if we want to build a world cloud because these reviews are full of host’ names that are irrelevant to our analysis. Unfortunately, there are 1949 names available and searching each and every single one of them in the “review_details” dataset will take a very long time, plus the names do not really affect the final words cloud. Hence, we would move on from that point and future researchers can try to figure out how to deal with this specific task. After using CountVectorizer() function from sklearn and WordCloud(), we can see the rankings of most used words and also the word cloud itself</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/145/1*IomZoweA4lI-bX-rymS4Fw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*6XHyxu5WPNDpMlYiro4Ubw.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><h3><strong>V/ Conclusion</strong></h3><p>In a nutshell, exploring Seattle’s Airbnb situation both from a comparative study perspective and solutions proposing one gave us invaluable insights into how the company functions, strategize sand innovatively transforms into a force to be reckoned with in the hospitality industry. We believe that Airbnb will reclaim its rightful throne after weathering the current storm by the end of this year.</p><p><strong>Github: </strong><a href="https://github.com/Lukastuong123/Python-Projects/tree/master/Project-%20Airbnb%20(Python-%20Interactive%20Map%2C%20Natural%20Language%20Processing%2C%20Comparative%20Study%2C%20Regression)">https://github.com/Lukastuong123/Python-Projects/tree/master/Project-%20Airbnb%20(Python-%20Interactive%20Map%2C%20Natural%20Language%20Processing%2C%20Comparative%20Study%2C%20Regression)</a></p><p><strong>Reference &amp; Sources:</strong></p><p><strong>Airbnb</strong>. (2020, June 16). Seattle, WA | Airbnb Help Center. Retrieved from <a href="https://www.airbnb.com/help/article/869/seattle-wa">https://www.airbnb.com/help/article/869/seattle-wa</a></p><p><strong>Carville, O.</strong> (2020, June 8). <em>Airbnb sees a surge in vacation-rental demand</em>. Los Angeles Times. <a href="https://www.latimes.com/business/story/2020-06-07/airbnb-coronavirus-demand">https://www.latimes.com/business/story/2020-06-07/airbnb-coronavirus-demand</a></p><p><strong>Chen, B. X. </strong>(2017, January 11). The Guide to Being an Airbnb Superhost. Retrieved from <a href="https://www.nytimes.com/2017/01/11/technology/personaltech/the-guide-to-being-an-airbnb-superhost.html#:%7E:text=In%20the%20process%2C%20I%20have,percent%20of%20hosts%20are%20Superhosts.&amp;text=The%20designation%20as%20a%20Superhost,away%20from%20netting%20a%20profit">https://www.nytimes.com/2017/01/11/technology/personaltech/the-guide-to-being-an-airbnb-superhost.html#:%7E:text=In%20the%20process%2C%20I%20have,percent%20of%20hosts%20are%20Superhosts.&amp;text=The%20designation%20as%20a%20Superhost,away%20from%20netting%20a%20profit</a>.</p><p><strong>Constine, J.</strong> (2019, December 9). TechCrunch is now a part of Verizon Media. Retrieved from <a href="https://techcrunch.com/2019/12/09/airbnb-zeus/">https://techcrunch.com/2019/12/09/airbnb-zeus/</a></p><p><strong>Dalton, A.</strong> (2017, February 7). New York City starts cracking down on illegal Airbnb listings. Retrieved from <a href="https://www.engadget.com/2017-02-07-new-york-city-illegal-airbnb-listings-crackdown.html">https://www.engadget.com/2017-02-07-new-york-city-illegal-airbnb-listings-crackdown.html</a></p><p><strong>Grind, K. </strong>(2020, April 8). <em>Airbnb’s Coronavirus Crisis: Burning Cash, Angry Hosts and an Uncertain Future</em>. The Wall Street Journal. <a href="https://www.wsj.com/articles/airbnbs-coronavirus-crisis-burning-cash-angry-hosts-and-an-uncertain-future-11586365860">https://www.wsj.com/articles/airbnbs-coronavirus-crisis-burning-cash-angry-hosts-and-an-uncertain-future-11586365860</a></p><p><strong>Lalicic, L., &amp; Weismayer, C.</strong> (2017). The Role of Authenticity in Airbnb Experiences. Information and Communication Technologies in Tourism 2017, 781–794. <a href="https://doi.org/10.1007/978-3-319-51168-9_56">https://doi.org/10.1007/978-3-319-51168-9_56</a></p><p><strong>Levy, N. </strong>(2019, May 6). Real estate startup Loftium pivots to rentals, stops offering down payments for share of Airbnb profits. Retrieved from <a href="https://www.geekwire.com/2019/loftium-pivots-real-estate-biz-now-offers-discounts-apartment-tenants-rent-rooms-airbnb/">https://www.geekwire.com/2019/loftium-pivots-real-estate-biz-now-offers-discounts-apartment-tenants-rent-rooms-airbnb/</a></p><p><strong>Plautz, J. </strong>(2015, February 25). Higher than the average rating? 95% of Airbnb listings rated 4.5 to 5 stars. Retrieved from <a href="https://mashable.com/2015/02/25/airbnb-reviews-above-average/?europe=true">https://mashable.com/2015/02/25/airbnb-reviews-above-average/?europe=true</a></p><p><strong>Seattle City Council.</strong> (2017, April). Regulating Short Term Rentals Policy Brief. Retrieved from <a href="https://www.seattle.gov/Documents/Departments/Council/Issues/RegulatingShortTermRentals/Regulating-Short-Term-Rentals_Policy-Brief_2017-04.pdf">https://www.seattle.gov/Documents/Departments/Council/Issues/RegulatingShortTermRentals/Regulating-Short-Term-Rentals_Policy-Brief_2017-04.pdf</a></p><p><strong>Shafroth, F.</strong> (2016, September 17). Airbnb Creates an Affordable-Housing Dilemma for Cities. Retrieved from <a href="https://www.governing.com/columns/public-money/gov-airbnb-affordable-housing.html">https://www.governing.com/columns/public-money/gov-airbnb-affordable-housing.html</a></p><p><strong>USnews.</strong> (2019, November 4). Best Times to Visit Seattle. Retrieved from <a href="https://travel.usnews.com/Seattle_WA/When_To_Visit/">https://travel.usnews.com/Seattle_WA/When_To_Visit/</a></p><p><strong>Yse, Diego Lopez . </strong>(2019, January 15). Your Guide to Natural Language Processing (NLP). Retrieved from <a href="https://towardsdatascience.com/your-guide-to-natural-language-processing-nlp-48ea2511f6e1">https://towardsdatascience.com/your-guide-to-natural-language-processing-nlp-48ea2511f6e1</a></p><p>— — —</p><p><strong>Dataset: </strong><a href="http://insideairbnb.com/get-the-data.html">http://insideairbnb.com/get-the-data.html</a></p><p><strong>Inspired by:</strong> <a href="https://www.kaggle.com/erikbruin/airbnb-the-amsterdam-story-with-interactive-maps">https://www.kaggle.com/erikbruin/airbnb-the-amsterdam-story-with-interactive-maps</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48d472f14da3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/airbnb-part-b-python-interactive-map-natural-language-processing-48d472f14da3">Airbnb-Part B (Python- Interactive Map, Natural Language Processing)</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Airbnb Part A (Python-Visualization, Comparative Study, Regression)]]></title>
            <link>https://medium.com/data-science/airbnb-part-a-python-visualization-comparative-study-regression-7466c0cb5a1d?source=rss-b2f843da19c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7466c0cb5a1d</guid>
            <category><![CDATA[airbnb]]></category>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[washington-dc]]></category>
            <category><![CDATA[seattle]]></category>
            <dc:creator><![CDATA[Lukas Tuong]]></dc:creator>
            <pubDate>Thu, 25 Jun 2020 21:06:37 GMT</pubDate>
            <atom:updated>2021-03-31T05:02:08.550Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Airbnb-Part A (Python-Visualization, Comparative Study, Regression)</strong></h3><blockquote>Analyzed the Airbnb situation in Seattle through a Comparative Study with Washington DC, Regression Model, Interactive Maps<br>and Natural Language Processing. Presented constructive suggestions to city council and travelers</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oCYMBha6a3wYmtu_Mvc20w.png" /><figcaption><strong>Image by </strong><a href="https://unsplash.com/photos/o4ktwpTEQso"><strong>Ganapathy Kumar</strong></a><strong> and </strong><a href="https://unsplash.com/photos/6xafY_AE1LM"><strong>Harold Mendoza </strong></a><strong>on Unsplash</strong></figcaption></figure><p><strong>Part B:</strong> can be found <a href="https://medium.com/@tuonggreenager/airbnb-part-b-python-interactive-map-natural-language-processing-48d472f14da3">here</a></p><p>Since 2008, Airbnb has helped guests and hosts to travel in a more unique, personalized way. The company went from a single air mattress for rent to global cooperation valued at more than 30 billion dollars all thanks to its energetic founder- Brian Chesky. 2020 was supposed to be the golden year for Airbnb as it would go public and issue the worlds’ most sought after stocks. Tragically, Coronavirus happened. The travel sector was gutted by the pandemic. Airbnb now faces burning cash, angry hosts and an uncertain future as 2000 employees could potentially be discharged from their positions and the billion dollars debts with a high-interest rate that is being built to refund their customers. <a href="https://www.wsj.com/articles/airbnbs-coronavirus-crisis-burning-cash-angry-hosts-and-an-uncertain-future-11586365860">(Grind, 2020)</a></p><p>Nonetheless, things start to look up as June arrived. Airbnb reported having more nights booked for US listings between May 17 and June 3 than the same period last year. There was also a similar growth in domestic travel in countries that are successful in combating the virus: Germany, Portugal, South Korea, and New Zealand. Other companies, like Expedia and Booking.com also witnessed a jump in domestic vacation rental reservations. Months of pent-up demand is leading to a rush of summer reservations as more and more people are looking to escape their home coronavirus refuge. Now, Airbnb has more listings than it did before the crisis, focusing on exclusively traditional vacation rental markets top destinations in America. They are Big Bear Lake in Southern California, the Smoky Mountains, along the Tennessee-North Carolina border, and Port Aransas in Texas. <a href="https://www.latimes.com/business/story/2020-06-07/airbnb-coronavirus-demand">(Carville, 2020) </a>Still, any rebound is coming from a very low base with Chetsky said that he expected revenue this year to each half of 2019’s level in May’s live conference call announcement. He said going public this year is still an option but he will wait for the market to stabilize before making the final decisions.</p><p>As a previously trained hotelier who is living in Seattle, I want to do an analysis project on the current situation of Airbnb in Seattle in two parts. Part A will focus on the comparative study between two cities: Seattle and Washington DC. Seattle and Washington DC areas at the two ends of America that are widely known for different reasons: technological and cultural powerhouse vs political center, respectively. In addition, they share a similar population size (just over 700,000) and a number of listings (8740 and 9369). Then, in part B we will have a deeper look into Seattle’s market from perspectives of a governmental position and a traveler to recommend solutions that can benefit not only Airbnb but also the city and its citizens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*faILN9J7LWk9o13MO2oYsg.png" /><figcaption><a href="http://insideairbnb.com/get-the-data.html"><strong>Airbnb Open dataset</strong></a></figcaption></figure><p>The datasets can be downloaded at Airbnb Open Data sources. They include</p><p>· <strong><em>listings</em></strong><em>: </em>Detailed Listings data</p><p>· <strong><em>listings_details:</em></strong><em> </em>Summary information and metrics for listings</p><p>· <strong><em>reviews</em></strong><em>: </em>Detailed Review</p><p>· <strong><em>reviews_details:</em> </strong>Summary Review data and Listing ID (to facilitate time- based analytics and visualizations linked to a listing).</p><p>· <strong><em>calendar:</em></strong><em> </em>Detailed Calendar</p><p>· <strong><em>neighborhoods</em>:</strong> Neighbourhood list for geo-filter. Sourced from the city or open-source GIS files.</p><p>· <strong><em>neighborhoods.geojson</em> : </strong>GeoJSON file of neighborhoods of the city.</p><p>The dataset was obtained on April 23rd, 2020. Seattle has 7237 values while Washington DC has 9342</p><h3><strong>I/ Data Exploration</strong></h3><p>When we import the two cities’ “listings” datasets, we assigned encoding=’latin1’ as a reference to avoid running into the UnicodeDecodeError: “utf-8” codec can”t decode error. All the Seattle’s related dataset would be named “sl” while WashingtonDC has “wl”. Then, we will start with the data preparation part. There are three steps to go through with “listings’ datasets.</p><p><em>· </em><strong><em>Step 1:</em></strong><em> </em>Cleaning all the numerical data by running the two datasets through a function. It includes multiple sub-functions in order to address the issue: identify all the irrelevant factors that we don’t need from the two datasets ( access, interaction, house_rules, etc. ), drop all the columns that only have unique values like ID or url links (id, listings_url,etc.), add another column for review, convert all ‘price’ column into numbers, convert all percentage columns to float number, generate new review metric, and drop the original review columns</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*Non4VajnxXJdwY4AsilfTA.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p><em>· </em><strong><em>Step 2:</em></strong><em> </em>Preprocessing the categorical data by creating another function: standardize the factors from complicated multi-categorical data with has no formal type (like ‘amenities’ and ‘host_verifications’), generate dummy variables but avoid its trap, and generate the length of each row for the ‘amenities ’ and “host-verifications” in case the number of these categories may affect the respondent variable even when the real categories do not</p><p>· <strong>Step 3:</strong> Check the quantitative formation from both cities’ “listings” datasets. Since the clean version of Seattle’s “listings” has fewer columns compared to the Washington DC’s “listings”, 29 and 33 respectively, we will check what column appears in one table but not the other:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*S-a26xxfTmgvu1q_qSApZg.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><h3><strong>II/ Visualization and Regression Analysis</strong></h3><h4><strong>1)</strong> <strong>What effects do AirBNB homes properties have on prices in both west and east coasts?</strong></h4><p>From a respective point of view, there is a significant difference between the price range in Seattle and Washington DC with the former fair much worse compared to the latter. A room in Seattle can only cost up to $1200/ night while the most expensive room in Washington DC is over double that amount ($3000/night). Besides the fact that boutique hotels are among the most costly both in Seattle and Washington DC, jet setters to Seattle like to stay in In Law and Villa and those who visit Washington DC prefer checking in Hotels to other property types. It is also north worthy to see that Seattle has a wider fluctuation in its price range across all property types. This means that you can choose either economical below or extravagant above the rest for your stay in the Emerald City. Nevertheless, if we look a little bit closer, we will see that property price of other properties types like Houses, Apartments, Guest houses share a similar price range between $100-$200/night regardless of the locations. Therefore, travelers will not notice the disproportional price range difference between the two cities when booking on Airbnb.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kwebcH6X0yZsgYiIOO3sTg.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>In Seattle, travelers prefer to have a real bed or at least a pull-out sofa for Entire home, Private room and Hotel room, which explains why they are the most expensive types of beds in those categories. Surprisingly, guests’ expectations dropped dramatically in the Shared Room category where a majority of them are satisfied with the Airbed even though those could be equally if not more expensive in comparison with the other bed types across all the other room types ($500/night at maximum). One rationale for such a strange phenomenon is the abundance of seasonal festivals that focus on art, culture, music, etc. throughout the summer. <a href="https://www.thestranger.com/things-to-do/2019/07/17/40789078/46-festivals-to-check-out-in-seattle-this-weekend">(Bell et al., 2019) </a>Participants are often 20s-30s with more flexible adaptability, thus, an expensive Airbed in a Shared Room during high season is better than having no accommodation. On the contrary, in Washington DC, Airbed is the top two choices across all the property types except for the Hotel room. Bed types ‘price ranges are indistinguishable between Seattle and Washington DC, while the Hotel Room’s Real bed in the latter is two times more expensive ($600/ night on average) and has more sparse distribution ($50- $1200/ night) than the former’s (around $200/ night on average)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XGKOYnuQVj7LP2CHjSjESw.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>In general, the number of beds and number of bathrooms have positive correlations to each other, the higher the number the beds and bathrooms guests need, the higher the price. However, after hitting a certain number of beds (11) and bathrooms (6–6.5) the correlation becomes negative. Hence, we can assume that as there are rules that any guests who book for more than 12 beds or 6 bathrooms will receive group discounts. The relationship between beds and prices in Seattle is much more stable and evenly distributed than in Washington DC. One could believe that the local hoteliers and hosts are much more familiar when hosting a big quantity of guests in one check-in according to the aforementioned reasons for the city’s love of festivals. Equally important, Bathrooms leave heavier impacts on the price changes compared to beds. The distributions are negatively skewed to the left with and they are not well distributed as there are fluctuations within a small amount. For example, price drops from $600/night to $100/night between 4.5- 5 bathrooms before bouncing back to $1000/night at 6 bedrooms in Seattle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*dPnnXFWxRble8XZboOvR3A.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>On the other hand, the correlations between bedrooms and accommodates with the price in Seattle and Washington DC are strictly positive, left-skewed. These price ranges are also akin to each other with $100-$2000/night for the Bedrooms and $100-$800/night for Accommodates category. Interestingly, the highest number of Bedrooms in Seattle is 8 while in Washington DC is 27, the highest number of Accommodates in Seattle is 25 while in Washington DC is 16. We can conclude that those who visit Seattle for summer festivals only need to take a shower before going out again rather than staying in so they do not mind sleeping on uncomfortable Airbeds in Shared Apartment. This phenomenon was indicated by the drastic increase in room price by $600 between 7 and 8 bedrooms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*-zXLs0CT9-nuCeu01A6jpg.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><h4><strong>2)</strong> What hosts’ behaviors or profiles would influence AirBNB tenants reviews in both west and east coasts?</h4><p>To answer this question, we will create heat maps to demonstrate the correlation between reviews and behavior features of Airbnb in each city. There are four steps</p><p><em>· </em><strong><em>Step 1:</em></strong>Turn all six categorical columns into dummy variables to evaluate them further on: ‘host_response_time’, ‘host_has_profile_pic’, ‘host_identity_verified’, ‘host_is_superhost’, ‘instant_bookable’, ‘cancellation_policy’</p><p><em>· </em><strong><em>Step 2: </em></strong>Merge the Dummy variables columns together</p><p><em>· </em><strong><em>Step 3: </em></strong>Just keep only the relevant factors that contributed to the behavior related columns from the groups. Some factors have a wide array of values inside, so we also need to take out some of the most excessive ones as well like ‘host_response_time_in a week’ because they only apply for a minority of the datasets.</p><p><em>· </em><strong><em>Step 4: </em></strong>Create the heat map for Seattle and Washington DC using the seaborn.heatmap() function</p><p>For Seattle’s Airbnb, the correlations are relatively lower, with the highest being 0.39 between ‘host_is_super_host” and “new_review_metric”. This means that the review score for your listing depends on whether or not the host is a super host in Seattle. On the other hand, Washington DC’s Airbnb, the correlations are relatively higher on positive and similar on the negative side, with the highest being 0.55 between ‘host_response_rate” and “host_acceptance_rate”. This means that if a host in Washington DC reads your message, there is a 55% chance that he/she will accept your Airbnb booking request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*dwSG_ze1j5Iwke-DQHtB2A.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*S9dV32v-flZdYYkKk6fl7w.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><h4><strong>3)</strong> <strong>Which AirBNB listing property is the most important one in reviews?- (Regression Analysis)</strong></h4><p>In order to access how factors can influence the final review score, we will carry out Regression analysis research thanks to the Random Forest method and then illustrate. The data preprocessing includes: Dropping irrelevant variables and rows with missing reviews values, Filling missing numeric columns with their means, Creating dummy for the categorical variables. X is all the independent factors while y has ‘new_review_metric’ as dependent variables and split these data tables with 0.75/0.25 ratio. For the regressors, we will use the (n_estimators=100, criterion=’mse’, random_state=42, n_jobs=-1. The final model accuracies and validation are as below. The results are very similar to each other, with low mean squared error and high R2, which indicate that there is just minor difference between the predicted and available dependent value and we can explain more than 90% of the observed variation can be explained by the model’s inputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*PrwiQI-R0rc4LcMEOIYnmQ.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><p>In the visualization for the degree of importance for the independent features to the reviews, we can see that there is a greater difference between the first and second highly important feature in Washington DC compared to Seattle. Additionally, visitors to the “Queen City” put more emphasis on the quality of the hosts themselves rather than the properties or rooms when booking Airbnb, on the contrary to the pattern in the Capital of America. The ranking of ‘Price’ is also lower in Seattle thanks to the moderate average rental price of the city as discussed above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dt1WQNouaIc5NNQBZrAoeg.png" /><figcaption><strong>(Image by author)</strong></figcaption></figure><blockquote><strong>*** To be continued in part B </strong>***</blockquote><p><strong>Github: </strong><a href="https://github.com/Lukastuong123/Python-Projects/tree/master/Project-%20Airbnb%20(Python-%20Interactive%20Map%2C%20Natural%20Language%20Processing%2C%20Comparative%20Study%2C%20Regression)">https://github.com/Lukastuong123/Python-Projects/tree/master/Project-%20Airbnb%20(Python-%20Interactive%20Map%2C%20Natural%20Language%20Processing%2C%20Comparative%20Study%2C%20Regression)</a></p><p><strong>Reference &amp; Sources:</strong></p><p><strong>Bell, J., Friedman, E., Selling, K., &amp; Zelman, J.</strong> (2019, July 17). <em>46 Festivals to Check Out in the Seattle Area This Weekend</em>. The Stranger. <a href="https://www.thestranger.com/things-to-do/2019/07/17/40789078/46-festivals-to-check-out-in-seattle-this-weekend">https://www.thestranger.com/things-to-do/2019/07/17/40789078/46-festivals-to-check-out-in-seattle-this-weekend</a></p><p><strong>Carville, O.</strong> (2020, June 8). <em>Airbnb sees a surge in vacation-rental demand</em>. Los Angeles Times. <a href="https://www.latimes.com/business/story/2020-06-07/airbnb-coronavirus-demand">https://www.latimes.com/business/story/2020-06-07/airbnb-coronavirus-demand</a></p><p><strong>Grind, K. </strong>(2020, April 8). <em>Airbnb’s Coronavirus Crisis: Burning Cash, Angry Hosts and an Uncertain Future</em>. The Wall Street Journal. <a href="https://www.wsj.com/articles/airbnbs-coronavirus-crisis-burning-cash-angry-hosts-and-an-uncertain-future-11586365860">https://www.wsj.com/articles/airbnbs-coronavirus-crisis-burning-cash-angry-hosts-and-an-uncertain-future-11586365860</a></p><p>— — —</p><p><strong>Dataset: </strong><a href="http://insideairbnb.com/get-the-data.html">http://insideairbnb.com/get-the-data.html</a></p><p><strong>Inspired by:</strong> <a href="https://www.kaggle.com/xichenlou/seattle-and-boston-airbnb-data-comparison">https://www.kaggle.com/xichenlou/seattle-and-boston-airbnb-data-comparison</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7466c0cb5a1d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/airbnb-part-a-python-visualization-comparative-study-regression-7466c0cb5a1d">Airbnb Part A (Python-Visualization, Comparative Study, Regression)</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Movie Recommendations System (Spark, SQL with Python)]]></title>
            <link>https://medium.com/analytics-vidhya/movie-recommendations-system-spark-sql-with-python-4ad29f238ab?source=rss-b2f843da19c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ad29f238ab</guid>
            <category><![CDATA[netflix]]></category>
            <category><![CDATA[movies]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Lukas Tuong]]></dc:creator>
            <pubDate>Thu, 21 May 2020 02:16:49 GMT</pubDate>
            <atom:updated>2020-06-09T17:22:41.527Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Movie Recommendations System(Spark, SQL with Python)</strong></h3><h4>Created ‘Similar Movies Recommendations’ model from One Million Ratings using Spark’s Cluster Manager on AWS. Executed SQL commands, SQL-style functions and Improved the Movie Recommendations model by MLLib.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l9dIvOVH5KhpK1LFvgoClA.jpeg" /><figcaption>Image Source: Internet</figcaption></figure><p>Thanks to the advancement of technology in the film industry in recent years, more and more people are enjoying their favorite flicks at the comfort of their sofas. Therefore, it is no surprise to see the gargantuan fights for supremacy between different movies streaming services like Netflix, Hulu, Disney+, etc. across news headlines (Alexander, 2020). Despite having distinct marketing strategies and original content, all of them share these websites share one common thing: ”movie recommendation system”.</p><p>Movies are suggested to the viewers through 2 methods: Collaborative filtering or Content-based filtering. Content-based filtering made their predictions based on the genes of your watch history, if you like ‘Friends’ or ‘Zootopia’ then you will see ‘Shazam, which is pure ‘comedy’, in your recommendation list. On the other hand, Collaborative Filtering system gets its prediction based on similar users’ history. Movies streaming services use both simultaneously to get the best results. (Kirzhner, 2018)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*X9T91TjJeE2hN0op5uUsyg.png" /></figure><p>In this project, we will explore the Collaborative Filtering approach to get the movie recommendations for the StarWar (1997) movie using Spark code in Python. The recommendations are generated by the watched history of those who watched ‘Star Wars (1997) while reviewed other movies. If they rate a ‘Star Wars (1997)’ highly, chances are, they also think the same thing with other similar flicks. The project uses three separate datasets:</p><ol><li>The <strong>u.ITEM</strong> file contains: ‘MovieID’, ‘Movie Name’</li><li>The <strong>u.DATA</strong> file contains: ‘UserID’, ‘MovieID’, ‘‘MovieRating’,’Time Stamp’ of 100,000 movie ratings. The dataset was from 1998</li><li>The <strong>‘ratings’</strong> file contains similar features like the <strong>u.DATA</strong> file but for 1 million movie ratings. The dataset was from 2003</li></ol><h3><strong>I/ Exploratory Data Analysis (EDA)</strong></h3><p>Firstly, we run the introduced the Pyspark package into the Anaconda environment. Every single time we run our programs, we need to set up the right context and some configuration in “local”. Then I created the Resilient Distributed Dataset (RDD), which is a distributed collection of data elements spread across many machines in the cluster and usually more common with Java or Scala programming. After that, we assigned use ‘map’ function with lambda to parse the data into different values and count all of reviews based on the value though countByValue() function. Consequently, we would have each review score classified as a key while the number of reviews with similar score as value in RDD. The result below shows us that viewers are typically generous when it comes to ratings, the majority of movies rank between 2 to 4 with 4 having the greatest number of reviews. It takes genuine effort for a movie to be recognized as best or classic at number 5 with only approximately 2000 of them made the cut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*RxLqO4ZHWx5ZiSyjKZU0Kg.png" /></figure><p>Next, We will create ‘movies’ variable using the map() function and lambda method to pull out nothing but a list of ‘MovieID’ as key and assign each line’s value as ‘1’ so that we can add them up together later. Then, we count the number that a movie was review by adding up all the lines that share the same ‘MovieID’ key through the reduceByKey() function. After that, we switched the place between the key and the value so that the ‘Number of occurrences’ became keys while the ‘MovieID’ became value. With sortByKey(), we found out ‘50’ is the most popular movie with 584 reviews.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*uJh93BtjkFx1w3rmStlZ0Q.png" /></figure><p>To check what movie it is, we built a dictionary to match the ‘MovieID’ with the ‘MovieNames’. Then we finally found that it was ‘Star Wars (1997)’ all along</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*OPpPZSFaR4D8DsTG4Dli_g.png" /></figure><h3><strong>II/ Movie Recommendations and potential model optimization methods</strong></h3><p>In order to recreate the movie recommendations system, we will have to follow three steps. Firstly, we<strong> </strong>find every pair of movies that were watched by the same person. Then, we measure the similarity of their ratings across all users who watched both. Finally, we sort by movie, then by similarity strength</p><p><strong>An approach by code:</strong></p><ol><li>Map input ratings to (userID,(movieID,rating))</li><li>Find every movie pair rated to the same user</li></ol><blockquote>This can be done with a “self-join” operation</blockquote><blockquote>At this point we have (userID,((movieID1,rating1),(movieID2,rating2)))</blockquote><p>3. Filter out duplicate pairs</p><p>4. Make the movie pairs the key</p><blockquote>map to ((movieID1,movieID2), (rating1,rating2) /// movieID: keys, rating: values</blockquote><p>5. groupByKey() to get every rating pair found for each movie pair</p><p>6. Compute similarity between ratings for each movie in the pair</p><p>7. Sort, save &amp; display results</p><p>It is noted that the model we are using implemented the ‘Coside metrics’. We also set the threshold for the minimum co-raters or minimum scores as 0.95 and the Occurrence threshold as 50. Unlike the other project, this cannot be done with the script on Jupyter Notebook but rather Anaconda prompt. In the Anaconda prompt from your start menu and run the command ‘ spark-submit Movies-Similarities.py 50’. Make sure to save the file in .py rather than .ipynb format and run your code on the right drive so that it will run smoothly. Once done, we have the final recommendations below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*na2c877rHE0YGB7X-lxfkw.png" /></figure><p>‘Score’ indicates how accurate your prediction is and ‘Strength’ symbolizes the number of similar users who watched ‘Star Wars (1977)’ also watched that movie. ‘Score’ has more credibility in this report so that is why we have ‘Empire Strike Back’ being recommended before ‘Return of the Jedi’ even though the latter has lower strength. However, we need to make sure to moderate the ‘Strength’ threshold well since we have some unrelated recommendations like ‘20,000 Leagues Under the Sea’, ‘Close Shave, A ’ ‘Wallace &amp; Gromit’ with only fewer than 100 similar reviews.</p><p><strong>There are five ways to improve the results that future researchers to improve the model</strong>:</p><blockquote>· Discard all the bad ratings like ‘1’ and keep only the good recommendations</blockquote><blockquote>· Try different similarity metrics instead of the ‘Coside metrics’ such as Pearson Correlation Coefficient, Jacquard Coefficient, Conditional Probability</blockquote><blockquote>· Invent a new similarity metric that takes the number of co-raters into account</blockquote><blockquote>· Merge the ‘Content filtering approach’ with the’ Collaborative filtering’ by using the genre dataset to realistically stimulate a Movie recommendation system</blockquote><blockquote>· Adjust the thresholds that we set above</blockquote><p>In this instance, we would look at the beside the top 3, what are the other 3 recommendations that the system will recommend we modified our thresholds. The reasons why we ignored the first three movies were because they all have ‘Score’ rates above 300, rendering our comparison useless if we include them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*ynn0jB0xgrm4xTMebSS-KQ.png" /></figure><p>From the table above, it is clear the last threshold scores combination is the best since it includes all beloved classics that are similar to the ‘Star War 1977’ in term of genres: adventure, action, and sci-fi</p><h3><strong>III/ Movie Recommendations on the Cloud Cluster (Amazon Web Service-EC2)</strong></h3><p>In this part we throw in a million movie ratings instead of just 100.000, using EC2 in AWS to run Spark on the Cloud Cluster.</p><h4><strong>a) Introduction to AWS Elastic MapReduce and PartitionBy()</strong></h4><p><strong>AWS Elastic MapReduce:</strong></p><ol><li>Very quick and easy way to rent time on a cluster of your own</li><li>Sets up a default spark configuration for you on top of Hadoop’s Yarn cluster manager</li><li>Spark also has a built-in standalone cluster manager and scripts to set up its own EC2-based cluster (Barr, 2009)</li><li>Spark on EMR isn’t really expensive but it is not cheap either</li><li>Make sure things run locally on a subset of your data first</li></ol><p><strong>PartitionBy():</strong> is a method on an RDD that you can use to say “Hey I’m gonna run some large operation but I don’t have enough computer resources to actually split this up into many different executors, many different runs” This basically tells me how many pieces I want to break this job up into. It is very important to determine how many partitions are enough</p><ol><li>Too few and we will not take full advantage of your cluster</li><li>Too many results in too much overhead from shuffling data</li><li>At least as many partitions as you have cores or executors that fit within your available memory</li><li>ParticionBy(100) across 10 computers is usually a reasonable place to start for large operations</li></ol><h4><strong>b) Process and review:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*H-Q1R777SQSgOIvyuqlKqw.png" /></figure><ol><li>We will use the<strong> ‘u.DATA’</strong> file but for 1 million movie ratings. We load the data from s3n instead of the normal log on the Amazon simple stories service. The dataset is stored in the cloud system itself rather than the actual file that we save on our computer. (Sundog-Spark). SparkConf is empty rather than having something behind it because I am gonna pass it on the command line. Take advantage of some of the Pre-congregated stuff on EMR elastic Map Reduce that will automatically tell Spark to run on top of Hadoop Yarn</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*gTCjpVOzt3VAm_bcuWvwZg.png" /></figure><p>2. Repeat the code that we created in the second part.</p><p>3. Turn on the AWS to specify <strong>memory per executor </strong>by using an empty default SparkConf in your driver-this way, we‘ll use the defaults EMR sets up instead, as well as any command-line options you pass into spark-submit from your master node. In this project, the default executor memory budget of 512MB is insufficient for processing one million movie ratings. So instead we have to do:</p><blockquote>spark-submit-executor-memory 1g Movie-Similarities-1M.py 260</blockquote><p>(from the master node of our cluster. The executor-memory 1g is to specify u will put 1gb for each executor to run everything smoothly)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jTfR2UOODjTwaWhJ5X7b2g.png" /></figure><p>4. Run the dataset on the online cluster. In order to do so we have to go through many minor steps. We got our scripts &amp; data someplace where EMR can access them easily. Next, spin up an EMR cluster for Spark using the AWS console, <strong>in which, AWS started billing at that very moment. </strong>Then, get the external DNS name for the master node, and log into it using the “Hadoop” user account and your private key file. Copy your driver program and any files it needs. Finally, run spark-submit and watch the Output.</p><blockquote><strong><em>But always remember to terminate the cluster when you are done</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1T1A5ecZe_cBFhjwbCkww.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*2uORqiE_teDfZLVgqbRf2w.png" /></figure><p>Like what we had before, “Star Wars: Episode V” is the most similar movie. But then after that, “Sanjuro (1962)” and ‘Run Silent, Run Deep’ ranked as 2nd and 5th with ‘score’ of 0.9877 and 0.9791, respectively. However, when we look at the ‘strength’, only 60 rated ‘Star War IV’ also rated “Sanjuro (1962)” and only 145 for ‘Run Silent, Run Deep’. These are very low values. Since we are working with 1 million results, it is much better to increase the ‘strength’ threshold a little bit more to display a more correct result like ‘Raiders of the Lost Ark’ or ‘Star Wars: Episode VI’. We later fixed the occurrence threshold from 50 to 1000 so that it can yield more accurate values</p><p>Bearing in mind, there are a few issues that we might encounter later on. One of them is when we have executors failing to issue heartbeats. Thus,when you are asking too much of each executor and you need more of them so you modify the partitionBy() to demand less work from each individual executors by using smaller partitions. Another issue is managing dependencies because your executors can sometimes do not belong on the same box as your driver script. We can either use broadcast variables to share data outside of RDD’s or some Python packages that are not pre-loaded on EMR.</p><h3><strong>IV/ Movie Recommendations system using Spark’s Machine Learning Library (MLlib)</strong></h3><h4><strong>a) MLlib abilities</strong></h4><ol><li><strong>Feature extraction</strong>: Term Frequency/ Inverse Document frequency useful for search</li><li><strong>Basic statistics</strong>: Chi-squared test, Pearson or Spearman correlation, min, max, mean, variance</li><li><strong>ML models</strong>: Linear Regression, Logistic Regression, SVM, Naïve Bayes, Decision Trees, K-Means clustering (McDonald, 2019)</li><li>Principle components of analysis, singular value decomposition</li><li>Recommendations using Alternating Least Squares</li></ol><p>MLlib data has three types: Vector (dense or sparse), Labeled Point, Ratings</p><h4><strong>b) Process and review:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*0xCSaYwDaFW0HJ3n8IV-Ug.png" /></figure><p>We first added 3 more fake reviews like above to the <strong>u. Data</strong> to test our model, created the configuration and checkpoints. Then, we loaded the data and trained the model</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*Tmf6kl5inrNW3FxfT00L2g.png" /></figure><p>Every time you run the code, it would spit out different results compared to the previous. Unfortunately, all the movie recommendations with numIterations = 20 were not similar to the ‘’Star War Empire Strike Back”. With numIterations = 6, the model ‘s recommendations like’ American Buffalo’ or ‘Harlem (1993)’ even stray further away from the ‘Star War’ movie. These are sketchy results and we can improve the model futher. If the model is very sensitive to paramters chosen We can split the data into ‘train’ and ‘test’ set to evaluate various permutations of parameters. Create a nested loop (black box) to try all the combinations that you can think of. But it is quite dodgy as you can overfit the result. Such method’s prediction does not always work if we change their UI where different people are using it or from a different time frame. Therefore, we need to always be mindful and skeptical when analyzing big data even though our model. normal Spark actually provided more accurate results compared to MLLib in this instance.</p><h3><strong>V/ Simplify the code with SparkSQL and DataFrames</strong></h3><p>In this part of the project, we will see have a look of how SparksSQL can be help us to simplify our code with DataFrames compared to RDD. Dataframe belongs to the Dataset umbrella, DataFrame is a table or a two-dimensional array-like structure in which each column contains values of one variable and each row contains one set of values from each column. (Geeksforgeeks, 2019) It is considered to be the future of Spark thanks to its distanced advantages compared to the RDD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*02UwsePTHCbTekvJDJ3h2Q.png" /></figure><p>Instead of the big chunks of codes like earlier, the code is more sufficient when we used the DataFrame rather than the RDD format with SQL. All the actions can be rendered into one single code line as well can see below. We could simultaneously group the data according to their ID, then count them and then sort them by a number of reviews for movies in ascending order. We achieved the same EDA analysis at a faster pace compared to part I with ‘Star War(1997)’ being the most popular movie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*UBD64j7Hb_-kbq4lv4UyMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*uf-xsX3SnNBSiGag5N0vnQ.png" /></figure><h3><strong>VI/ Conclusion</strong></h3><p>This project is a good opportunity for us to understand how Spark was implemented in building an effective Movie Recommendation system in the according to the Collaborating Filtering method. It also proves that machine learning is not always about using the most advanced technology but rather how well we actually understand the issue. Evidently shown, through the triumphant of simple Spark code over-complicated MLlib</p><p><strong>Github</strong>: <a href="https://github.com/Lukastuong123/Python-Projects/tree/master/Project-%20Movie%20Recommendations%20(Spark%2C%20SQL%20with%20Python)">https://github.com/Lukastuong123/Python-Projects/tree/master/Project-%20Movie%20Recommendations%20(Spark%2C%20SQL%20with%20Python)</a></p><p><strong>Reference &amp; Sources:</strong></p><p><strong>Geeksforgeeks. (2019).</strong> Python | Pandas DataFrame. Retrieved from <a href="https://www.geeksforgeeks.org/python-pandas-dataframe/">https://www.geeksforgeeks.org/python-pandas-dataframe/</a></p><p><strong>Alexander, J. (2020)</strong>. The streaming wars are finally beginning, but it’s more of a polite quarrel than an all-out war. Retrieved from <a href="https://www.theverge.com/2020/2/6/21126156/streaming-wars-disney-plus-netflix-wall-street-subscribers-hbo-max-peacock">https://www.theverge.com/2020/2/6/21126156/streaming-wars-disney-plus-netflix-wall-street-subscribers-hbo-max-peacock</a></p><p><strong>McDonald, C. (2019).</strong> Apache Spark Machine Learning Tutorial | MapR. Retrieved from <a href="https://mapr.com/blog/apache-spark-machine-learning-tutorial/">https://mapr.com/blog/apache-spark-machine-learning-tutorial/</a></p><p><strong>Barr, J. (2009, April 2).</strong> Announcing Amazon Elastic MapReduce. Retrieved from <a href="https://aws.amazon.com/blogs/aws/announcing-amazon-elastic-mapreduce/">https://aws.amazon.com/blogs/aws/announcing-amazon-elastic-mapreduce/</a></p><p><strong>Kirzhner, E. (2018).</strong> Machine Learning. Explanation of Collaborative Filtering vs Content Based Filtering. Retrieved from <a href="https://codeburst.io/explanation-of-recommender-systems-in-information-retrieval-13077e1d916c">https://codeburst.io/explanation-of-recommender-systems-in-information-retrieval-13077e1d916c</a></p><p><strong>Movie Review Dataset</strong>: <a href="https://grouplens.org/datasets/movielens/">https://grouplens.org/datasets/movielens/</a></p><p><strong>Inspired by: Kane, F. (2020).</strong> Taming Big Data with Apache Spark and Python — Hands On! [Slides]. Retrieved from <a href="https://www.udemy.com/course/taming-big-data-with-apache-spark-hands-on/">https://www.udemy.com/course/taming-big-data-with-apache-spark-hands-on/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ad29f238ab" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/movie-recommendations-system-spark-sql-with-python-4ad29f238ab">Movie Recommendations System (Spark, SQL with Python)</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microsoft Malware Detections (R- Classification)]]></title>
            <link>https://medium.com/data-science/microsoft-malware-detections-r-classification-46bf5355f930?source=rss-b2f843da19c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/46bf5355f930</guid>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[kaggle]]></category>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[r]]></category>
            <dc:creator><![CDATA[Lukas Tuong]]></dc:creator>
            <pubDate>Mon, 11 May 2020 23:41:09 GMT</pubDate>
            <atom:updated>2020-09-22T05:45:03.961Z</atom:updated>
            <content:encoded><![CDATA[<h4>Inspected factors that contribute to a computer being infected and compared three different prediction models: LASSO Regularization with Logistic Regression, Random Forest, and Gradient Boosting Decision Trees (GBDT).</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wBjGLLkXaEWNfgotG_Lzsw.jpeg" /><figcaption>Corona Wash &amp; Vax, a game by <a href="https://unsplash.com/photos/M9QO_2zjHNY">KOBU Agency</a> on Unsplash</figcaption></figure><p><strong>Team Members</strong>:<a href="https://www.linkedin.com/in/quoc-tuong-lukas-dong/"> Lukas Tuong</a>, <a href="https://www.linkedin.com/in/yechen-charlotte/">Ye Chen</a>, <a href="https://www.linkedin.com/in/jiayi-wang-325joygee/">Jiayi Wang</a>, <a href="https://www.linkedin.com/in/jingyan-qiao/">Jingyan Qiao</a></p><h3>I/ Introduction</h3><p>With the development of information industry and related technologies, computers and other machines become increasingly important in the production of any industry, keeping the machine in a safe condition and not getting infected by any type of malware is a top challenge for the security department. The malware industry continues to be a well-organized, well-funded market dedicated to evading traditional security measures. Once a computer is infected by malware, criminals can hurt consumers and enterprises in many ways. To protect the enterprise and consumer customers’ computer and reduce the risk of personal data leaking in advance, Microsoft takes this problem seriously and the factors of getting a machine infected was investigated in order to improve their security system. The dataset conducted from Microsoft contains various properties of each machine and the actual infection status of each machine-generated by Microsoft’s endpoint protection solution, Windows Defender, which was designed to meet certain business constraints, both in regards to user privacy as well as the time period during which the machine was running.</p><p>Logistic regression model is a classic machine learning model classification which makes it an appropriate regression analysis to conduct when the dependent variable is dichotomous (binary). Like all regression analyses, the Logistic regression is a predictive analysis that is used to describe data and to explain the relationship between one dependent binary variable and one or more independent variables. The dependent variable (response) in the given dataset is whether the malware was detected on the machine or not, therefore the logistic regression model is the fundamental model in this analysis. When pursuing the higher accuracy of the prediction for high-dimensional datasets, the trade-off between bias and variance appears all the time. The given dataset contains 83 columns and over 50k rows. Regularization regression is a method to avoid the risk of overfitting and reduce the variance of the models without a substantial increase in bias when fitting a regression model on a high-dimensional dataset. Least Absolute Shrinkage and Selection Operator (LASSO) Regularization method is suitable for models with multiple highly correlated predictors to remove the redundant features in order to facilitate model interpretation to make decisions.</p><p>A decision tree is a model used to classify observations by splitting data based on the features, but it has weaknesses especially in big data when researchers are facing various types of features or a large amount of data. The complexity of the decision trees severely reduces the efficiency and accuracy of the prediction model. Random Forest is a machine learning method in classification analysis that consists of a large number of individual decision trees, functioning as an ensemble. Researchers harvest class predictions from each of the trees and decide which is the most important class base on the most votes method. To optimize predictions, researchers usually use bootstrapping methods. Another machine learning algorithm method well-suited for the classification field based on decision trees is Gradient Boosting Decision Trees (GBDT) model. It is an ensemble of the model using a boosting technique, essentially combining weak classifiers to form a stronger one. Specifically, in this case, the weak classifiers are different decision trees, therefore the result of GBDT model could be considered as a combination of these decision trees. The boosting process is sequential, which connects the subsequent trees to the previous ones with errors in the predictions generated in the past in order to reduce the prediction error gradually during the combination process. Besides, the GBDT model will not consider the result from one single tree as the final result. Thus, it can be used to solve the overfitting problem as well.</p><p>The goal of this study is to predict the probability of the machine being infected by malware and determine the most significant factors affecting the infections for Microsoft Developers to take actions to improve their systems in the future. Also, it is an opportunity to gain a better understanding of the theory and performance of various classification methods such as simple logistic regression, logistic regression model with Lasso Regularization, Random forest and Gradient Boosting Decision Trees method, and explore more on the relationship between a large amount of predictors and the categorical response variable, and further make a prediction based on the findings.</p><h3>II/ Data &amp; Methodology:</h3><h4>Data description:</h4><p>The data was retrieved from <a href="https://www.kaggle.com/c/microsoft-malware-prediction">Microsoft Competition in Kaggle</a> and the data cleaning process was executed. The raw dataset contains 8,921,483 observations with 82 various features of the machine and one response variable, that is whether the machine was infected by the malware (Having Infections: coded as 1, Not Having Infections: coded as 0). After investigating the frequency of the missing values and the distribution of dimensions for each feature, those features with a higher level of missing values (percentage of the missing values over 75%) or highly imbalanced dimensions were deleted. For instance, none of the machines appears to have a Beta software, therefore the feature IsBeta (whether the Beta software appears on each machine) was deleted and 50 variables were studied in this analysis.</p><p>The features assumed to be significant in this study were:</p><p><em>· </em><strong><em>EngineVersion:</em></strong><em> the version of the engine.</em></p><p><em>· </em><strong><em>AvSigVersion: </em></strong><em>the version of the anti-virus signature database.</em></p><p><em>· </em><strong><em>AvProductStateIdentifier:</em></strong><em> the status of the anti-virus software used on the machine.</em></p><p><em>· </em><strong><em>Wdft_IsGamer: </em></strong><em>whether the machine was a gamer machine.</em></p><p><em>· </em><strong><em>CityIdentifier: </em></strong><em>where the machine was located in.</em></p><p><em>· </em><strong><em>CountryIdentifier: </em></strong><em>the country the machine was located in.</em></p><p><em>· </em><strong><em>OsVer: </em></strong><em>the version of the current operating system.</em></p><p><em>· </em><strong><em>OsPlatform:</em></strong><em> the platform used for the operating system.</em></p><p><em>· </em><strong><em>IsProtected:</em></strong><em> whether there is any anti-virus products on the machine.</em></p><p><em>· </em><strong><em>Firewall</em></strong><em>: whether the firewall was built on the machine.</em></p><p><em>· </em><strong><em>HasTpm: </em></strong><em>whether the machine has a trusted platform module.</em></p><p><em>· </em><strong><em>SmartScreen:</em></strong><em> smart screen enabled on the machine.</em></p><p><em>· </em><strong><em>Census_SystemVolumeTotalCapacity</em></strong><em>: the size of the system volume installed on the machine.</em></p><p><em>· </em><strong><em>Census_OsBuildRevision:</em></strong><em> the latest version of the operating system on the machine.</em></p><p><em>· </em><strong><em>Platform</em></strong><em>: the platform installed on the machine.</em></p><p><em>· </em><strong><em>Census_TotalPhysicalRAM:</em></strong><em> the number of the Random-Access Memory.</em></p><p><em>· </em><strong><em>Census_HasOpticalDiskDrive</em></strong><em>: whether the machine has an optical disk drive.</em></p><p><em>· </em><strong><em>Census_OsEdition:</em></strong><em> the edition of the current operating system.</em></p><p><em>· </em><strong><em>Census_IsTouchEnabled:</em></strong><em> whether the machine is a touch device.</em></p><h4>Methodology:</h4><blockquote><strong>Logistic Regression Model.</strong></blockquote><p>a. Summarize the logistic model and select the predictors with significant contribution based on the P-value at a 95% confidence interval.</p><p>b. Plot the predicted probability of the dependent variable.</p><blockquote><strong>LASSO Regularization Method: Logistic Regression Model.</strong></blockquote><p>a. Plot the cross validation curve with all selected predictors.</p><p>b. Determine the value of Lambda that minimize the mean cross validation error and the value of lambda within one standard error of the minimal mean-squared error to identify the optimal logistic regression model with lasso regularization method.</p><blockquote><strong>Random Forest Model.</strong></blockquote><p>a. Encode the target features as factors.</p><p>b. Split the dataset into 6 tree groups and split each group into training and testing sets.</p><p>c. Fit the random forest classification to the training set for 6 trees. X is the dependent variables, y is the results, ntree indicates the number of trees to grow resulting with 500 trees.</p><p>d. Visualize the results with prediction in binary format, generate the matrix and compare 6 different groups of data to determine the optimal decision tree.</p><blockquote><strong>Gradient Boosting Decision Trees (GBDT) Model.</strong></blockquote><p>a. Labels Encoding: Label Encoding transform values to become numbers between 0 and n-1, where n is the number of different labels.</p><p>b. Frequency Encoding: Frequency Encoding is a special case of Label Encoding. Feature values are encoded based on the frequency. Transformed values are numbers between 0 and m, where m is the number of values with a frequency greater or equal than 2.</p><h3>III/ Analysis &amp; Discussion:</h3><blockquote><strong>Logistic Regression Analysis:</strong></blockquote><p>The predicted formula can be constructed at a 95% confidence interval by the logistic regression to multiple predictors as follows:</p><blockquote><strong>Predicted logit of (HasDetections)</strong> = 0.7084 *Platformwindows8 + 0.9071*SkuEditionEduation + 0.9809*SkuEditionEnterprise + 1.366*SkuEditionHome + 2.108*SkuEditionInvalid + 0.933*SkuEditionPro + 0.3086*IsProtected + 0.1395*Wdft_IsGamer + 0.7202*AppVersion. (1)</blockquote><p>According to Equation 1, the log of the odds of the machine having infections was related to 9 features (p value &lt; 0.05). All features have a coefficient greater than 0, which suggests that these features enhance the probability of the machine getting infected. The feature IsProtected (whether each machine has any active anti-virus products) and Wdft_IsGamer (whether the user of each machine is a gamer) have the lowest p value, therefore these two features are most critical factors increasing the probability of the machine having infections.</p><p>The goodness-of-fit statistics assess the fit of a logistic model against actual outcomes (i.e., whether a machine has infections). Adjusted R-squared value is 0.028, suggesting around 2.8% of the observations can be explained by the model. The large AIC value (80695) and Residuals (59748) also show the inefficacy of the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*4EJhVa6a12oUVIWKa0ySiA.png" /><figcaption>Table 1: Confusion Matrix (Logistic Regression Model) (<em>Image by author</em>)</figcaption></figure><p><em>*1: the machine that was infected by the malware.</em></p><p><em>*0: the machine that was not infected by the malware.</em></p><p>A confusion matrix was adopted to evaluate the performance of the logistic regression model. Table 1 suggests that around half of the uninfected machine was predicted to be uninfected and about two-thirds of those infected were correctly classified by the logistic regression model. The overall success rate of the prediction was 58.07%. The Type I error (where the uninfected machines were falsely predicted) is relatively higher than Type II error (where the infected machines were falsely classified as uninfected) which defends the model in some ways since it is riskier to classify an infected machine as uninfected than the other way around.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*WIr2ddNVYlqGUo2tcTBhWw.jpeg" /><figcaption>Figure 1: Predicted Probability of the Outcome variable, HasDetections (<em>Image by author</em>)</figcaption></figure><p>The probability prediction plot shows the predicted probability of each machine having infected by malware along with the actual malware detection status. The Y-axis is the probability of having detections, and the X-axis is the probability of infection from the lowest to the highest value of 60,000 machines. The curve is relatively flat around the probability of 0.5, indicating that the prediction of the model is not efficient, which is consistent with the small R-squared value above.</p><blockquote><strong>Logistic Regression Analysis with LASSO Regularization Method:</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*krScixI_hV3k-1FchmDcvA.png" /><figcaption>Figure 2: Mean Squared Error Versus the Logit of (lambda). (<em>Image by author</em>)</figcaption></figure><p>From Plot 3, the value of the mean squared error has increased as lambda value increases, and first dash lines chose two lambda values for the regularization method. The smaller lambda leads to the minimum mean squared error and the lambda within one standard deviation that leads to the model with fewest features. The Lasso regularization process was applied with a lambda of 0.00265 to remove the redundant variables. The predicted formula was adjusted by adapting Lasso regularization method to the logistic regression model as follows:</p><blockquote>Predicted logit of (HasDetections) = 0.1017 *Platformwindows8 + 0.0843*IsProtected + 0.0169*Wdft_IsGamer</blockquote><p>Several features were shrunken to zero from Equation 1 to Equation 2. It was noticed that only three features show significance after Lasso regularization: the Platformwindows8 (the Windows 8 platform), IsProtected (whether any anti-virus products was on each machine) and Wdft_IsGamer (whether the user of each machine is a gamer). All these three features increase the risk of the machine getting infected by malware with a positive coefficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*JuOU7SXsXGsvXoVHS-ba9g.png" /><figcaption>Table 2: Confusion Matrix (Logistic Regression Model with Lasso Regularization method). (<em>Image by author</em>)</figcaption></figure><p>After performing the Lasso regularization method, the accuracy rate was improved by around 0.1% compared with the result from the simple logistic regression model shown in table 1. Whereas, the maximal R-squared value was generated to be around 0.039 which indicates the inefficacy of the model.</p><blockquote><strong>Random Forest Model:</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z-tlNU6CbCO04VvcMJXEbg.png" /><figcaption>Figure 3: Confusion Matrices (Random Forest Model). (<em>Image by author</em>)</figcaption></figure><p>In the Random Forest, the dataset was split up into 6 trees with slightly different numbers of inputs (500–1000 rows) in each tree to test whether size of the inputs actually affects the prediction rate. From Figure 3, it can be observed that Tree 1 with the lowest number of rows (4883 inputs) has the highest success rates at 57.04%. The higher the number of observations is, the lower the success rate is with Tree 6 (6265 inputs) which can only predict 55.91% of the test set successfully. As a result, the number of Type I error cases (wrongly classified the machine as infected one when it is actually not) are greater than Type II error (wrongly classified the infected machine) cases across all the trees, which reduces the severity of wrong predictions.</p><p>Figure 4 represents the actual detection status in the test set and the upper ones represent the predicted result. The confidence level was set lower to 0.45 and 0.475 and also it was set to be 0.55 in order to compare the result of the success rate. Using Tree 1 as the base for the optimization, success rates fluctuate as the Confidence level of area for malfunction changes. Nevertheless, the most optimized success rate (highest) is still the original Tree 1 with 57.04% success rate. Any confidence level above or below 0.5 decreases the success rate of the Random Forest prediction model. Thus, the confidence level was normally distributed between 0 and 1 with a mean of 0.5. However, the Type II error was reduced from the original Tree 1 (15.83%) to the Optimized 3 of Tree 1 (10.84%) with a threshold of 0.55. Therefore, the Optimized 3 case with a confidence level at 0.55 would be considered as a more useful decision tree with a 0.3% success rate reduction.</p><blockquote><strong>Gradient Boosting Decision Trees (GBDT) Model:</strong></blockquote><p>The dataset was randomly split into train set (70%) and test set (30%), with each set containing an approximately equal number of infected machines and uninfected machines. The train set was used to build the model so that the probability of test machine getting infected can be predicted (1 = Having Infections, 0 = Not Having Infections). A probability larger than 50% means the machine was predicted to be infected, and not infected with a probability lower than 50%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*Ra7miqSrJvLbM2yiZopE0w.png" /><figcaption>Table 3: Confusion matrix (GBDT Model with 60,000 observations). (<em>Image by author</em>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*EhPFxevHTWHinqdhg081UA.png" /><figcaption>Table 4: Precision, Recall Rate and F1 Score of GBDT Model (with 60,000 observations). (<em>Image by author</em>)</figcaption></figure><p>According to Table 3, 4555 out of 8841uninfected machines were correctly classified and, 3609 out of 8965 infected machines were correctly classified, the prediction accuracy was 55.66%. The precision and recall rate measures the performance of the prediction model with a higher proportion representing better performance and higher accuracy rate. Theoretically, the modification of the model aims to increase both the precision and recall rate but increasing the precision rate always leads to a lower recall rate, and vice versa. Thus, the combination of precision and recall rate, F1 score, was embraced to give a better evaluation of the model. From Table 4, the F1 score is less than 60% in each group of infected or uninfected machines, which indicates the model poorly explained the observations. Table 5: Confusion Matrix (GBDT Model with 100,000 observations).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*IntWPQzmBHIoKr4BlsU1qw.png" /><figcaption>Table 5: Confusion Matrix (GBDT Model with 100,000 observations). (<em>Image by author</em>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*ZMDFCyEFgb4j-3EE1Z-ojw.png" /><figcaption>Table 6: Precision, Recall Rate and F1 Score of GBDT Model (with 100,000 observations). (<em>Image by author</em>)</figcaption></figure><p>The GBDT model was adopted on a larger dataset with 100,000 observations and the accuracy rate was improved by approximately 2.68% shown in table 5. Also, F1 Score was higher than 55% for both infected and uninfected cases which confirms the better efficacy of the model with a larger amount of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pm0_ZTfZY17uj4F9ACen6w.png" /><figcaption>Figure 5: The importance of the features shown significant contribution (with 60,000 observations). (<em>Image by author</em>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZY4u7whMarBYu9gL3WqN5w.png" /><figcaption>Figure 6: The importance of the features shown significant contribution (with 100,000 observations). (<em>Image by author</em>)</figcaption></figure><p>The Gradient Boosting Decision Trees (GBDT) model generated the frequency of each feature used in the model fitting process and a feature with a higher frequency was considered to have higher importance. The bar charts were drawn for two GBDT models to visualize the impacts of those features on the probability of the machine getting infected. The top three features with highest importance from Figure 5 were CountryIdentifier (the country each machine was located in), LocaleEnglishNameIdentifier (the language code of the machine defined by Microsoft, i.e. English = 1033.) and GeoNameIdentifier (the geographic region the machine was located in) which all related to the location of the machine. Census_SystemVolumeTotalCapacity (the size of the system volume installed on the machine), CountryIdentifier (the country each machine was located in) and Census_OsBuildRevision (the latest version of the operating system on the machine, i.e. the latest version of Windows 10 =1909) appear to be the top three features with higher contribution. The importance of each feature has changed from Figure 5 to Figure 6 with different amount of observations. Whereas, there is no enough evidence to claim that those top three features in Figure 6 would give a precise prediction with a relatively low success rate.</p><h3>IV/ Conclusion &amp; Recommendations:</h3><p>From the results discussed above, it can be concluded that the Lasso logistic regression model is the best model of prediction for this dataset with the highest success rate of 58.18% while the random forest which believed to be one of the best models for classification machine learning, has the lowest success rate among all three models both before and after optimization. Also, the Gradient Boosting Decision Trees (GBDT) model was not a proper approach to predict the probability of each machine getting infected with a smaller accuracy rate (57.34%). R programming language was found to have limited performance handling with variables containing over 1000 unique values. In addition, the same process was done in Python for the GBDT model with more high-dimensional features which result in a higher accuracy rate of 62.02%.</p><p>Error probability during extraction. The observations used in this study were only around 6.7% of the whole dataset due to the limitation of the computers and R programming language, which makes the results hardly representative of the entire dataset. A larger sample was selected to optimize the GBDT model and it did improve the accuracy rate by 2.68%, which confirms the significance of the sample size. Although we extracted the dataset randomly with equal amounts of the infected and uninfected machines, there might still be other factors that might explain the final results, for instance, some properties of those machines might be recorded in a specific order.</p><p>Lack of transparency, confidentiality, and unexplainable features. Out of 83 original columns, only around half of them are chosen for this analysis. It is due to the fact that a lot of features are not clearly explained in detail, encoded, or even missing for all the observations. One of the examples is the Geographic features. All of the countries are encoded in a confidential way and the probability of the machine getting infected by the malware in each country cannot be studied as a result. Those Geographic features were excluded from the Random Forest prediction because they have more than 200 unique values for each variable and the RandomForest function can only assign 53.</p><p>For further study, researchers should execute these models using Python on computers with generous memory to utilize the whole dataset and focus on the features appearing to be significant in this analysis. It could be an alternative way to study those machines located in the same place or fixed one of the other features with a gargantuan number of categories to gain a more precision prediction result and different sets of observations could be selected to verify the significance of each property of the machines.</p><p><strong>Github</strong>: <a href="https://github.com/Lukastuong123/R-Projects/tree/master/Project-%20Microsoft%20Malware%20Prediction">https://github.com/Lukastuong123/R-Projects/tree/master/Project-%20Microsoft%20Malware%20Prediction</a></p><p><strong>References</strong>:</p><p>1. <strong>Bronshtein, A.</strong> (2019). Train/Test Split and Cross Validation in Python. Retrieved from <a href="https://towardsdatascience.com/train-test-split-and-cross-validation-in-python-80b61beca4b6">https://towardsdatascience.com/train-test-split-and-cross-validation-in-python-80b61beca4b6</a></p><p>2. <strong>Computing Classification Evaluation Metrics in R. (</strong>n.d.). Retrieved from <a href="https://blog.revolutionanalytics.com/2016/03/com_class_eval_metrics_r.html">https://blog.revolutionanalytics.com/2016/03/com_class_eval_metrics_r.html</a></p><p>3. <strong>Microsoft Malware Prediction.</strong> (n.d.). Retrieved from <a href="https://www.kaggle.com/c/microsoft-malware-prediction/data">https://www.kaggle.com/c/microsoft-malware-prediction/data</a></p><p>4.<strong> Microsoft Malware Prediction.</strong> (n.d.). Retrieved from <a href="https://www.kaggle.com/c/microsoft-malware-prediction/discussion/84065">https://www.kaggle.com/c/microsoft-malware-prediction/discussion/84065</a></p><p>5.<strong> Openspecs-Office.</strong> (n.d.). [MS-OE376]: Part 4 Section 7.6.2.39, LCID (Locale ID). Retrieved from <a href="https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a">https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a</a></p><p>6. <strong>Person.</strong> (2019). Rstudio, is it useable for large data sets (9gb )? Retrieved from <a href="https://community.rstudio.com/t/rstudio-is-it-useable-for-large-data-sets-9gb/21138/7">https://community.rstudio.com/t/rstudio-is-it-useable-for-large-data-sets-9gb/21138/7</a></p><p>7. <strong>Yurtoğlu, N.</strong> (2018). <a href="http://www.historystudies.net/dergi//birinci-dunya-savasinda-bir-asayis-sorunu-sebinkarahisar-ermeni-isyani20181092a4a8f.pdf.">http://www.historystudies.net/dergi//birinci-dunya-savasinda-bir-asayis-sorunu-sebinkarahisar-ermeni-isyani20181092a4a8f.pdf.</a> History Studies International Journal of History, 10(7), 241–264. doi: 10.9737/hist.2018.658</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46bf5355f930" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/microsoft-malware-detections-r-classification-46bf5355f930">Microsoft Malware Detections (R- Classification)</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning Classification Project: Finding Annual Income (Python)]]></title>
            <link>https://medium.com/analytics-vidhya/machine-learning-classification-project-finding-annual-income-python-66eba44ade53?source=rss-b2f843da19c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/66eba44ade53</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[classification]]></category>
            <dc:creator><![CDATA[Lukas Tuong]]></dc:creator>
            <pubDate>Mon, 11 May 2020 22:16:49 GMT</pubDate>
            <atom:updated>2020-06-09T17:31:43.982Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Finding Annual Income (Python- Classification)</strong></h3><h4>Built a Machine Learning model to accurately predict where an individual s’ earning is more or less than 50,000 though KNN, Nave Bayes, Decision Tree, Random Forests, GLM Logistic Regression. Packages that I used are panda, numpy, matplotlib, sklearn.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*oja3YY5DZJEX_6daoLAa1w.jpeg" /><figcaption>Source: Internet</figcaption></figure><p>The recent coronavirus outbreak has seen a tremendous amount of people who signed up for the stimulus checks of $1200 in America after losing their jobs. One of the requisites for the recipients is to have their annual incomes less than $75,000, which is all accessible through their annual tax report. (Singletary, 2020) Nonetheless, there is a staggering amount of people who have not done their taxes. Understanding the potential annual income of unfiled taxes individuals can help the government to make strategic steps in taking care of them and ensuring the size of their bank reserve. Thus, the government would benefit tremendously from a machine learning model that can help predict an individual’s income base on their demographic features.</p><p>In this project, we will use five different supervised algorithms (KNN, Naïve Bayes, Decision Tree and Rules, Random Forests, GLM &amp; Logistic Regression.) on the dataset from the 1994 US Census. We will select the best candidate algorithms when comparing the preliminary results with each other and further optimize the chosen algorithm to best model the data. Our goal with this project is to finally come up with the model that can accurately predict whether an individual earns more or less than $50,000 (Classification- binary class). According to the Inflationcalcualtor.com, $50,000 in 1994 equals to $87,000 in 2019. Then after that, future researchers can use this model to apply for the current year’s dataset.</p><p>The dataset for this project comes can be accessed from the UCI Machine Learning Repository or Kaggle website. The dataset is donated thanks to Ron Koshavi and Barry Becker after they published their findings in<em> “Scaling Up the Accuracy of Naive-Bayes Classifiers: A Decision-Tree Hybrid”</em> (Kohavi, 1996). Bearing in mind the fact that the data we are studying here consists of small changes to the original dataset like removing the &#39;fnlwgt&#39; feature and records with missing or ill-formatted entries.</p><h4>Data</h4><p>The changed census dataset in this project has approximately 32,000 entry points, with each entry points having 13 features.</p><h4><strong>Features</strong></h4><p>· age: Age</p><p>· workclass: Working Class (Private, Self-emp-not-inc, Self-emp-inc, Federal-gov, Local-gov, State-gov, Without-pay, Never-worked)</p><p>· education_level: Level of Education (Bachelors, Some-college, 11th, HS-grad, Prof-school, Assoc-acdm, Assoc-voc, 9th, 7th-8th, 12th, Masters, 1st-4th, 10th, Doctorate, 5th-6th, Preschool)</p><p>· education-num: Number of educational years completed</p><p>· marital-status: Marital status (Married-civ-spouse, Divorced, Never-married, Separated, Widowed, Married-spouse-absent, Married-AF-spouse)</p><p>· occupation: Work Occupation (Tech-support, Craft-repair, Other-service, Sales, Exec-managerial, Prof-specialty, Handlers-cleaners, Machine-op-inspct, Adm-clerical, Farming-fishing, Transport-moving, Priv-house-serv, Protective-serv, Armed-Forces)</p><p>· relationship: Relationship Status (Wife, Own-child, Husband, Not-in-family, Other-relative, Unmarried)</p><p>· race: Race (White, Asian-Pac-Islander, Amer-Indian-Eskimo, Other, Black)</p><p>· sex: Sex (Female, Male)</p><p>· capital-gain: Monetary Capital Gains</p><p>· capital-loss: Monetary Capital Losses</p><p>· hours-per-week: Average Hours Per Week Worked</p><p>· native-country: Native Country (United-States, Cambodia, England, Puerto-Rico, Canada, Germany, Outlying-US(Guam-USVI-etc), India, Japan, Greece, South, China, Cuba, Iran, Honduras, Philippines, Italy, Poland, Jamaica, Vietnam, Mexico, Portugal, Ireland, France, Dominican-Republic, Laos, Ecuador, Taiwan, Haiti, Columbia, Hungary, Guatemala, Nicaragua, Scotland, Thailand, Yugoslavia, El-Salvador, Trinadad&amp;Tobago, Peru, Hong, Holand-Netherlands)</p><h4><strong>Target Variable</strong></h4><p>· income: Income Class (&lt;=50K, &gt;50K)</p><h4>Import Libraries and Load Data</h4><p>We will first import the dataset as well as the necessary Python libraries that are useful for our analysis like numpy, pandas, IPython, matplolib, seaborn, visuals file. The last column of the dataset is the final ‘income’ binary outcome and the rest are features</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ekOGeFZDzsEi7UI7e00HXQ.png" /><figcaption>Image by author</figcaption></figure><h3><strong>I/ Exploratory Data Analysis(EDA) and data preparation</strong></h3><p>We explore our dataset a little bit to see how many individuals fit in each group and the percentage of citizens that earn more than $50,000 annually. We can also have the visual views of the dataset to see how each factor interact with each other through seasborn.pairplot() function</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*A5kK_-e6m5EQDfBsgSvmjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*qMGqcPzC3qxo_SfYDgeh9w.png" /><figcaption>Image by author</figcaption></figure><p>Data must be prepared in order to be accepted in the Machine Learning algorithms. If not, the model will make incorrect predictions. This process includes cleansing, formatting, and feature scaling of the data.</p><p>1/ The first step is to transform skewed continuous features. It is due to the fact that skewed distributions on the features’ values can make an algorithm to underperform if the range is not normalized. We split the data into features and target labels. Then we visualized skewed continuous of original data. The income dataset has two features with skewed distribution:</p><ul><li>‘capital-gain’</li><li>‘capital-loss’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*002lZ7JCIW06Lz314wr4-g.png" /><figcaption>Image by author</figcaption></figure><p>The features’ distribution skewed to the right. Therefore, we apply the logarithmic transformation on the data to prevent outliners from having negative impacts on the machine learning model later on. Nevertheless, one must be careful in treating the o values since the log(o) is undefined. We can translate these values into small amounts above o so as to apply the logarithm well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*5zxQQUkCFzXfJwH3I1jMlQ.png" /><figcaption>Image by author</figcaption></figure><p>2/ The second step is to normalize numerical features through data scaling. This scaling will not ultimately change the shape of the distributions of the features but it makes sure that there is an equal treatment to every single feature when the five models are applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDlZ4PLt6P4H6SL9tNlaKw.png" /><figcaption>Image by author</figcaption></figure><p>3/<strong> </strong>The third step is to turn categorical factors like ‘’occupation’ or ‘race ‘into numerical ones using the one-hot encoding function. By doing so, the algorithm will create ‘dummy’ variable for each possible category of the categorical features which are similar to the numerical features. However, one-hot-encoder is not suitable for the target suitable because it is a complicated procedure, thus we will manually assign ‘&lt;=50k ‘ as 0 and ’&gt;50k’ as 1 to avoid unexpected fallout at the end. From 13 unique features, the dataset was tuned into 103 total features thanks to one-hot encoding function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*FMMh_1SMjmNmYYg9Bdp5QQ.png" /><figcaption>Image by author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*sae_wZBsq5qWQRxvV1HPpg.png" /></figure><p>4/<strong> </strong>The fourth step is to shuffle and split dataset with 80–20 ratio for training the testing, respectively</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*QDeJ1p-6cT9eycGAfJjHbw.png" /><figcaption>Image by author</figcaption></figure><h3><strong>II/ Building the Predictive models</strong></h3><p>Considering the shape of our data (30162 data points with 103 unique factors), we are fortunate enough that all the models that we choose can handle the significant amount of factors appropriately. To access each model correctly, we will compare each model’s strengths and weaknesses</p><blockquote><strong>a) K-Nearest Neighbor Algorithm</strong></blockquote><p>· <strong>Strengths</strong>: It is simple with no training period (known as Lazy Learner). Researchers can add new data seamlessly without affecting the accuracy of the algorithm</p><p>· <strong>Weaknesses</strong>: KNN is incompatible with datasets that are large or have high dimensions. The model also needs feature scaling and is highly sensitive to noisy data, missing values as well as outliners. (Kumar, 2019)</p><p>· <strong>Potential Application:</strong> search applications for ‘’similar’ items</p><blockquote><strong>b) Gaussian Naive Bayes</strong></blockquote><p>· <strong>Strengths</strong>: One of the easiest and fastest classifiers that provide good results with little tunning of the model’s hyperparameters. Additionally, it does not require a large amount of data to be effectively trained.</p><p>· <strong>Weaknesses</strong>: The model makes a greatly strong assumption about the shape of the data distribution. It also suffers from data scarcity and continuous problems which can render the entire prediction inaccurate. Generally advised against using it for Classification problem</p><p>· <strong>Potential Application:</strong> natural language processing (text learning)</p><blockquote><strong>c) Decision Tree</strong></blockquote><p>· <strong>Strengths</strong>: The process has understandable rules and can perform classification without much computation. It can handle both continuous and categorical variables and provides the researchers with a clear indication of which features are important. (Geeksforgeeks, 2019)</p><p>· <strong>Weaknesses</strong>: Continuous attributes might not be most suitable for the model. It can prone to errors with many classes and a relatively small number of training examples and is quite costly to train.</p><p>· <strong>Potential Application: </strong>image classification for animals</p><blockquote><strong>d) Random Forests</strong></blockquote><p>· <strong>Strengths</strong>: Very suitable for the Classification problem because it is an ensemble of decision trees. Random Forest is also suitable with high dimensional spaces and a large number of training examples</p><p>· <strong>Weaknesses</strong>: it may overfit when dealing with noisy data</p><p>· <strong>Potential Application: </strong>stock market price prediction</p><blockquote><strong>e) GLM and Logistic Regression</strong></blockquote><p>· <strong>Strengths</strong>: The response variable can have any form of exponential distribution type and GLM can deal with categorical factors. It is relatively easy to interpret the results and less susceptible to overfitting</p><p>· <strong>Weaknesses</strong>: It requires a quite large dataset. The more predictor factor it has, the larger the sample size. GLM is sensitive to outliners</p><p>· <strong>Potential Application: </strong>predicting medical expense</p><h3><strong>III/ Predictive models comparison and model optimization</strong></h3><blockquote><strong>a) Models comparison</strong></blockquote><p>After acknowledging all the strengths and weaknesses of the five models, we move on to the results comparison and chosen model’s optimization process. When making a prediction on events, we can get four types of results: True Positives (TP),<em> </em>True Negatives(TN), False Positives (FP- Type 1 error) and False Negatives (FN- Type 2 error)<em> </em>In general, there are four metrics to judge the model’s performance based on the aforementioned types of results:</p><p><strong>· Accuracy:</strong> measures how accurate the predictions are compared to the real result.</p><p><strong>· Precision:</strong> informs us what percentage of events we correctly classified as a certain class.</p><p><strong>· Recall (Sensitivity):</strong> informs us what percentage of events that actually were of a certain class were classified by us as that class.</p><p><strong>· F1 score:</strong> indicates the weighted average of the precision and recall scores which is the weighted average(harmonic mean) of the precision and recall scores</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*H0fPFLaJpKTbvrcUcPW4nQ.png" /><figcaption>Source: Wikipedia</figcaption></figure><p>Due to the fact that our dataset is a classification problem that has some skewed distributions in the factors, accuracy itself is not an appropriate metric. Instead, we will look for precision and recall figures. Furthermore, since we are searching individuals that deserved stimulus check handout, the model’s ability to precisely predict those that make more than $50,000 is more important than the model’s ability to recall those individuals</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*XBTWwSnrQ4LVAB_xHDHDDw.png" /><figcaption>Image by author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5CALdIhgbU1OhYO3yAh8Q.png" /><figcaption>Image by author</figcaption></figure><p>According to the table and graph above, Random Forest and Logistic Regression have the greatest precision and recall scores. Despite having a higher precision score, Random Forest ‘s performance is nearly similar to the Logistic Regression’s. It would be much better for us to improve the models and compare one more time again before making the final decision. On the other hand, one of the reasons why we have low scores for Naive Bayes Model is because the model suffers from Zero Frequency problem where the model will assign a 0(zero) probability and does not make a prediction if the categorical variable has a category that was not observed in training data set. Another issue we have with Naive Bayes is the assumption of independent predictors. Thus, we end up with abysmal results for Naive Bayes. Below is the Illustration of the Decision Tree</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gdi1OknbXabzpYTQnHGPbQ.png" /><figcaption>Image by author</figcaption></figure><p>We will try to have how feature selections affect the performances of these two models and apply the K-fold Cross-Validation with different parameters and Grid search to find the best model with the best parameters.</p><blockquote><strong>b) Models optimization</strong></blockquote><p><strong>Features selection</strong></p><p>An important task when performing supervised learning on a dataset like this one is investigating the degree of impact the factors have on the final predictive performance. By distilling the relationships to only between only a few crucial features and the target variable, we can subsequently eliminate the noise. There are 13 features available on the original dataset and we want to cut them down to half. Intuitively, we will select factors like age, education, native country, occupations, and work hours per week because they are usually the best indicators of an individual’s financial situation. Then, we check the accuracy of our logic by using the AdaBoostClassifier classifier to plot the graph below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*hO712UffAJ_U0TehLUX-Zw.png" /><figcaption>Image by author</figcaption></figure><p>Our intuition is partially accurate since age; hours per week and education leave a tremendous impact on the financial situation of a working person. Surprisingly, we failed to identify the importance of the “capital gain” and “capital loss”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*8-Oj4tqU6PCRcO_qTPUQWg.png" /><figcaption>Image by author</figcaption></figure><p>After re-performing the Random Forest and Logistic Regression, we witnessed a fall in both accuracy and F-score on the reduced data than the original dataset across two Predictive models. Considering the metrics obtained in the evaluations of the original model on the reduced datasets, the best option would be to keep using the original dataset versions as they yield a good combination of accuracy and F-score.</p><p><strong>K-Fold Cross-Validation and Grid search</strong></p><p>In this step, we used the Cross-validation (rotation estimation) method to validate the model’s techniques by splitting the dataset into many folds and cross-test the result on it. (Brownlee, 2019) The ‘estimator’ parameter indicates the object that you used to fit the model (Classifier for Random Forest and Logistic Regression) while ‘cv’ verified how many folds you want to split the training set into (usually 10). Then we compute the mean and standard deviations of 10 different accuracies based on 10 small dataset samples and compare it with each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*KefUCvdJjQckD63PXZH-4g.png" /><figcaption>Image by author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*sn5G5cJ0Nv7OxWp25qosgg.png" /><figcaption>Image by author</figcaption></figure><p>The Mean and Standard deviation of these two models after Cross-Validation are identical to each other. It is safe to say that whichever model we pick between these two will not make much of a difference. Thus, we can perform the Grid Search solely on the Random Forest Model to choose the best parameters that could yield the highest possible accuracies. ‘n_estimators’ has the options between 10, 30, 100, 300 while ‘criterion’ has the options between ‘entropy’ and ‘gini’ model</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*eK_aTUSIlJC0YfgSmQ9Msg.png" /><figcaption>Image by author</figcaption></figure><p>Finally, the most optimal model that could yield 0.844 accuracy score is Random Forest with ‘criterion’ = ‘entropy’, ‘n_estimators’ =’300’</p><h3><strong>IV/ Conclusion</strong></h3><p>This project allowed us to not only have accurate predictions about the annual earning for each individual but also to understand each model’s strengths and weaknesses when it comes to classification. Future researchers are advised to further improve the models and adapt them accordingly to fit the requirement of the problem</p><p><strong>Github: </strong><a href="https://github.com/Lukastuong123/Python-Projects/tree/master/Project-%20Finding%20Annual%20Income%20(Python-%20Classification)">https://github.com/Lukastuong123/Python-Projects/tree/master/Project-%20Finding%20Annual%20Income%20(Python-%20Classification)</a></p><h3><strong>Reference &amp; Sources:</strong></h3><p><strong>Brownlee, J.</strong> (2019). A Gentle Introduction to k-fold Cross-Validation. Retrieved from <a href="https://machinelearningmastery.com/k-fold-cross-validation/">https://machinelearningmastery.com/k-fold-cross-validation/</a></p><p><strong>Geeksforgeeks. </strong>(2019, April 17). Decision Tree. Retrieved from <a href="https://www.geeksforgeeks.org/decision-tree/">https://www.geeksforgeeks.org/decision-tree/</a></p><p><strong>Kohavi , R. </strong>(1996). Scaling up the accuracy of Naive-Bayes classifiers: a decision-tree hybrid. <em>KDD’96: Proceedings of the Second International Conference on Knowledge Discovery and Data Mining</em>, <em>8</em>, 202–207. Retrieved from <a href="https://www.aaai.org/Papers/KDD/1996/KDD96-033.pd">https://www.aaai.org/Papers/KDD/1996/KDD96-033.pd</a></p><p><strong>Kumar, N.</strong> (2019). Advantages and Disadvantages of KNN Algorithm in Machine Learning. Retrieved from <a href="http://theprofessionalspoint.blogspot.com/2019/02/advantages-and-disadvantages-of-knn.html">http://theprofessionalspoint.blogspot.com/2019/02/advantages-and-disadvantages-of-knn.html</a></p><p><strong>Singletary , M.</strong> (2020). Still waiting for your stimulus check? You have until 12 p.m. Wednesday to give the IRS your bank information. Retrieved from <a href="https://www.washingtonpost.com/gdpr-consent/?next_url=https%3a%2f%2fwww.washingtonpost.com%2fbusiness%2f2020%2f05%2f11%2fstill-waiting-your-stimulus-check-you-have-until-12-pm-wednesday-give-irs-your-bank-information%2f">https://www.washingtonpost.com/gdpr-consent/?next_url=https%3a%2f%2fwww.washingtonpost.com%2fbusiness%2f2020%2f05%2f11%2fstill-waiting-your-stimulus-check-you-have-until-12-pm-wednesday-give-irs-your-bank-information%2f</a></p><p><strong>UCI Machine Learning repository </strong><a href="https://archive.ics.uci.edu/ml/datasets/Census+Income">https://archive.ics.uci.edu/ml/datasets/Census+Income</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66eba44ade53" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/machine-learning-classification-project-finding-annual-income-python-66eba44ade53">Machine Learning Classification Project: Finding Annual Income (Python)</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Diversity and the journey for an identity]]></title>
            <link>https://medium.com/@tuonggreenager/diversity-and-the-journey-for-an-identity-59bf90a1349c?source=rss-b2f843da19c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/59bf90a1349c</guid>
            <category><![CDATA[identity]]></category>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[aiesec]]></category>
            <dc:creator><![CDATA[Lukas Tuong]]></dc:creator>
            <pubDate>Mon, 21 Sep 2015 11:42:37 GMT</pubDate>
            <atom:updated>2015-09-30T19:04:35.499Z</atom:updated>
            <content:encoded><![CDATA[<p>21 September 2015</p><p>Nowadays, the hustle lifestyle of the cooperated world has demanded us to stereotype, not only an action’s motive, an individual but also a country’s culture without any consideration. We firmly believe in what the social media is feeding us and neglecting the voices of those, who matter at the same time. Nothing, it seemed, could break through this belligerent disconnection. Eventually, we cope with the system which was designed not to be questioned, to eliminate critical thinking. Consequently, young generation often suffers from global misconception and identity crisis as I was once before. Finally, the result is endless conflicts and distrust around the world.</p><p>Determined to embark on an identity discovering journey, I signed up for Global citizen program and decided that China is the ultimate destination for me that summer. Owning to its richness in cultural, economic and educational ideologies. Notwithstanding, this journey to the east shifted my perspective about human’s connection and the world more than I had ever imagined before. 16 countries- 28 individuals with 28 different characteristics, but we treated each other like a family.</p><p>From the beginning, Cultural Discussion was the most important part of this project. It allowed all the members to unfold the splendidness of the Chinese civilization. Additionally, showcasing our unique cultures through presentations about multiple aspects: education, cuisine, folk talks, etc. was also a part of the activity. I recalled so many sleepless nights to finish my presentations filled with intriguing images with music and videos. Countless moments of surrender I considered, but what kept me holding on was the enthusiasm of the listener while I was telling the story of another Vietnam. A Vietnam in the era of transformation, a Vietnam with its amicable citizens that are opened to difference. At the end, overjoyed I felt when Susana- the Mexican intern, told me: “You know that Utkarsh almost cried when you are onstage with Bella (my Vietnamese fellow) performing the traditional song. I will you definitely visit your country, I promise, Lukie”. Looking back, being caught up in the Swiss rat race, I feel disconnected from my country. Nonetheless, AIESEC’s experience has helped me to acknowledge myself as a nationalist, a stereotype breaker. My love for Vietnam has always been there all along despite all obstacles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xacOtlCD4Zrbeh5CeUmRoA.jpeg" /><figcaption>The activities ranged from Kungfu practice to characters writing, traditional food making, puppet controlling and historical building visits</figcaption></figure><p>Then, an event happened that changed my mindset about patriotism forever. That was when Alaa- an Egyptian, gave a captivating speech about his beloved nation in which he identified the irony of the current economic situation. Additionally, he also mentioned the celebration of Arab Spring revolutionary protests. From a Facebook event, it became a phenomenon in North African and Middle East countries. Thousands and thousands people marched on the streets to demand for changes and democracy. Even though the result was not as triumphal as expected, in that sacred moment, being moved by the bravery and indomitability of the army, he was truly honored to have the nation’s blood running through his body. The sincere of the presentation held the audience spellbound and enabled me to truly understand the meaning of a paragraph that I once read: “It is easy to love a country nourished in privilege but it is the hardship that tests the man’s heart.” After that, Alaa told me that the conversation he had with me and Utkarsh had rescued him from relentless negative assumption: “No one will ever be listening to my speech”. He thanked me for inspiring him to craft such a compelling presentation, raise his voice and impact others. It was then I realized I can be the positive influence for someone to make a difference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_Jbr8bxmGpc4R_A0_GUUA.jpeg" /><figcaption>Everybody in their traditional customs presenting our countries in the Ningbo museum with local residences</figcaption></figure><p>During this trip, we had the privilege to teach English to primary students. I tried my best to be the most energetic, humorous teacher for the children so that they can see learning English as an exciting process rather than an obligation. Furthermore, me and Chan- my Malaysian friend, spent most of the nightspracticing the cup song. The following day’s party was a 3-hour of laughing, dancing and singing together celebration. Pleased by our great effort, the English center’s president gave each one of us a box of traditional “Rock Tea” and wishing us well on the way back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EsLZKpst2l4eqFFJPQpAig.jpeg" /><figcaption>Teaching English to primary children in the weekend</figcaption></figure><p>Incredible was the teaching experience, it also provoked the missing feeling inside me since all of us were separated into different location. Flashbacks of the cherished memories flew, faces of the loved ones emerged while travelling back to dormitory. I remembered the night as I witnessed that simple human connection when everybody gathered in the hallway of the hotel; conceded our weaknesses, fears and vulnerability. At that moment, streaming down my face was the gratefulness that destiny brought us here. It surprised me of how many times I just kept falling in love with each and every single one of them the way I did. I discovered another part of me, the caring part for the ones who truly matter. Even now, each member lives in the different part of the world, I can feel like they are here, with me, in my heart, always…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Os-Jdq1eOjDdZv5THqghmQ.jpeg" /><figcaption>27 inspiring and talented individuals with the devoted OCs team from this project</figcaption></figure><p>At the end of the volunteering experience, I finally realized what AIESEC’s “Global citizen” really means. For me, it describes an individual who places his identity with the “global community” above the national identity regardless of geographical or political borders. He creates cultural dialog with people across the globe to discover beauties in diversity. Last but not least, he must constantly enrich his knowledge in every aspects of life to find solutions for a better future.</p><blockquote><strong>A future where the value of someone‘s lives is not determined by any other than the fact they have lungs. A place where every single one of us can breaths…</strong></blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fq30t0MeNAnA%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dq30t0MeNAnA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fq30t0MeNAnA%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1988131cb0f6725f733765fe8d7d2ed6/href">https://medium.com/media/1988131cb0f6725f733765fe8d7d2ed6/href</a></iframe><p>So, what have I have been doing so far?</p><p>During the 2 weeks back in Vietnam, with the experience I gained, I was selected to be the delegate of Germany in the UNSC (United Nations Security Council) in the national VYMUN 2015 . Hours and hours of heated discussion and debate was provoked among the most intelligent students across Vietnam regarding topic: Globalization, the solutions to worldwide terrorism. I was able to express my idea and learn how to conduct the most beneficial resolution for every country. In addition, I drew out the conclusion that: most terrorists’ group radical brainwash systems is operate on identity-crisis, spiritual relive and community belonging. Since most of the targeted victims do not have a proper education or happy childhood, hence, ensuring a well- cared program for all the citizen is the solid foundation. As Mr. Ban Ki Moon- minister of Foreign Affair and Trade said that: “It is time to invest in young people as peace-builders”. Because of AIESEC, I perceived the world not only through the lens of social media but also though the lens of humanity and benevolence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*0IghyU4Vl8eqCf2NS8edaQ.jpeg" /></figure><p>Returning back to my own university, I proposed the idea of introducing the Global citizen program from to all the students. The counselor advised me incorporate the program with the Geopolitics classes. Words spread like fire. With help from AIESEC Lausanne and Fribourg team, we were able to establish a workshop for the interested students. At the workshop, I was encouraged to share my volunteer story in China: the lessons I learnt, the challenges we overcame. I explained how serving too much food on the table is a caring gesture for their guests rather than a negative habit like most of the students thought before. As a stereotype breaker, I used my words to fight against China’s misconception, as well as how we can go from acknowledging inner yourself, your capacity to changing the world</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wrQAOudb6G_7pkXqQK-C3g.jpeg" /></figure><p>Looking back, the emotional roller-coaster of emotion with AIESEC, MUN and TED has truly shaped me to become who I am today. Often, I find myself lost in train of thoughts and memories. I know I am not the only one, but we eventually have to move on and accept the reality. At the end, I had the answer that I have been craving for from the beginning: I am the canvas of the people who I met, the community where I made the impact on, and a country’s culture which I am in love with. A patriot, a passion igniter, an emotional individual, a peace builder and last but not least- a story teller. I am one and I am many. “I AM DIVERSITY” …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*EzZIv37yuN34kBmXjuobtg.jpeg" /><figcaption>MY AIESEC UNNC and me</figcaption></figure><blockquote><strong>This is an AIESEC experience</strong></blockquote><blockquote><strong>This a the story for an identity</strong></blockquote><blockquote><strong>How about you, what is your story?</strong></blockquote><p>Credit: All the amazing pictures and video were captured by Patricia Chong, Joyce Cui, Richie Ginigy Lychee</p><p><em>“This story was written in contribution to the </em><a href="https://medium.com/aiesec-world-peace-series/aiesec-world-peace-series-how-everyday-leaders-can-change-the-world-8e53f0f41249"><em>AIESEC Everyday Leader Series</em></a><em>, that showcases stories of everyday leaders who are changing the world. Share your story with the world</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59bf90a1349c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>