<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/the-city-of-chicago-uses-r-to-issue-beach-safety-alerts/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2017/11/chicago-water.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p>Among the many interesting talks I saw a the <a rel="nofollow" href="https://popup.dominodatalab.com/chicago/" target="_blank">Domino Data Science Pop-Up in Chicago</a> earlier this week was the presentation by <a rel="nofollow" href="https://popup.dominodatalab.com/chicago/speakers/gene-leynes/" target="_blank">Gene Lynes</a> and <a rel="nofollow" href="https://popup.dominodatalab.com/chicago/speakers/nick-lucius/" target="_blank">Nick Lucius</a> from the City of Chicago. The <a rel="nofollow" href="http://techplan.cityofchicago.org/" target="_blank">City of Chicago Tech Plan</a> encourages smart communities and open government, and as part of that initiative the city has undertaken dozens of <a rel="nofollow" href="http://dev.cityofchicago.org/projects/" target="_blank">open-source, open-data projects</a> in areas such as food safety inspections, preventing the spread of West Nile virus, and keeping sidewalks clear of snow. </p>
<p>This talk was on the <a rel="nofollow" href="http://chicago.github.io/clear-water/" target="_blank">Clear Water</a> initiative, a project to monitor the water quality of Chicago's many public beaches on Lake Michigan, and to issue safety alerts (or in serious cases, beach closures) when E Coli levels in the water get too high. The problem is that E Coli levels can change rapidly: water levels can be normal for weeks, and then spike for a single day. But traditional culture tests take many days to return results, and while rapid DNA-based tests do exist, it's not possible conduct these tests daily at every beach.</p>
<p>The solution is to build a predictive model, which uses meteorological data and rapid DNA tests for some beaches, combined with historical (culture-based) evaluations of water quality, to predict E Coli levels at all beaches every day. The analysis is performed using R (you can find the <a rel="nofollow" href="https://github.com/Chicago/clear-water" target="_blank">R code at this Github repository</a>).</p>
<p>The analysis was developed in conjunction with citizen scientists at <a rel="nofollow" href="https://chihacknight.org/projects/2016/05/01/e-coli-predictions.html" target="_blank">Chi Hack Night</a> and statisticians from DePaul University. In 2017, the model was <a rel="nofollow" href="https://github.com/Chicago/clear-water-app" target="_blank">piloted in production in Chicago</a> to issue beach safety alerts and to create a live <a rel="nofollow" href="https://data.cityofchicago.org/Parks-Recreation/Clear-Water-Map/mf7j-mc8j" target="_blank">map of beach water quality</a>. This new R-based model predicted 60 additional occurrences of poor water quality, compared with the process used in prior years.</p>
<p>Still, water quality is hard to predict: once you have the slower test data and an actual result to compare with, that's an accuracy rate of 38%, with fewer than 2% false alarms. (The city plans to use clustering techniques to further improve that number.) That model uses rapid DNA testing at five beaches to predict all beaches along Lake Michigan. A <a rel="nofollow" href="http://chicago.github.io/clear-water/challenge/index.html" target="_blank">Shiny app</a> (linked below) lets you explore the impact of testing at a different set of beaches, and adjusting the false positive rate, on the overall accuracy of the model.</p>
<p><a rel="nofollow" href="http://chicago.github.io/clear-water/challenge/index.html" target="_blank"><img border="0" alt="Chicago Beaches" title="Chicago Beaches" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b8d2bf01a2970c-800wi"></a></p>
<p>You can find more details about the City of Chicago Clear Water initiative at the link below.</p>
<p>City of Chicago: <a rel="nofollow" href="http://chicago.github.io/clear-water/" target="_blank">Clear Water</a></p>
</div>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.revolutionanalytics.com/2017/11/chicago-water.html"> Revolutions</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/cKYAcCQHJkw" height="1"></a></div>