<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/house-price-data-cleansing-and-segmentation-tool/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://nycdatascience.com/blog/student-works/house-price-data-cleansing-and-segmentation-tool/"> R – NYC Data Science Academy Blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><img sizes="(max-width: 1024px) 100vw, 1024px" src="https://i2.wp.com/nycdatascience.com/blog/wp-content/uploads/2018/07/featured_image_blog-1024x573.png?w=450&ssl=1" alt="" class="wp-post-image" data-recalc-dims="1"></p>
<h3>Project background</h3>
<p><a rel="nofollow" href="https://www.gov.uk/government/statistical-data-sets/price-paid-data-downloads," title="Price Paid, Land Registry" target="_blank">Land Registry</a> publishes data for each housing sale transaction that is registered in England &amp; Wales. This data has been used extensively for many analysis, from price evolution in time to the assessment of price differences between areas. This dataset is publicly available under the government licence and dates back to 1995.</p>
<p>The main variables we find in each dataset are the location of the transaction (with full postcode, used for geolocate each property), the type of asset (Flat, Detached, Bungalow,… and Other, which was discarded) and the price. Unfortunately, there is no qualitative or quantitative information of each asset (i.e. an area would be very useful).</p>
<p>The main issue working with this dataset, particularly when working with any transactional dataset (Residential, Offices, …) is that the distribution is usually skewed, with values of just few thousand pounds to many millions. For this reason, we have created a tool with two main objectives:</p>
<ul>
<li>Filtering the original dataset based on the Median Absolute Deviation times a factor to discard outliers.</li>
<li>Further, filtering the dataset results to segment the market data so users can focus on a range of upper or lower percentile of the sample</li>
</ul>
<h3></h3>
<h3>Cleanse the data and discard outliers</h3>
<p>Although it is a common practice, it would be wrong to cleanse the data by only applying a minimum and maximum value filtering the whole dataset, mainly because of the two reasons listed below:</p>
<ul>
<li>The highly skewed distribution of the price range</li>
<li>The variability of prices within each group</li>
</ul>
<p>To tackle the first issue, we decided to implement the MAD (Median Absolute Deviation) instead of the standard deviation to be less dependent on the variance of the data and apply a factor below and above the median to filter the data. So, a ‘2’ factor will discard values 2 times above or below the Median therefore the higher the factor applied will result in more extreme values to be included in the final sample.</p>
<p>At the same time and to avoid geographical bias, we apply this methodology <strong>for each Borough</strong>. That is, we calculate the median and MAD for each borough and with the calculated median, we then apply the MAD factor filtering. In other words, a 1million pounds house in a central Borough won’t be considered an outlier but it might be discarded if the house is located in one of the outer Boroughs.</p>
<p><a rel="nofollow" href="https://i2.wp.com/nycdatascience.com/blog/wp-content/uploads/2018/07/full_screen.png" target="_blank"><img sizes="(max-width: 2165px) 100vw, 2165px" src="https://i2.wp.com/nycdatascience.com/blog/wp-content/uploads/2018/07/full_screen.png?w=450" alt="" class="wp-image-34660" data-recalc-dims="1"></a></p>
<p> </p>
<p> </p>
<h3>Market segmentation</h3>
<p>Real Estate investors market their properties to very specific market segments, i.e. for the top end of the market. Having this capability to dynamically select which ‘slice’ of the market we are interested in is, therefore, a very useful tool when working with housing prices.</p>
<p>With the percentiles slider implemented, the user can easily select the segment of the market he/she is interested in. For example, to analyse the top end of the market would be as easy as to select for 0.8 to 1 in the slider.</p>
<p><a rel="nofollow" href="https://i2.wp.com/nycdatascience.com/blog/wp-content/uploads/2018/07/map_picture.png" target="_blank"><img sizes="(max-width: 947px) 100vw, 947px" src="https://i2.wp.com/nycdatascience.com/blog/wp-content/uploads/2018/07/map_picture.png?w=450" alt="" class="wp-image-34658" data-recalc-dims="1"></a></p>
<h3></h3>
<h3>Download the data</h3>
<p>The primary objective of this tool is to implement specific criteria to filter and segment a dataset. Hence, the download capability has also been implemented. We can download either the full datasets once is cleansed according to user selection or a Borough summary for convenience.</p>
<h2> <a rel="nofollow" href="https://github.com/morenobcn/house_price_explorer#next-steps" target="_blank"></a>Next steps</h2>
<p>This application should be extended to allow the following:</p>
<ul>
<li>To implement the capability to upload your own CSV.</li>
<li>Mapping each of the data properties to help with data visualization.</li>
<li>Making the coding as generic as possible to apply the same methodology to other country datasets.</li>
</ul>
<h5>Access the hosted Shiny Application: <a rel="nofollow" href="https://natxomoreno.shinyapps.io/London_House_Prices_Stat_Explorer/" target="_blank">https://natxomoreno.shinyapps.io/London_House_Prices_Stat_Explorer/</a></h5>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://nycdatascience.com/blog/student-works/house-price-data-cleansing-and-segmentation-tool/"> R – NYC Data Science Academy Blog</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/LBLDFWiV2jM" height="1"></a></div>