Skip to content

Forecasting elevated levels of E. coli at Chicago beaches to provide proper warning to beach-goers.

Notifications You must be signed in to change notification settings

Chicago/clear-water

Repository files navigation

Clear Water

DOI MIT License project

The City of Chicago's Clear Water project brings an innovative approach to beach water quality monitoring. It uses a machine learning prediction technique to better forecast the bacteria levels at Chicago beaches. The model works by interpreting patterns in the results of DNA tests at a handful of beaches across the City, which are then extrapolated to forecast the water quality at other, untested beaches. This method provides a new way for beach managers to save money on expensive rapid water quality tests.

Initial evaluation of the model has shown a significant improvement over current methods of predicting beach water quality. Testing is ongoing, and the 2017 beach season is being analyzed to further improve and evaluate the model's performance.

Getting started with R

This project uses R, which you can download here. We recommend you also install RStudio. You can open this project in RStudio by opening the clear-water.Rproj file.

If you are new to R, check out some basics here.

Running the model

To generate the model, open the Master.R file. Inside the file, you will see settings that you can tweak to change the predictors and other facets of the model. Once you're ready, run all the code in the file. If you've successfully generated the model, you'll see ROC and Precision/Recall plots appear in RStudio. You'll also have a Data Frame in R called model_summary that contains the results of the model evaluation.

Running the model in production

This repo is one of two GitHub repos that make up the Clear Water project. The other one can be found here and is an application that automatically generates water quality predictions based on daily DNA test results that are published on Chicago's Data Portal.

Contributing

If you are interested in contributing to this project, see our Contribution Guide.

Notes

Collaboration with the Civic Tech Community

This project originated as a breakout group at Chi Hack Night.

Resources

LICENSE

Copyright (c) 2015 City of Chicago

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.