{"id":5236,"date":"2023-11-16T15:20:07","date_gmt":"2023-11-16T22:20:07","guid":{"rendered":"https:\/\/jeremywhittaker.com\/?p=5236"},"modified":"2023-11-16T15:21:01","modified_gmt":"2023-11-16T22:21:01","slug":"my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks","status":"publish","type":"post","link":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/","title":{"rendered":"My Leaky Water Bill &#8211; How to Use Machine Learning to Detect Water Leaks"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"351\" data-src=\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-1024x351.png\" alt=\"\" class=\"wp-image-5238 lazyload\" data-srcset=\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-1024x351.png 1024w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-300x103.png 300w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-768x263.png 768w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-1536x526.png 1536w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-500x171.png 500w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5.png 1553w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/351;\" \/><\/a><\/figure>\n\n\n\n<p>Recently, I encountered an unexpected challenge: a water leak beneath the slab of my house. The ordeal had me up until 1 AM, rerouting the line through my attic with PEX piping. Amidst this late-night task, a thought occurred to me: could machine learning and forecasting have helped me detect this leak earlier, based on my water bill consumption?<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"256\" height=\"342\" data-id=\"5237\" data-src=\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/20230101125827-IR.jpg\" alt=\"\" class=\"wp-image-5237 lazyload\" data-srcset=\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/20230101125827-IR.jpg 256w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/20230101125827-IR-225x300.jpg 225w\" data-sizes=\"(max-width: 256px) 100vw, 256px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 256px; --smush-placeholder-aspect-ratio: 256\/342;\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"771\" data-id=\"5241\" data-src=\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152001264-1024x771.jpg\" alt=\"\" class=\"wp-image-5241 lazyload\" data-srcset=\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152001264-1024x771.jpg 1024w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152001264-300x226.jpg 300w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152001264-768x578.jpg 768w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152001264-1536x1157.jpg 1536w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152001264-2048x1542.jpg 2048w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152001264-398x300.jpg 398w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/771;\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"771\" data-id=\"5242\" data-src=\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152021388-1024x771.jpg\" alt=\"\" class=\"wp-image-5242 lazyload\" data-srcset=\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152021388-1024x771.jpg 1024w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152021388-300x226.jpg 300w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152021388-768x578.jpg 768w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152021388-1536x1157.jpg 1536w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152021388-2048x1542.jpg 2048w, https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/PXL_20231116_152021388-398x300.jpg 398w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/771;\" \/><\/figure>\n<\/figure>\n\n\n\n<p>I wrote some Python code outlined below that uses statmodels and SARIMAX to predict consumption. <br><br>I now wonder why municipalities aren&#8217;t incorporating machine learning into data like this to send notices to customers in advance of potential leaks. I imagine this could save millions of gallons of water each year. Full code and explanation follows.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Data Upload and Preparation:<\/h2>\n\n\n\n<p>The program starts by uploading a CSV file containing water usage data (in gallons) and the corresponding dates. The CSV must have two column titles date and gallons in order for this to work. This data is then processed to ensure it&#8217;s in the correct format. Dates are sorted, and any missing values are filled to maintain continuity.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br>Creating a Predictive Model:<\/h2>\n\n\n\n<p>I used the SARIMAX model from the statsmodels library, a powerful tool for time series forecasting. The model considers both the seasonal nature of water usage and any underlying trends or cycles.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br>Making Predictions and Comparisons:<\/h2>\n\n\n\n<p>The program forecasts future water usage and compares it with actual data.<br>By analyzing past consumption, it can predict what typical usage should look like and flag any significant deviations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br>Visualizing the Data:<\/h2>\n\n\n\n<p>The real power of this program lies in its visualization capabilities.<br>Using Plotly, a versatile graphing library, the program generates an interactive chart. It not only shows actual water usage but also plots predicted values and their confidence intervals.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Highlighting Historical Data:<\/h2>\n\n\n\n<p>To provide context, the chart also includes historical data as reference points. These are shown as small horizontal lines, representing the same month in previous years.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code (<a href=\"https:\/\/colab.research.google.com\/drive\/1zDn-gzs2AR_I4Cbt9rDSuu6bbwCL8hJg?usp=sharing\">Google Colab<\/a>)<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install plotly\r\n!pip install statsmodels\n\nfrom google.colab import files\r\nimport io\r\nimport pandas as pd\r\n\r\nuploaded = files.upload()\r\n\r\n# Use the name of the first uploaded file\r\nfilename = next(iter(uploaded))\r\ndf = pd.read_csv(io.BytesIO(uploaded&#91;filename]))\r\n\r\ndf = df&#91;&#91;'date', 'gallons']]\r\n\r\n# Convert the date column to datetime\r\ndf&#91;'date'] = pd.to_datetime(df&#91;'date'])  \r\ndf.sort_values(by='date', inplace=True)\r\n\r\ndf.set_index('date', inplace=True)\r\ndf = df.asfreq('D')\r\ndf&#91;'gallons'].fillna(method='ffill', inplace=True)\r\ndf = df.asfreq('M')\n\nimport plotly.graph_objects as go\r\nimport pandas as pd\r\nfrom statsmodels.tsa.statespace.sarimax import SARIMAX\r\n\r\n# SARIMA Model for Forecasting\r\nmodel = SARIMAX(df&#91;'gallons'], order=(1, 0, 1), seasonal_order=(1, 1, 1, 12))\r\nresults = model.fit()\r\n\r\n# In-sample predictions\r\nin_sample_predictions = results.get_prediction(start=pd.to_datetime(df.index&#91;12]), end=pd.to_datetime(df.index&#91;-1]), dynamic=False)\r\npredicted_mean_in_sample = in_sample_predictions.predicted_mean\r\nin_sample_conf_int = in_sample_predictions.conf_int()\r\n\r\n# Forecasting for future periods (e.g., the next 12 months)\r\nforecast = results.get_forecast(steps=12)\r\npredicted_mean_forecast = forecast.predicted_mean\r\nforecast_conf_int = forecast.conf_int()\r\n\r\n# Prepare the figure\r\nfig = go.Figure()\r\n\r\n# Predicted data (in-sample) and confidence intervals\r\nfig.add_trace(go.Scatter(x=predicted_mean_in_sample.index, y=predicted_mean_in_sample, mode='lines', name='Predicted (In-Sample)', line=dict(color='orange')))\r\nfig.add_trace(go.Scatter(x=in_sample_conf_int.index, y=in_sample_conf_int&#91;'upper gallons'], fill=None, mode='lines', line=dict(color='lightgray'), showlegend=False))\r\nfig.add_trace(go.Scatter(x=in_sample_conf_int.index, y=in_sample_conf_int&#91;'lower gallons'], fill='tonexty', mode='lines', line=dict(color='lightgray'), showlegend=False, name='Predicted CI'))\r\n\r\n# Forecasted data (out-of-sample) and confidence intervals\r\nfig.add_trace(go.Scatter(x=predicted_mean_forecast.index, y=predicted_mean_forecast, mode='lines', name='Forecast (Out-of-Sample)', line=dict(color='green')))\r\nfig.add_trace(go.Scatter(x=forecast_conf_int.index, y=forecast_conf_int&#91;'upper gallons'], fill=None, mode='lines', line=dict(color='lightgray'), showlegend=False))\r\nfig.add_trace(go.Scatter(x=forecast_conf_int.index, y=forecast_conf_int&#91;'lower gallons'], fill='tonexty', mode='lines', line=dict(color='lightgray'), showlegend=False, name='Forecast CI'))\r\n\r\n# Actual data (make it bolder and on top)\r\nfig.add_trace(go.Scatter(x=df.index, y=df&#91;'gallons'], mode='lines', name='Actual', line=dict(color='blue', width=3)))\r\n\r\n# Adding Previous Years' data as small horizontal lines\r\nlegend_added = False\r\nfor current_date in df.index.union(predicted_mean_forecast.index):\r\n    current_month, current_year = current_date.month, current_date.year\r\n    previous_years_data = df&#91;(df.index.month == current_month) &amp; (df.index.year &lt; current_year)]\r\n    for prev_year_date in previous_years_data.index:\r\n        y_value = previous_years_data.loc&#91;prev_year_date, 'gallons']\r\n        fig.add_shape(type=\"line\", x0=current_date - pd.Timedelta(days=5), y0=y_value, x1=current_date + pd.Timedelta(days=5), y1=y_value, line=dict(color=\"purple\", width=2))\r\n        if not legend_added:\r\n            fig.add_trace(go.Scatter(x=&#91;None], y=&#91;None], mode='lines', name='Previous Years', line=dict(color='purple', width=2)))\r\n            legend_added = True\r\n\r\n# Update layout\r\nfig.update_layout(title='Actual vs Predicted vs Forecasted Water Usage', xaxis_title='Date', yaxis_title='Gallons', hovermode='closest')\r\n\r\n# Show the plot\r\nfig.show()\r\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I encountered an unexpected challenge: a water leak beneath the slab of my house. The ordeal had me up until 1 AM, rerouting the line through my&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5236","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>My Leaky Water Bill - How to Use Machine Learning to Detect Water Leaks - Jeremy Whittaker<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"My Leaky Water Bill - How to Use Machine Learning to Detect Water Leaks - Jeremy Whittaker\" \/>\n<meta property=\"og:description\" content=\"Recently, I encountered an unexpected challenge: a water leak beneath the slab of my house. The ordeal had me up until 1 AM, rerouting the line through my...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/\" \/>\n<meta property=\"og:site_name\" content=\"Jeremy Whittaker\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/WhittakerJeremy\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/WhittakerJeremy\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-16T22:20:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-16T22:21:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-1024x351.png\" \/>\n<meta name=\"author\" content=\"JeremyWhittaker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"JeremyWhittaker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/\"},\"author\":{\"name\":\"JeremyWhittaker\",\"@id\":\"https:\/\/new.jeremywhittaker.com\/#\/schema\/person\/ed0edfdefb3e180693efef453372980c\"},\"headline\":\"My Leaky Water Bill &#8211; How to Use Machine Learning to Detect Water Leaks\",\"datePublished\":\"2023-11-16T22:20:07+00:00\",\"dateModified\":\"2023-11-16T22:21:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/\"},\"wordCount\":335,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/new.jeremywhittaker.com\/#\/schema\/person\/ed0edfdefb3e180693efef453372980c\"},\"image\":{\"@id\":\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-1024x351.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/\",\"url\":\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/\",\"name\":\"My Leaky Water Bill - How to Use Machine Learning to Detect Water Leaks - Jeremy Whittaker\",\"isPartOf\":{\"@id\":\"https:\/\/new.jeremywhittaker.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-1024x351.png\",\"datePublished\":\"2023-11-16T22:20:07+00:00\",\"dateModified\":\"2023-11-16T22:21:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#primaryimage\",\"url\":\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5.png\",\"contentUrl\":\"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5.png\",\"width\":1553,\"height\":532},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/new.jeremywhittaker.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"My Leaky Water Bill &#8211; How to Use Machine Learning to Detect Water Leaks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/new.jeremywhittaker.com\/#website\",\"url\":\"https:\/\/new.jeremywhittaker.com\/\",\"name\":\"Jeremy Whittaker\",\"description\":\"Research, software, markets, housing, and energy\",\"publisher\":{\"@id\":\"https:\/\/new.jeremywhittaker.com\/#\/schema\/person\/ed0edfdefb3e180693efef453372980c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/new.jeremywhittaker.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/new.jeremywhittaker.com\/#\/schema\/person\/ed0edfdefb3e180693efef453372980c\",\"name\":\"JeremyWhittaker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/c8ac20e6dfa86b5f27ce9bffee4851099770cbea5ae7338a274865bfbc8c0218?s=96&d=retro&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c8ac20e6dfa86b5f27ce9bffee4851099770cbea5ae7338a274865bfbc8c0218?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c8ac20e6dfa86b5f27ce9bffee4851099770cbea5ae7338a274865bfbc8c0218?s=96&d=retro&r=g\",\"caption\":\"JeremyWhittaker\"},\"logo\":{\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/c8ac20e6dfa86b5f27ce9bffee4851099770cbea5ae7338a274865bfbc8c0218?s=96&d=retro&r=g\"},\"sameAs\":[\"http:\/\/www.jeremywhittaker.com\",\"https:\/\/www.facebook.com\/WhittakerJeremy\",\"https:\/\/www.linkedin.com\/in\/jeremywhittaker\/\"],\"url\":\"https:\/\/new.jeremywhittaker.com\/index.php\/author\/jeremywhittaker\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"My Leaky Water Bill - How to Use Machine Learning to Detect Water Leaks - Jeremy Whittaker","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"My Leaky Water Bill - How to Use Machine Learning to Detect Water Leaks - Jeremy Whittaker","og_description":"Recently, I encountered an unexpected challenge: a water leak beneath the slab of my house. The ordeal had me up until 1 AM, rerouting the line through my...","og_url":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/","og_site_name":"Jeremy Whittaker","article_publisher":"https:\/\/www.facebook.com\/WhittakerJeremy","article_author":"https:\/\/www.facebook.com\/WhittakerJeremy","article_published_time":"2023-11-16T22:20:07+00:00","article_modified_time":"2023-11-16T22:21:01+00:00","og_image":[{"url":"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-1024x351.png","type":"","width":"","height":""}],"author":"JeremyWhittaker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"JeremyWhittaker","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#article","isPartOf":{"@id":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/"},"author":{"name":"JeremyWhittaker","@id":"https:\/\/new.jeremywhittaker.com\/#\/schema\/person\/ed0edfdefb3e180693efef453372980c"},"headline":"My Leaky Water Bill &#8211; How to Use Machine Learning to Detect Water Leaks","datePublished":"2023-11-16T22:20:07+00:00","dateModified":"2023-11-16T22:21:01+00:00","mainEntityOfPage":{"@id":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/"},"wordCount":335,"commentCount":0,"publisher":{"@id":"https:\/\/new.jeremywhittaker.com\/#\/schema\/person\/ed0edfdefb3e180693efef453372980c"},"image":{"@id":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#primaryimage"},"thumbnailUrl":"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-1024x351.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/","url":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/","name":"My Leaky Water Bill - How to Use Machine Learning to Detect Water Leaks - Jeremy Whittaker","isPartOf":{"@id":"https:\/\/new.jeremywhittaker.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#primaryimage"},"image":{"@id":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#primaryimage"},"thumbnailUrl":"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5-1024x351.png","datePublished":"2023-11-16T22:20:07+00:00","dateModified":"2023-11-16T22:21:01+00:00","breadcrumb":{"@id":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#primaryimage","url":"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5.png","contentUrl":"https:\/\/new.jeremywhittaker.com\/wp-content\/uploads\/2023\/11\/image-5.png","width":1553,"height":532},{"@type":"BreadcrumbList","@id":"https:\/\/new.jeremywhittaker.com\/index.php\/2023\/11\/16\/my-leaky-water-bill-how-to-use-machine-learning-to-detect-water-leaks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/new.jeremywhittaker.com\/"},{"@type":"ListItem","position":2,"name":"My Leaky Water Bill &#8211; How to Use Machine Learning to Detect Water Leaks"}]},{"@type":"WebSite","@id":"https:\/\/new.jeremywhittaker.com\/#website","url":"https:\/\/new.jeremywhittaker.com\/","name":"Jeremy Whittaker","description":"Research, software, markets, housing, and energy","publisher":{"@id":"https:\/\/new.jeremywhittaker.com\/#\/schema\/person\/ed0edfdefb3e180693efef453372980c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/new.jeremywhittaker.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/new.jeremywhittaker.com\/#\/schema\/person\/ed0edfdefb3e180693efef453372980c","name":"JeremyWhittaker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c8ac20e6dfa86b5f27ce9bffee4851099770cbea5ae7338a274865bfbc8c0218?s=96&d=retro&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c8ac20e6dfa86b5f27ce9bffee4851099770cbea5ae7338a274865bfbc8c0218?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c8ac20e6dfa86b5f27ce9bffee4851099770cbea5ae7338a274865bfbc8c0218?s=96&d=retro&r=g","caption":"JeremyWhittaker"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/c8ac20e6dfa86b5f27ce9bffee4851099770cbea5ae7338a274865bfbc8c0218?s=96&d=retro&r=g"},"sameAs":["http:\/\/www.jeremywhittaker.com","https:\/\/www.facebook.com\/WhittakerJeremy","https:\/\/www.linkedin.com\/in\/jeremywhittaker\/"],"url":"https:\/\/new.jeremywhittaker.com\/index.php\/author\/jeremywhittaker\/"}]}},"_links":{"self":[{"href":"https:\/\/new.jeremywhittaker.com\/index.php\/wp-json\/wp\/v2\/posts\/5236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/new.jeremywhittaker.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/new.jeremywhittaker.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/new.jeremywhittaker.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/new.jeremywhittaker.com\/index.php\/wp-json\/wp\/v2\/comments?post=5236"}],"version-history":[{"count":4,"href":"https:\/\/new.jeremywhittaker.com\/index.php\/wp-json\/wp\/v2\/posts\/5236\/revisions"}],"predecessor-version":[{"id":5244,"href":"https:\/\/new.jeremywhittaker.com\/index.php\/wp-json\/wp\/v2\/posts\/5236\/revisions\/5244"}],"wp:attachment":[{"href":"https:\/\/new.jeremywhittaker.com\/index.php\/wp-json\/wp\/v2\/media?parent=5236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/new.jeremywhittaker.com\/index.php\/wp-json\/wp\/v2\/categories?post=5236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/new.jeremywhittaker.com\/index.php\/wp-json\/wp\/v2\/tags?post=5236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}