<?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 Michael Wy Ong on Medium]]></title>
        <description><![CDATA[Stories by Michael Wy Ong on Medium]]></description>
        <link>https://medium.com/@michael.wy.ong?source=rss-a0e35e3daa9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0LRFYT4ddjJAjbU01skh_g.jpeg</url>
            <title>Stories by Michael Wy Ong on Medium</title>
            <link>https://medium.com/@michael.wy.ong?source=rss-a0e35e3daa9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 10:19:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@michael.wy.ong/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[Introduction to Bar Chart Race — Analysis of top badminton players over the years]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/analytics-vidhya/introduction-to-bar-chart-race-analysis-of-top-badminton-players-over-the-years-81dbe04b0b01?source=rss-a0e35e3daa9------2"><img src="https://cdn-images-1.medium.com/max/991/1*LA2yPbTUvmFjkUq4ZbVHeQ.gif" width="991"></a></p><p class="medium-feed-snippet">This article walks through the use of API to extract longitudinal dataset of top ranked badminton players over the years, followed by the&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/analytics-vidhya/introduction-to-bar-chart-race-analysis-of-top-badminton-players-over-the-years-81dbe04b0b01?source=rss-a0e35e3daa9------2">Continue reading on Analytics Vidhya »</a></p></div>]]></description>
            <link>https://medium.com/analytics-vidhya/introduction-to-bar-chart-race-analysis-of-top-badminton-players-over-the-years-81dbe04b0b01?source=rss-a0e35e3daa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/81dbe04b0b01</guid>
            <category><![CDATA[badminton]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[bar-chart-race]]></category>
            <category><![CDATA[coding-language-race]]></category>
            <category><![CDATA[animated-bar-chart]]></category>
            <dc:creator><![CDATA[Michael Wy Ong]]></dc:creator>
            <pubDate>Tue, 23 Apr 2024 12:38:41 GMT</pubDate>
            <atom:updated>2024-04-23T12:38:41.620Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Fire sale for private residential projects in 2024?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/analytics-vidhya/fire-sale-for-private-residential-projects-in-2024-a57a3ffa9fa0?source=rss-a0e35e3daa9------2"><img src="https://cdn-images-1.medium.com/max/971/1*7X_S4Hwd5WqoiGyoLkMapw.png" width="971"></a></p><p class="medium-feed-snippet">This 2 part series analysis seek to validate a common perception that there could be a fire sale for newly built condos given the dampened&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/analytics-vidhya/fire-sale-for-private-residential-projects-in-2024-a57a3ffa9fa0?source=rss-a0e35e3daa9------2">Continue reading on Analytics Vidhya »</a></p></div>]]></description>
            <link>https://medium.com/analytics-vidhya/fire-sale-for-private-residential-projects-in-2024-a57a3ffa9fa0?source=rss-a0e35e3daa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a57a3ffa9fa0</guid>
            <category><![CDATA[housing-prices]]></category>
            <category><![CDATA[housing-market-trends]]></category>
            <category><![CDATA[singapore-property]]></category>
            <category><![CDATA[fire-sale-condo]]></category>
            <category><![CDATA[residential-property]]></category>
            <dc:creator><![CDATA[Michael Wy Ong]]></dc:creator>
            <pubDate>Tue, 16 Apr 2024 15:41:06 GMT</pubDate>
            <atom:updated>2024-04-16T15:41:06.550Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Webscrape from online shopping retailer — John Lewis (Part I)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/analytics-vidhya/webscrape-from-online-shopping-retailer-john-lewis-part-i-96de3a9dbed1?source=rss-a0e35e3daa9------2"><img src="https://cdn-images-1.medium.com/max/1096/1*N6jhTd5U_qzDDxtZcMM2PA.png" width="1096"></a></p><p class="medium-feed-snippet">Imagine having a bot that automatically search through a shopping website and provide a daily email update on any newly listed items or&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/analytics-vidhya/webscrape-from-online-shopping-retailer-john-lewis-part-i-96de3a9dbed1?source=rss-a0e35e3daa9------2">Continue reading on Analytics Vidhya »</a></p></div>]]></description>
            <link>https://medium.com/analytics-vidhya/webscrape-from-online-shopping-retailer-john-lewis-part-i-96de3a9dbed1?source=rss-a0e35e3daa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/96de3a9dbed1</guid>
            <category><![CDATA[shopping]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[beautifulsoup]]></category>
            <category><![CDATA[alerts]]></category>
            <category><![CDATA[automation-tools]]></category>
            <dc:creator><![CDATA[Michael Wy Ong]]></dc:creator>
            <pubDate>Fri, 09 Oct 2020 09:59:41 GMT</pubDate>
            <atom:updated>2020-10-11T04:39:56.294Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Singapore Housing Prices ML Prediction — Analyse Singapore’s Property Price (Part III)]]></title>
            <link>https://medium.com/analytics-vidhya/singapore-housing-prices-ml-prediction-analyse-singapores-property-price-part-iii-bd9438077423?source=rss-a0e35e3daa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd9438077423</guid>
            <category><![CDATA[predictive-analytics]]></category>
            <category><![CDATA[predictive-modeling]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[sklearn]]></category>
            <category><![CDATA[housing-prices]]></category>
            <dc:creator><![CDATA[Michael Wy Ong]]></dc:creator>
            <pubDate>Mon, 07 Sep 2020 04:46:14 GMT</pubDate>
            <atom:updated>2020-09-07T08:12:20.505Z</atom:updated>
            <content:encoded><![CDATA[<h3>Predictive modelling of Singapore Housing Prices — Analyse Singapore’s Property Price (Part III)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*epBB_tpieAgBJx4ljVT2lg.png" /></figure><blockquote>In <a href="https://medium.com/@michael.wy.ong/web-scrape-geospatial-data-analyse-singapores-property-price-part-i-276caba320b">part I </a>of this series on Singapore’s housing prices, I have focused on the extraction of additional information and create new distance-related variables that may have an impact on housing prices. In <a href="https://medium.com/analytics-vidhya/geospatial-data-visualisation-with-plotly-analyse-singapores-property-price-part-ii-eb4f8eb24d05">part II</a>, using data visualisation, I have showed that the proximity of flats to amenities, especially transport, food centres and top schools, have a significant impact on the housing prices.</blockquote><blockquote>In this final part, I will share some popular machine learning algorithms to predict the housing prices and the live model that I have built. My objective is to find a model that can generate a high accuracy of the housing prices, based on the available dataset, such that given a new property and with the required information, we will know whether the property is over or under-valued.</blockquote><h3>Brief introduction of the machine learning algorithms used</h3><p>I explore 5 machine learning algorithms that are used to predict the housing prices in Singapore, namely multi-linear regression, lasso, ridge, decision tree and neural network.</p><p>Multi-linear regression model, as its name suggest, is a widely used model that assumes linearity between the independent variables and dependent variable (price). This will be my baseline model for comparison.</p><p>Lasso and ridge are models to reduce model complexity and overfitting when there are too many parameters. For example, the lasso model will effectively shrink some of the variables, such that it only takes into account some of the important factors. While there are only 17 variables, in the dataset and the number of variables may not be considered extensive, it will still be a good exercise to analyse the effectiveness of these models.</p><p>Decision tree is an easily understandable model which uses a set of binary rules to achieve the target value. This is extremely useful for decision making as a tree diagram can be plotted to aid in understanding the importance of each variable (the higher the variable in the tree, the more important the variable).</p><p>Last, I have also explored a simple multi-layer perceptron neural network model. Simply put, the data inputs is put through a few layers of “filters” (feed forward hidden layers) and the model learns how to minimise the loss function by changing the values in the “filters” matrices.</p><h3>Dataset overview</h3><p>There are 17 independent variables that are obtained from the dataset, with almost 1/3 of the variables linked to the characteristic of the flat, such as floor area, location, years of lease left etc. The other variables are related to distances of the flat to amenities as well as the neighbourhood’s crime rates.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d6ad36c6c2074e7508f3b7d6177584b/href">https://medium.com/media/2d6ad36c6c2074e7508f3b7d6177584b/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q34EccL909E64KazsaJSNQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*gexRCgL0AUhshdyUTmq_Iw.png" /></figure><h3>Dataset exploratory clustering visualisation</h3><p>Instead of running numerous pairplots correlation graph, I use the T-distributed Stochastic Neighbor Embedding (t-SNE), a machine learning algorithm to further visualise the correlation between the independent variables and housing prices. t-SNE reduces the high-dimensional data into a low two-dimensional space. The 17 independent variables are reduced to x-y coordinates and the colour of each data point represent the price of the flat. The clustering of data points by flat prices is clearly evident in the image below. Therefore, if we run regression algorithms, we should obtain highly accurate predictive models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*epBB_tpieAgBJx4ljVT2lg.png" /></figure><h3>Dataset preparation for predictive modelling</h3><p>The train and test dataset are split 80/20 and scaled. Scaling of the independent variables (X_train, X_test) is essential, both for model convergence and speed. If we do not scale large feature values, optimisation functions may not converge as data may swings widely and the large data points will also dominate the learning process, leading to model inaccuracy.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/067604a02722bd2b3813370f376a34ba/href">https://medium.com/media/067604a02722bd2b3813370f376a34ba/href</a></iframe><h3>Machine Learning algorithms</h3><p>Sklearn is a popular library package that provides easy accessibility and application of different machine learning algorithms. I have shared the codes below to show the ease of applying various algorithms using the sklearn library package, as they are of similar code syntax.</p><p>In addition, I have used tensorflow to build a multi-layer perceptron neural network. Due to the relatively small size of the dataset, it does not cause any computational inefficiency when running 500 epoches with batch size of 128. I have attempted to use fewer number of neurons in each hidden layer and the convergence on the training loss is much slower.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b622f76ccbf486753c32b52e4dab934d/href">https://medium.com/media/b622f76ccbf486753c32b52e4dab934d/href</a></iframe><h3>Results</h3><p>So we finally come to the exciting bit of this article. Results.</p><p>As mentioned above, I have investigated two scenarios, where I only consider the flats’ characteristics only and the other, where I included more variables such as distance from amenities.</p><p>The results show that the additional variables increase model accuracy (using sklearn metrics “explained_variance_score”, similar to R2) by 10% for some of the algorithms. The baseline model (multi-linear regression) accuracy increase from 73% to 84%. This shows the importance of geodistance variables. The results from lasso and ridge do not differ much from the baseline model. For the neural network algorithm, it reports a higher accuracy compared to the baseline model for both scenarios.</p><p>The Decision Tree algorithm performs the best in both scenarios. In particular, it achieves a high accuracy rate of 94%, regardless of the additional variables added. The algorithm also reports a Mean Absolute Error (“MAE”) of $24,997, the lowest among the various predictive models. This is relatively low, compared to the cost of a flat. ranging from $150K to $1.2m.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*XxMJ8K8C5Uaz8Eu81AIYnw.png" /><figcaption>Using only the flat’s characteristics variables</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*tQsT2T4AXh2oBvgQ53CouQ.png" /><figcaption>Using more variables, including distance to amenities and crime rates in each neighbourhood</figcaption></figure><h3>Build a live model</h3><p>Going back to the objective of this series of articles on Singapore’s housing prices, the aim is to generate geodistance-based variables, identify if they are of any use in predictive modelling and if so, create a model to help identify whether a house is over or under value.</p><p>Since I have identified distance to amenities as important variables and the Decision Tree algorithm has the highest accuracy amongst the algorithms explored, I then build a live model (using Decision Tree algorithm) based on the findings.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff2d24fb2b20c9b277a9fe3a299e6648/href">https://medium.com/media/ff2d24fb2b20c9b277a9fe3a299e6648/href</a></iframe><p>The user has to input 3 information (“address of the flat”, “floor area of the flat” and “floor level of the flat”). The rest of the variables are extracted from the <a href="https://data.gov.sg/dataset/hdb-property-information">metadata of public housings</a> and also using the <a href="https://medium.com/@michael.wy.ong/web-scrape-geospatial-data-analyse-singapores-property-price-part-i-276caba320b">codes in Part I</a> to generate the geodistance variables. Using two latest listing on <a href="https://www.propertyguru.com.sg/">propertyguru</a> in Sengkang area and assuming they are on floor level 8 (the floor level is not indicated in the property listings), it is noted that one property is selling below the predicted value while the other is selling at the predicted value. This can help buyers identify whether they are getting a fair value for a flat that they are interested in; and also help sellers to identify whether they have set a reasonable listing price for their flats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xoAjE48IAswITFUtbY5F0A.png" /><figcaption>Example 1: Listing price of property on sale</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9pmtihH04HjpwCX1pSV5hA.png" /><figcaption>Example 1: Model shows the predicted price is higher than listing price of property</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NBj-5BJOtjB3FzKQ_rwKEw.png" /><figcaption>Example 2: Listing price of property on sale</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NaYnIxfMWRe0fgk38sjuKg.png" /><figcaption>Example 2: Model shows predicted price is similar to listing price of property</figcaption></figure><h3>Conclusion</h3><p>In this last part of the series on Singapore’s housing prices, I have investigate various machine learning algorithms to predict housing prices and conclude that the Decision Tree algorithm (out of the 5 models explored) has the highest accuracy. Furthermore, I build a live model such that it can take any new flat listing, generate a predicted value of the flat and be compared with the listing price of a property. This will give an indication of whether the listed flat is a “good buy”.</p><p>The accuracy of the model can be further improved, such as taking into consideration other time series variables, i.e. macroeconomic variables. Also, cross validation is always a good practice to ensure consistency of model. Nevertheless, with the high accuracy rate obtained from this model, it should suffice for this study.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd9438077423" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/singapore-housing-prices-ml-prediction-analyse-singapores-property-price-part-iii-bd9438077423">Singapore Housing Prices ML Prediction — Analyse Singapore’s Property Price (Part III)</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[Geospatial Data Visualisation with Plotly— Analyse Singapore’s Property Price (Part II)]]></title>
            <link>https://medium.com/analytics-vidhya/geospatial-data-visualisation-with-plotly-analyse-singapores-property-price-part-ii-eb4f8eb24d05?source=rss-a0e35e3daa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb4f8eb24d05</guid>
            <category><![CDATA[interactive-content]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[housing-prices]]></category>
            <category><![CDATA[plotly]]></category>
            <category><![CDATA[animated-graphs]]></category>
            <dc:creator><![CDATA[Michael Wy Ong]]></dc:creator>
            <pubDate>Mon, 13 Jul 2020 10:53:18 GMT</pubDate>
            <atom:updated>2020-07-19T16:34:29.270Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wP8yDlHUpB0HtAihEvICrg.png" /></figure><p>In <a href="https://medium.com/@michael.wy.ong/web-scrape-geospatial-data-analyse-singapores-property-price-part-i-276caba320b">part I</a> of this exploration study on Singapore’s property price, I have gathered transactional information of the housing prices and also identified amenities that may have played a part in affecting housing prices, depending on the proximity of the houses to the amenities.</p><p>In this article, I’ll touch on some of the interactive graphs that I have created to provide an overview of the housing prices across Singapore, without any predictive modelling (yet!). While there are other library packages such as matplotlib, seaborne etc, I thought it will be fun to try out graphing purely using Plotly, so that it is fully interactive.</p><h3>Brief Introduction of Dataset</h3><p>I downloaded the transactional data of resale flat prices in Singapore between 2017–2019. (<a href="https://data.gov.sg/dataset/resale-flat-prices">link</a>). In addition, using the names of various amenities and webscrape from <a href="https://www.onemap.sg/home/">onemap.sg</a>, I was able to find the geographical coordinates of each of the amenities and the flats and the geodistance between the flats and the amenities. Finally, I merged the data together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y3KGy4jIouK5qTItDn-XeA.png" /><figcaption>Final Dataset</figcaption></figure><h3><strong>Data exploration graphs</strong></h3><p><strong>Simple graphs</strong></p><p>First, I use Plotly express to plot some simple interactive graphs of the final dataset.</p><p>The bar chart below shows that there were only a few transactions on “1-room”, “2-rooms” and Multi-Generation flat types. Based on my own understanding, I believed that “1 Room” and “2 Room” flat are not in demand due to the small floor size; and <a href="https://www.straitstimes.com/singapore/housing/larger-3gen-hdb-flats-for-multi-generation-families-popular-with-8-in-10-units">Multi-Generation flats</a> are only built since 2013 and the fewer transactions could be highly correlated with the low supply. I have chosen to further exclude these flats from the analysis as these flat types are not usually high sought after.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2063383ff5d3cca58a2f3ceaee1fe6f/href">https://medium.com/media/a2063383ff5d3cca58a2f3ceaee1fe6f/href</a></iframe><iframe src="https://share.getcloudapp.com/Wnub64Em?embed=true" width="800" height="404" frameborder="0" scrolling="no"><a href="https://medium.com/media/c108d124e8d46b8d093ae0719e07aed4/href">https://medium.com/media/c108d124e8d46b8d093ae0719e07aed4/href</a></iframe><p>The next consideration is whether there is any changes in the prices of similar flat type across the years. If there is significant changes, the transaction prices will need to be adjusted for factors, such as inflation etc. A ridgeline plot (aka joyplot) is graphed below and it shows that the prices for each flat type is quite similar across the 3 years. More interestingly, there is an evident price difference across the different flat types.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e4941b241a91da7b060ca168d8559b07/href">https://medium.com/media/e4941b241a91da7b060ca168d8559b07/href</a></iframe><iframe src="https://share.getcloudapp.com/qGuK6w7l?embed=true" width="800" height="417" frameborder="0" scrolling="no"><a href="https://medium.com/media/22927195782d7b1f2c4a2ca9e8de1aab/href">https://medium.com/media/22927195782d7b1f2c4a2ca9e8de1aab/href</a></iframe><h4><strong>More exciting graphs</strong></h4><p>Next, I plotted pairplots of the correlation between transactional flat prices and distances. I’ve shown the codes below for a correlation pairplot of <strong>flat prices</strong> against <strong>distance to the city centre</strong>, which shows an inverse correlation across all flat types, i.e. as the distance from the city increase, the flat price decrease. This is as expected.</p><p>While it is much easier to use matplotlib library to plot the pairwise correlation graph below, the benefits of using Plotly to do so is that outliers can be identified more easily and investigated.</p><p>Sidetrack: As you can see below, I have moved on to other Plotly graphs that allow more control. Plotly express is a quick way to plot interactive graphs, but does not give much leeway to how we want our graphs to be presented, such as subplots.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/412d578d8007050a5299d0ee9fdea8f7/href">https://medium.com/media/412d578d8007050a5299d0ee9fdea8f7/href</a></iframe><iframe src="https://share.getcloudapp.com/kpu5RkGG?embed=true" width="800" height="432" frameborder="0" scrolling="no"><a href="https://medium.com/media/12cf795313a54a5264c5f912a53fef4b/href">https://medium.com/media/12cf795313a54a5264c5f912a53fef4b/href</a></iframe><h3><strong>Geospatial Data Visualisation</strong></h3><p><strong>Data Preparation</strong></p><p>To present the final geospatial graph, in addition to the final dataset, I’ve also used the saved datasets which consist of the geographical locations of the amenities.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ccc272329368564a0d90d2b048d28fea/href">https://medium.com/media/ccc272329368564a0d90d2b048d28fea/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*srO5h5-iZtopmTIeUIf8dA.png" /><figcaption>MRT geographical coordinates</figcaption></figure><p>Also, I had filtered some of the amenities’ data. For example, I filtered a list of top primary schools in Singapore instead of plotting all the schools’ locations (based on listings provided by a <a href="https://numberoneproperty.com/top-10-tips-for-getting-into-good-school-in-singapore/">property website</a>), and categorise the flat prices into 4 bins, for each different flat type.</p><p>Note: By converting flat prices from a numerical to a categorical variable, I can easily identify whether there is any concentration of flats (of the same flat type and quantile level) in a certain area of Singapore.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7975c9443e300ed63554e0d78c82aed/href">https://medium.com/media/c7975c9443e300ed63554e0d78c82aed/href</a></iframe><h4>Plot graph</h4><p>To present the graph in a concise but understandable approach, I’ve created 5 different geospatial maps which can be filtered under multiple tabs in a single Plotly graph.</p><p>Singapore’s map is generated using Plotly’s Mapbox. (You will need your token API that can be generated after signing up an account with Plotly).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7302ca22c5978c2f011ca9e00f6ce503/href">https://medium.com/media/7302ca22c5978c2f011ca9e00f6ce503/href</a></iframe><p><strong>Graphs and findings</strong></p><p>I’ve attached 3 of the tabs — Overview, “3 Rooms” and “5 Rooms” in this article.</p><p>In the “Overview graph”, we can see that in general, the 75% quantile flats (regardless of flat types) are situated around the central and east of Singapore. Within the different regions, flats that are nearer to the train stations are sold at a higher transactional price. Furthermore, we also see that flats that are near to top schools are sold at a generally higher price as well.</p><iframe src="https://share.getcloudapp.com/04uYderm?embed=true" width="800" height="433" frameborder="0" scrolling="no"><a href="https://medium.com/media/04ccc59f972ee55efcf701e13866dae8/href">https://medium.com/media/04ccc59f972ee55efcf701e13866dae8/href</a></iframe><p>When we further analyse the “3 Rooms” sub-plot, the trend is not so obvious anymore. Flats of higher transaction prices are congregated towards the East and the impact of amenities does not seem to have much significant effect within a smaller region.</p><iframe src="https://share.getcloudapp.com/JruLmzwm?embed=true" width="800" height="430" frameborder="0" scrolling="no"><a href="https://medium.com/media/748a978ef1750c2f377af66a1e046020/href">https://medium.com/media/748a978ef1750c2f377af66a1e046020/href</a></iframe><p>A different story is said in the “5 Rooms” subplot, where the sub-clusters at North-East region (Sengkang, Punggol) and West (Clementi) seems to suggest the importance of train stations. The effect of other amenities (schools and hawker centres) are also somewhat important, though the effect is not consistent across all areas of Singapore.</p><iframe src="https://share.getcloudapp.com/nOueQBez?embed=true" width="800" height="426" frameborder="0" scrolling="no"><a href="https://medium.com/media/557a6356b8d42c04fa30dcdd4c7853db/href">https://medium.com/media/557a6356b8d42c04fa30dcdd4c7853db/href</a></iframe><h3><strong>Conclusion</strong></h3><p>Through the above visualisation, it is evident that some amenities have significant impact on certain flat types and without further data modelling, this will be a good basis on where one may be able to find good bargain flats. For example, if you are inclined towards purchasing a flat in the Eastern part of Singapore, it will be a bargain if the flat is below the 50% quantile level.</p><p>In addition, I hope that I have provided some useful ideas on how to use the Plotly library package to plot simple to more complex graphs with your data.</p><p>In the final part of this 3-part series, I’ll touch on some predictive machine learning algorithms that I have used to find out how well housing prices can be predicted using both transactional data and geodistances.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb4f8eb24d05" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/geospatial-data-visualisation-with-plotly-analyse-singapores-property-price-part-ii-eb4f8eb24d05">Geospatial Data Visualisation with Plotly— Analyse Singapore’s Property Price (Part II)</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[Web-scrape Geospatial Data — Analyse Singapore’s Property Price (Part I)]]></title>
            <link>https://medium.com/swlh/web-scrape-geospatial-data-analyse-singapores-property-price-part-i-276caba320b?source=rss-a0e35e3daa9------2</link>
            <guid isPermaLink="false">https://medium.com/p/276caba320b</guid>
            <category><![CDATA[data-capture]]></category>
            <category><![CDATA[singapore-property]]></category>
            <category><![CDATA[location-intelligence]]></category>
            <category><![CDATA[housing-prices]]></category>
            <category><![CDATA[geospatial-data]]></category>
            <dc:creator><![CDATA[Michael Wy Ong]]></dc:creator>
            <pubDate>Mon, 29 Jun 2020 16:31:43 GMT</pubDate>
            <atom:updated>2020-06-29T16:34:25.900Z</atom:updated>
            <content:encoded><![CDATA[<h3>Web-scrape Geospatial Data — Analyse Singapore’s Property Price (Part I)</h3><p>Location matters! Or that’s what I thought. More often than not, we noticed how some properties were marketed as “matured estates”, “near to train station”, “close proximity to reputable schools”, etc. Would these houses therefore fetch higher prices?</p><p>In this article, I’ll reference some of the codes that I had adapted from and modified (<a href="https://medium.com/@seinchyi/machine-learning-for-singapore-resale-hdb-pt-1-data-preparation-8cdc2df8e24f">referenced link</a>) on how to create your own geospatial data. The next article will be a visualisation of the data which could potentially help home buyers spot a dream home that is value-for-money.</p><h3><strong>Data Sources</strong></h3><p>The main source of data is obtained from “<a href="https://data.gov.sg"/">https://data.gov.sg&quot;</a>. It is a government-based website which publish data that is available to the public. The information below can be downloaded from the respective hyperlinks:</p><ul><li><a href="https://data.gov.sg/dataset/resale-flat-prices">Transaction information of flat prices</a></li><li><a href="https://data.gov.sg/dataset/hdb-property-information">Metadata of public housings</a></li><li><a href="https://data.gov.sg/dataset/list-of-government-markets-hawker-centres">List of government hawker centres</a> — Food courts where there are various food stalls in a common space, selling various food items. The prices of food is much lower in comparison to restaurants and a measure of availability to affordable food.</li><li><a href="https://data.gov.sg/dataset/list-of-supermarket-licences">List of supermarkets </a>— A measure of availability to groceries</li><li><a href="https://github.com/hxchua/datadoubleconfirm/blob/master/datasets/mrtsg.csv">List of train stations </a>— A measure of transport accessibility</li><li><a href="https://en.wikipedia.org/wiki/List_of_primary_schools_in_Singapore">List of primary schools</a> (elementary schools for ages 7–12) — In Singapore, if you stay near a primary school (within 1 km), the child has a higher priority to be accepted into the school. This only applies to admission to primary schools, as the admission into higher education depends on your national examination results and is a measure of accessibility to education</li><li><a href="https://data.gov.sg/dataset/five-preventable-crime-cases-recorded-by-npc">List of 5 preventable crimes recorded in each neighbourhood police centres</a> — A measure of crime rates in the area</li></ul><p>One can always add more amenities information as they deem fit. The relative accessibility of the public amenities, proximity to reputable schools and relative crime rates and safety are just some of the factors that I thought may have played a part. For example, in the same neighborhood, will the price for a flat that is nearer to the train station yield higher price compared to one that is closer to a reputable school?</p><h3><strong>Geographical coordinates of houses and amenities</strong></h3><p>Here, we make use of <a href="https://www.onemap.sg/home/">onemap.sg</a>, a website similar to google maps, where it can return the location of the address that is requested. The address in singapore need not the postal code (zip code). It can be the name of the amenity (i.e. City Hall train station) or the full address of a house. Information, including the geographical coordinates, is returned. Using this, we can generate the geolocation of each address that we are interested (houses, schools, supermarkets etc.)</p><p>The file below is taken from the first dataset (<a href="https://data.gov.sg/dataset/resale-flat-prices">Transaction information of flat prices</a>) and using only the “block number” and “street name”, the geographical location of the flats can be obtained in the codes excerpts below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cRQPf2wJqy_y3LIZ4_BHA.png" /><figcaption>Records of “resale-flat-2017-onwards.csv” dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ADVKW6uyyUqKPa_9l_j4UA.png" /><figcaption>Addresses of all transacted flats</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53035ed117e94836594f93a5d8b53c4b/href">https://medium.com/media/53035ed117e94836594f93a5d8b53c4b/href</a></iframe><p>The function above will return the following csv file, giving full detail, such as the geographical coordinates, address. Some addresses will be repeated, as different buildings names may be linked to the same address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*_STK-mN94eHB584vZI2htQ.png" /><figcaption>CSV file from find_postal function</figcaption></figure><p>We have the geographical location of the flats. Now, we just need to do the same for all other amenities that you are interested to investigate. All is needed is either the name of the amenities and the onemap.sg will return the information required.</p><h3><strong>Crime Dataset (Example)</strong></h3><p>In particular, I’ve included the dataset on the measure of the top 5 common crime rate in the area, using the number of reported police cases in each district. This may not be very useful in Singapore’s demographical landscape, given the Ethnic Integration Policy implemented via the <a href="http://eresources.nlb.gov.sg/history/events/d8fea656-d86e-4658-9509-974225951607#1">housing policy</a>. Nevertheless, it is interesting to see if there is notion of a “safer” district.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GYoxpjx2_0UhwrsHXRGkww.png" /></figure><p>I require the reported crime cases for each of the neighbourhood policy centre (NPC), thus, I split up “level_1” column, filter only records of the individual NPCs and pivot the “value” column.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bba19300c77b86212483961d4c905c8d/href">https://medium.com/media/bba19300c77b86212483961d4c905c8d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-6BDBmMGvYnngi5U_susQ.png" /></figure><p>Again, I’ll use the “find postal” function above to find the postal address (geographical coordinates) of each of the NPCs.</p><h3><strong>Finding Distance between two locations</strong></h3><p>With the geographical locations, all we need to do next is to find the distance between the two points. To do this, we apply the codes below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dca4e55a1d84e178a1824695b71b6f95/href">https://medium.com/media/dca4e55a1d84e178a1824695b71b6f95/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*hkspyG6LI-VctLt0qvnzoQ.png" /><figcaption>Output from “find nearest” function codes above</figcaption></figure><p>I applied the above codes to find the distance from the train stations, food centres, schools, supermarkets etc., with distance(km) rounded it to 3 decimal places. Furthermore, using google map, I find out what is the geographical coordinates of Singapore’s City Hall Train station [‘cityhall’, 1.29317576, 103.8525073], which is roughly the centre business and town area of Singapore, and included the distance between the flats to the Central Business District. By joining all the data together, this would give me sufficient information to analyse whether the distance to neighbourhood amenities is more important than the distance to the city centre.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y3KGy4jIouK5qTItDn-XeA.png" /></figure><h3>Conclusion</h3><p>In this article, I use two codes snippets (courtesy of Sein Chyi) to webscrape distance information between different locations in Singapore. The information can be added to other existing information available under the dataset containing the details relating to the transacted flat, such as age and size of the flat, floor level etc. In the next article, I will use the information collected to plot interactive graphs and gain insights on how the distance to amenities might affect housing prices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=276caba320b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/web-scrape-geospatial-data-analyse-singapores-property-price-part-i-276caba320b">Web-scrape Geospatial Data — Analyse Singapore’s Property Price (Part I)</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>