<?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 Jeremy Stanley on Medium]]></title>
        <description><![CDATA[Stories by Jeremy Stanley on Medium]]></description>
        <link>https://medium.com/@jeremy.stanley?source=rss-eac4abbe4148------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*meNOHxUeltqyPijBh8E70A.jpeg</url>
            <title>Stories by Jeremy Stanley on Medium</title>
            <link>https://medium.com/@jeremy.stanley?source=rss-eac4abbe4148------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 30 May 2026 17:40:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jeremy.stanley/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[An All-In Founder Forum]]></title>
            <link>https://medium.com/@jeremy.stanley/an-all-in-founder-forum-8efe2c25f7b9?source=rss-eac4abbe4148------2</link>
            <guid isPermaLink="false">https://medium.com/p/8efe2c25f7b9</guid>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[founders]]></category>
            <category><![CDATA[venture-capital]]></category>
            <category><![CDATA[growth-mindset]]></category>
            <dc:creator><![CDATA[Jeremy Stanley]]></dc:creator>
            <pubDate>Wed, 17 May 2023 12:53:10 GMT</pubDate>
            <atom:updated>2023-05-17T12:53:10.223Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VxW42RLwCuICqM76APPhww.png" /><figcaption>The All-In Founder Forum retreat in Tahoe in 2023, from left to right: Dan, Kaitlyn, Laura, Jeremy, Abby, Colin, Celine, Mitch, and Jeffrey</figcaption></figure><p>“I can’t keep this up,” confided the founder to a group of supportive peers who had become close friends. “I burned out months ago, and now I’m at the point where… I can’t even find the words.” With their head in their hands, a heavy silence filled the air as the fellow founders on the call nodded in understanding and empathy.</p><p>“I know I need to slow down, but whenever I try, I feel like I’m losing control,” the founder continued. “My fear of failure, or really, my fear of proving my parent’s doubts about me, is just overwhelming.”</p><p>Although the above conversation is a fictional blend of real experiences, it captures the deep self-reflection many startup founders may need to face. Coping with such intense emotions can be debilitating, but founders don’t have to confront these challenges alone.</p><p>One year into COVID-19, <a href="https://firstround.com/">First Round</a> organized a series of remote Founder Forums. They assembled groups of early-stage founders and led them in six virtual sessions to share best practices, build community, and, perhaps most importantly, provide support as the world changed rapidly.</p><p>Founders are busy people. We have employees to hire, products to build, prospects to pitch, and investors to update. Devoting two hours every month was a daunting prospect. But we each chose First Round as our seed investor partly because of the strength and diversity of their community. So we committed and dove in.</p><p>Those early forums were great. But they were temporary by design, participation was inconsistent, and the subjects were mostly tactical. Over time, they would fade into the background noise of our early-stage journeys.</p><p>But <a href="https://www.linkedin.com/in/dsiroker/">Dan Siroker</a> had a plan. He had previously participated in forums organized by <a href="https://www.ypo.org/">YPO</a> while he was the co-founder and CEO of Optimizely. He wanted to take the best of what he had experienced in prior forums, optimize it for early-stage founders, and execute it virtually.</p><p>So Dan joined two of the First Round forums. After they concluded, he invited the most open and committed participants with varied backgrounds into a new forum that could live on indefinitely. We call this group the All-In Founder Forum, and our shared goal is to become the best versions of ourselves.</p><p>This post aims to inspire other founders to create similar forums. In addition to our story, we will share some of how we organize and sustain the forum. And in the end, we invite you to join us by applying for our one open spot.</p><p>The members include, from left to right in the header photo above, taken at our 2023 annual retreat in Tahoe:</p><ul><li><a href="https://www.linkedin.com/in/dsiroker/">Dan Siroker</a> at <a href="https://www.rewind.ai/">Rewind</a>, access perfect memory</li><li><a href="https://www.linkedin.com/in/kaitlynknopp/">Kaitlyn Knopp</a> at <a href="https://pequity.com/">Pequity</a>, compensate with confidence</li><li><a href="https://www.linkedin.com/in/lauradelbeccaro/">Laura Del Beccaro</a> at <a href="https://www.sora.co/">Sora</a>, seamless HR workflows</li><li><a href="https://www.linkedin.com/in/jeremystanley/">Jeremy Stanley</a> at <a href="https://www.anomalo.com/">Anomalo</a>, automate data quality</li><li><a href="https://www.linkedin.com/in/abigailholtz/">Abigail Holtz</a> at <a href="https://www.fromthelobby.com/">The Lobby</a>, scale influencer marketing</li><li><a href="https://www.linkedin.com/in/colinmorelli/">Colin Morelli</a> at <a href="https://www.sourcehealth.com/">Source</a>, improve patient outcomes</li><li><a href="https://www.linkedin.com/in/celinehh/">Celine Halioua</a> at <a href="https://loyalfordogs.com/">Loyal</a>, dog lifespan extension</li><li><a href="https://www.linkedin.com/in/mitchgordon1/">Mitch Gordon</a> at <a href="https://vertoeducation.org/">Verto</a>, begin college abroad</li><li><a href="https://www.linkedin.com/in/jeffreydietrich/">Jeffrey Dietrich</a> at <a href="https://www.rarebird.coffee/">Rarebird</a>, mental wellness coffee</li></ul><p>The All-In Founder Forum meets virtually for two hours every month on the fourth Wednesday from 2–4 pm PT. We also meet in person for a three-day yearly retreat in the first week of February.</p><p>During these meetings, we discuss topics that span our work, personal, and family lives. We discuss wins, losses, challenges, and everything in between. Nothing is off-limits. Everything is confidential. We go deep and are vulnerable with one another because we believe that is critical to becoming the best versions of ourselves.</p><p>When communicating with each other, we observe various depths of meaning:</p><ul><li>The first 20% are the cliff notes, which are cursory, sanitized, and generic</li><li>The next 60% are the meat of the story, the intellectually interesting details and logic</li><li>The next 15% are the feelings, both positive and negative, and how they affect us</li><li>The <a href="https://www.hessepartners.com/_files/ugd/9f7944_c12d4446fae441a89b1e7f4d30bb95fc.pdf">final 5%</a> is the layer <em>behind</em> those feelings, the deeper narratives and emotions we are often unaware of in ourselves</li></ul><p>We always encourage each other to find and explore that final 5%. We demonstrate by example, never judge one another, and share our support and love for one another through thick and thin.</p><p>This has led us through topics such as:</p><ul><li>Depression and anxiety and the struggle for happiness</li><li>Love and empathy and the beauty of relationships</li><li>Narcissism and selfishness and the guilt they leave behind</li><li>Glory and satisfaction in achieving the perceived impossible</li><li>Childhood trauma and challenges and the reverberations that echo</li><li>Intelligence and creativity and the wonder of creation</li></ul><p>Sharing this 5% may seem dramatic, scary, or indulgent. But every time someone goes there (and it happens often), we discover something new about ourselves. And our bond strengthens.</p><p>We want the All-In Founder Forum to last forever. But that takes a great deal of thoughtfulness and commitment. So we set high expectations for when and how we participate in these sessions and meetings.</p><p>Every member attends the in-person retreat and keeps work to the barest possible minimum during those days. We began our last retreat by sharing what we had each given up to participate. They included:</p><ul><li>Missing time with family, children, and beloved pets</li><li>Delegating or delaying mission-critical customer or development activity</li><li>Stepping away from a fundraising process</li><li>Navigating layoffs or restructuring</li></ul><p>This reinforced how important the retreat was to each of us and highlighted what, if anything, might still be distracting us.</p><p>We also hold ourselves accountable. We have a written charter to which we have all committed, outlining our norms and responsibilities. We have defined roles for moderation, logistics, and recruiting, which rotate annually.</p><p>In addition, every member is expected to attend every monthly virtual session, arrive on time, and remain through the end.</p><p>This may sound extreme, but the temptation to de-prioritize this forum is high in any given week. It is important to us, but it is never urgent. If we succumb, then the group dynamics suffer. We don’t share the same journey, we don’t benefit from each other’s wisdom, and resentment can build.</p><p>In the last year, members attended the sessions fully 84% of the time, arrived late or left early 9%, and missed only 7% of the time (vacations). We take attendance seriously and enforce it strictly.</p><p>We organize each session roughly as follows:</p><ul><li>[3 min] Transition</li><li>[2 min] Short meditation to clear our minds</li><li>[1 min] Confidentiality reminder</li><li>[5 min] Check-in: on a scale from 0 to 100%, how present are you, and what, if any, urgent items might distract you today</li><li>[45 min] Updates — what’s the ONE business, family, or personal update since our last forum you want to share with the group and the 5% feeling associated with it?</li><li>[5 min] Break</li><li>[60 min] <a href="https://drive.google.com/file/d/1-6_uuL9ajhMFVzM1ZEGD-MPoeUidhwCu/view">Four-Step Forum Exploration</a>, where one member who is stuck on something goes deep into their challenge, and we help explore their circumstances and feelings, what they need from the forum, how our own experiences resonate with their challenge, and how we can support them going forward</li></ul><p>Combined with our devoted attention, these ingredients lead to meaningful and valuable sessions and a tightly bonded group of friends. When individuals need urgent support on specific topics, we organize infrequent and optional ad-hoc meetings, usually on the weekend.</p><p>Our paths as founders can be lonely, harrowing, and deeply gratifying experiences. We are often isolated from our teams, co-founders, friends, and loved ones. Most of us will fail, and our journeys are rollercoasters of extreme highs and lows.</p><p>But we chose this path, and we are privileged to have the opportunity to dedicate ourselves to creating new businesses. The struggles we encounter create lives that are more worth living. The All-In Founder Forum has amplified our experiences.</p><p>We hope this post inspires others to create new founder forums that can have the same impact as ours. But we are also recruiting a tenth member to join us. We seek candidates who:</p><ul><li>Are founders of venture-backed startups that are varied and non-competitive</li><li>Are individuals who will embrace vulnerability and commitment</li><li>Will enhance the diversity of ethnicity, gender, identity, experience, and personality in our forum</li></ul><p>If you are interested in joining us, please tell us more about yourself and your startup <a href="https://forms.gle/459Bxss4VgKVpKDX9">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8efe2c25f7b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting Extreme Data Events]]></title>
            <link>https://medium.com/anomalo-hq/detecting-extreme-data-events-719a06885a1e?source=rss-eac4abbe4148------2</link>
            <guid isPermaLink="false">https://medium.com/p/719a06885a1e</guid>
            <category><![CDATA[outlier-detection]]></category>
            <category><![CDATA[data-quality]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Jeremy Stanley]]></dc:creator>
            <pubDate>Tue, 16 Nov 2021 16:53:51 GMT</pubDate>
            <atom:updated>2021-11-16T16:53:51.546Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Automatically detect and understand extreme events in real-world data</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nw7tsZBHz59Uu0ew9M0bgw.png" /></figure><p>When analyzing data, we often think about high-level metrics — how much revenue did we generate yesterday? How many users queried this API end-point? How many times was this product purchased?</p><p>But sometimes these high-level metrics can become heavily skewed by extreme events.</p><p>For example, a bug in processing a discount code can allow a customer to checkout with a -$10 shopping cart. This might go unnoticed for a while, allowing the code to be shared online. Now thousands of customers are checking out with negative shopping carts, affecting your revenue and profitability metrics.</p><p>In other cases, such events don’t affect metrics, but can still negatively impact your business. For example, a new IP address can begin generating 3% of your site visits because a competitor is scraping your site. If undetected, the competitor can spend days or weeks with unrestricted access to your content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VhNa90WQ8xSs9Z2ADJnTXA.png" /><figcaption>How many black swans are lurking in your data lake?</figcaption></figure><p>Staying on top of these rare events can be a daunting task in a warehouse containing 100s of tables with 1,000s of columns and millions or billions of rows of data. As such, an automated solution is crucial.</p><p>Such rare events are called <em>outliers. </em>And in the rest of this article, we’ll briefly cover traditional outlier detection approaches and why they don’t work well for most real-world use cases.</p><p>Then we’ll explain our automated solution to outlier detection, and show examples using public data from New York 311 incident reports.</p><p>There are many algorithmic approaches to detecting outliers in samples of data. For example, from the <a href="https://scikit-learn.org/stable/auto_examples/miscellaneous/plot_anomaly_comparison.html#sphx-glr-auto-examples-miscellaneous-plot-anomaly-comparison-py">sci-kit learn documentation</a>, we have this comparison of techniques on a toy dataset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ntDo3Adwq-Y3e46Cqi4CKA.png" /><figcaption>Example outlier detection methods applied to a simple two-dimensional dataset.</figcaption></figure><p>In the above visualization, each column is an outlier detection method. Each point is colored blue if the approach has classified it as an outlier and orange otherwise.</p><p>In this example, all of these methods appear to be reasonable. But such “toy” datasets fail to capture the complexity of identifying outliers for a real business amassing vast volumes of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T5hqAR2YRzQtAlVt9VybtA.png" /></figure><p>Real-world applications have tens or hundreds of columns of data in a wide range of formats, not just two continuous values. Data also changes over time — what was an outlier six months ago may have become a regular event today.</p><p>There are also many outliers in real-world datasets that are simply irrelevant. The user that bought 500 lemons may be an outlier, but the business may not need to do anything in response.</p><p>Finally, such approaches can be challenging to interpret, especially when working with large datasets. Understanding why a specific data point is an outlier is critical to informing any action taken.</p><p>At Anomalo, we have taken a practical approach to outlier identification with our Entity Outlier check.</p><p>First, we narrow the scope of the problem by requiring two pieces of input:</p><ol><li>What type of <em>entity</em> do we want to identify as an outlier?</li><li>What specific <em>metric</em> do we want to evaluate for outliers?</li></ol><p>For example, if we want to detect when new IP addresses begin scraping our site, then the IP address would be the <em>entity,</em> and site visits would be the <em>metric</em>.</p><p>Then we apply time series anomaly detection and root cause analysis techniques to provide very reliable, clear, and relevant outlier detection.</p><p>As an example, consider the following configuration for the <a href="https://console.cloud.google.com/marketplace/product/city-of-new-york/nyc-311">New York 311 call service request data</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pt0nWLG5qHi3BnPSOIE2bw.png" /><figcaption>Configuring an entity outlier check in Anomalo</figcaption></figure><p>The entity we are monitoring here is the incident_address, which is the location in NY where the 311 incident report occurred. And the metric we are evaluating is the number of complaints per address, computed using the count(1) SQL snippet.</p><p>We are trying to answer the question: <em>were there any addresses with an exceptionally high number of complaints on the most recent date</em>?</p><p>The check creates a dataset that has the following shape:</p><ul><li>address: where the call was reported from</li><li>date: reporting date</li><li>complaints: the number of complaints from that address on this date</li></ul><p>We then take the maximum number of complaints by date, creating a time series with this shape:</p><ul><li>date: reporting date</li><li>max_complaints: the maximum number of complaints received by a single address on this date</li></ul><p>Then we can model this as a time series and detect if there is an outlier on the most recent date:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BCYT9ve5052znOjP" /><figcaption>The time series of the maximum number complaints per address in the 311 complaints data, with July 18th shown as a clear outlier</figcaption></figure><p>On most days, the maximum number of complaints is between 10 and 50, with regular spikes upwards of 500. But on the most recent date, July 18th, there was an address with 2,227 complaints, which is truly exceptional!</p><p>We can then automatically see which locations were responsible for this massive surge in complaints:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KnjmnmwULd7cnQH0" /><figcaption>The address 672 East 231st Street clearly has far more complaints than any of the other top addressess</figcaption></figure><p>We then automatically profile all of the complaints about this address and compare them to other incidents that occurred on the same day to identify what segments characterize them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FmE6gj6qFyCZWRtq" /><figcaption>A root cause analysis of the spike in complaints, indicating that they are all for “Loud Music/Party”</figcaption></figure><p>In particular, it looks like 100% of the complaints at this location were of the ‘Loud Music/Party’ description, compared to only 35% of all other complaints on July 18th.</p><p>Either this was an epic party that irritated more than 2,000 people. Or a few people submitted complaints over and over again out of frustration. (Note that there is no information about <em>who</em> submitted the complaint in this dataset, so we can’t tell for sure.)</p><p>Extreme events can be incredibly important — in the words of Nassim Nicholas Taleb:</p><blockquote>“I know that history is going to be dominated by an improbable event, I just don’t know what that event will be.” — Nassim Nicholas Taleb</blockquote><p>Finding extreme events in a modern cloud data warehouse filled with Terabytes or Petabytes of data can be a very daunting task. Most outliers are meaningless.</p><p>But by narrowly focusing on key entities and metrics, and using robust time series models and root cause analysis techniques, we can clearly and automatically identify and explain the important ones.</p><p>Working with our customers, Anomalo has developed a targeted outlier detection approach that is easy to configure, well-calibrated, and provides rich and actionable context for users.</p><p>To get started with Anomalo, and begin identifying outliers pro-actively in your data, be sure to <a href="https://www.anomalo.com/requestademo">request a demo</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=719a06885a1e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anomalo-hq/detecting-extreme-data-events-719a06885a1e">Detecting Extreme Data Events</a> was originally published in <a href="https://medium.com/anomalo-hq">Anomalo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effective Data Monitoring]]></title>
            <link>https://medium.com/anomalo-hq/effective-data-monitoring-8bce3ddf87b4?source=rss-eac4abbe4148------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bce3ddf87b4</guid>
            <category><![CDATA[data-quality]]></category>
            <category><![CDATA[data-observability]]></category>
            <category><![CDATA[data-monitoring]]></category>
            <category><![CDATA[analytics-tool]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Jeremy Stanley]]></dc:creator>
            <pubDate>Wed, 17 Mar 2021 14:59:52 GMT</pubDate>
            <atom:updated>2021-03-17T14:59:52.351Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Ten steps to ensure your data monitoring solution is effective.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d4PeCvy8a0epLqCujIMPzQ.jpeg" /></figure><p>Every time a data alert fires (or fails to fire), one of four possible outcomes occurs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lZaM40axPVc9D0BucvWt-g.png" /></figure><p>In a perfect world, every alert received would be about a real data quality issue you cared about (<em>a true positive</em>). No alerts would be sent when there were no issues you cared about (<em>a true negative</em>).</p><p>In reality, most data quality monitoring solutions are far from perfect. They send alerts that are not useful (<em>false positives</em>). These distract your data team and erode confidence in your monitoring solution.</p><p>Or real data quality issues are missed by the monitoring tool <em>(false negatives</em>). These compromise your business decisions and data products and erode trust in your data.</p><p>In this article, we will cover ten steps you can take to reduce false positive and false negative alerts and to mitigate their impact when they do occur.</p><p><strong>1. Use dynamic data testing strategies</strong></p><p>Most data testing strategies begin with simple rules, such as:</p><ul><li>column x is never NULL</li><li>table y row count is between 1,000,000 and 2,000,000</li></ul><p>These rules are perfect for cases where you know <em>exactly</em> how you want your data to behave. But they come with several drawbacks:</p><ul><li>Any violation of the rule, no matter how small, generates an alert.</li><li>They require time from data subject matter experts to create.</li><li>They may need frequent maintenance over time as your data changes.</li></ul><p>You can reduce your false positives and false negatives by using <a href="https://medium.com/anomalo-hq/dynamic-data-testing-f831435dba90">dynamic data testing</a> strategies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IXlPdG3D1iB2mHji" /><figcaption>A predicted range test, which utilizes a time series model, effectively identifies the spike in NULL % without any manual configuration or maintenance.</figcaption></figure><p>Dynamic tests use time series models (or other machine learning techniques) to adapt to your data over time and alert only when there is a sudden meaningful change. Such tests require less work to set up and increase test coverage while reducing false positives caused by misconfiguration or data drift over time.</p><p><strong>2. Check only the latest data by default</strong></p><p>By default, your platform should only check the most recent data in a table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sgXSH91nHhXMjV6aEA2dXw.png" /><figcaption>Checking the latest data should be a default that users can easily turn off.</figcaption></figure><p>Limiting checks to the latest data saves data warehouse costs and reduces false positive alerts from historical data that you no longer care to fix. It should be easy for users to disable this for any tables that are not append-only.</p><p>Checks can also keep track of their run history and send notifications only when encountering new issues in the table.</p><p><strong>3. Support no-code configuration changes</strong></p><p>Inevitably a data quality rule will generate a false positive alert. In these cases, users should be able to adjust their checks easily. Users will be reluctant to make changes if they have to edit code or change a complex YAML configuration file.</p><p>The types of changes users often make include:</p><ul><li>Widening the expected range for a data outcome</li><li>Narrowing the scope of a rule using a where SQL clause</li><li>Waiting for updated-in-place data to arrive before applying a rule</li><li>Changing thresholds for machine learning alerts</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P7w1GMeUDcV7ov_thm5f4w.png" /><figcaption>Advanced options for adjusting a key metric or data validation rule that can reduce the risk of false-positive and false-negative alerts.</figcaption></figure><p>The UI to make changes should be one click away from the alert. It should be easy to understand and well documented. Finally, there should be an audit trail of changes to allow for easy reversion if needed.</p><p><strong>4. Prioritize your data quality rules</strong></p><p>Not all data quality rules are equally important. In some cases, users may be experimenting with the platform and don’t want to be alerted. In other cases, rules may be critically important, and any deviation from expected behavior should generate loud alerts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FHEHH_RtcpgDeFFD-XvL3Q.png" /></figure><p>In addition to changing alert behavior, priority levels can also change how alerts or tables appear in dashboards based upon the severity of failing alerts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JYLSyjXpzLzsPumZjbFQDw.png" /><figcaption>The first table has two failing alerts — including one that is a high priority. The second table has one failing alert. Whereas the third and fourth tables have low-priority alerts, and the fifth table passed without issues.</figcaption></figure><p><strong>5. Use APIs to run high priority rules in your pipelines</strong></p><p>For data validations where you have very high confidence that any issues would be real and have significant adverse consequences, it can make sense to run these alerts <em>in your pipelines</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rhGe4VSCnoy9puEOos9lYw.png" /><figcaption>An example of how data quality checks can be run in a pipeline to quarantine and avoid publishing bad data.</figcaption></figure><p>For example, in Apache Airflow, you could use an API to execute data quality checks on transformed data and then poll for check results and publish data if there are no failures.</p><p>If a check does fail, you could run automated tasks to fix the bad data, abort the remainder of the DAG (sometimes, no data is better than bad data), or quarantine bad records using SQL produced in the API to query for good and bad data.</p><p><strong>6. Cluster similar issues together into single alerts</strong></p><p>Data quality issues often strike multiple columns or segments of data at the same time. Such cases should be correlated together into a single alert if they affect the same rows of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZdSUt-5tIb4d0Ntj6lSxHQ.png" /><figcaption>Three columns had an increase in NULL values on the same set of records, and so are clustered together in this alert.</figcaption></figure><p>In the above (masked) alert, three of 88 columns have an unusual increase in NULL values in the same rows of data. Clustering reduces the number of alerts the team has to review and can help identify the underlying issue.</p><p><strong>7. Scan samples of raw data rows for any unexpected changes</strong></p><p>With many important source tables, each containing hundreds of data columns, manually specifying and managing data quality rules for each source and column is untenable.</p><p>Instead, use <a href="https://medium.com/anomalo-hq/unsupervised-data-monitoring-36cb2304c61e">unsupervised data monitoring</a> to scan random samples of rows in source tables for significant anomalies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XUAfMfXhZJcS0Fnn.png" /><figcaption>A time-series view of table anomalies in a BigQuery public COVID dataset. The table columns are on the vertical axis and time is on the horizontal axis. The circle sizes correspond to the strength of the anomalies.</figcaption></figure><p>A summary like the one above can be reviewed regularly to quickly identify unexpected and concerning changes that should be addressed and monitored explicitly in the future.</p><p><strong>8. Route notifications to teams with ownership and accountability</strong></p><p>Many companies initially route all of their data quality alerts to a single channel in Slack or Microsoft Teams. However, users in that channel will have to ignore many alerts they may not be interested in. A single channel can also reduce the accountability for addressing individual alerts, as they are easily lost in the channel noise.</p><p>Instead, a best practice is to set up separate channels for individual teams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ym4Pwc4hEFziQxozZw2dvA.png" /></figure><p>In each team channel, you can include users who depend upon or maintain the tables that are routed to that channel. As alerts arrive, they can use emoji reactions to classify their response to alerts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZEfw0e82zPjQIBmM7rZS_w.png" /><figcaption>Examples of common emoji reactions to alerts in Slack or Microsoft Teams.</figcaption></figure><p>Common reactions include:</p><ul><li>✅ the issue has been fixed</li><li>🔥 an important alert</li><li>🛠️ a fix is underway</li><li>🆗 expected behavior, nothing needed</li><li>👀 under review</li></ul><p>Or users can @ mention their colleagues in a thread to diagnose and resolve the underlying issue.</p><p><strong>9. Provide actionable context for issues to accelerate triage</strong></p><p>When an alert fires, it is frustrating to get a message like:</p><pre>column user_id in table fact_table has NULL values</pre><p>This alert puts the onus on the user to answer questions like:</p><ul><li>Why does this alert matter?</li><li>What # and % of user_id values are affected?</li><li>How often has this alert failed in the recent past?</li><li>Who configured this alert, and why?</li><li>What dashboards or ML models depend on fact_table?</li><li>What raw data source contributed user_id to fact_table ?</li></ul><p>Notifications should include this information directly or link to data catalog platforms that do.</p><p>Additionally, notifications should include samples of raw data that highlight good and bad values:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bXOjdWSFfHTMWXw8xKwtGw.png" /><figcaption>Sample bad rows (with NULL timestamp values) compared to good rows.</figcaption></figure><p>Advanced statistical methods can analyze the underlying data and produce root cause analyses that identify exactly <em>where</em> the issue is occurring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wC7-5h15Rb_XEZtd.png" /><figcaption>A root cause analysis that identifies the segments of data (venuestate = ‘NY’ in this case) that most clearly identify <em>where the underlying data quality issue has occurred.</em></figcaption></figure><p><strong>10. Collect and learn from user feedback</strong></p><p>Inevitably, your data quality solution will send alerts that are not useful. In these cases, it is important to collect that feedback.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-lMBYCPnEs03jhNvk8eDg.png" /><figcaption>An example of buttons used to provide feedback on an alert.</figcaption></figure><p>Over time, a data quality monitoring solution can be tuned using machine learning to suppress alerts that users do not find useful.</p><p>To effectively monitor your data, your system should produce comprehensive, targeted, and accurate alerts.</p><p>First, be sure to minimize false-positive alerts. Migrate static tests to more intelligent dynamic tests that adjust with your data. Ensure users can adjust alert priorities and subscribe to notifications they care about. Check only the latest data by default and make it easy for rules to be edited.</p><p>Next, reduce the burden on users of false-positive alerts. Cluster similar issues together and provide the right with alerts. Use API integrations to prevent bad data from continuing through pipelines. Then ensure your system can adapt to user feedback over time.</p><p>Finally, make your testing strategy comprehensive enough that you do not miss real data quality issues (false negatives). Use dynamic testing and user-friendly interfaces to make configuring alerts easy. And leverage row-level unsupervised monitoring to scan for issues your other alerts miss.</p><p>Combined, these solutions ensure your alerts are high quality, your users are productive and engaged, and the quality of the data you depend upon keeps increasing over time.</p><p>To learn more about how data teams use Anomalo to reduce false positive and false negative alerts, <a href="https://www.anomalo.com/requestademo">request a demo</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bce3ddf87b4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anomalo-hq/effective-data-monitoring-8bce3ddf87b4">Effective Data Monitoring</a> was originally published in <a href="https://medium.com/anomalo-hq">Anomalo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unsupervised Data Monitoring]]></title>
            <link>https://medium.com/anomalo-hq/unsupervised-data-monitoring-36cb2304c61e?source=rss-eac4abbe4148------2</link>
            <guid isPermaLink="false">https://medium.com/p/36cb2304c61e</guid>
            <category><![CDATA[anomaly-detection]]></category>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[data-quality]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Jeremy Stanley]]></dc:creator>
            <pubDate>Tue, 26 Jan 2021 16:33:08 GMT</pubDate>
            <atom:updated>2021-01-26T16:46:39.863Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 1 — Monitoring the quality of structured data at scale</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oUpVgqDLCGcjQ45yACLJtw.jpeg" /></figure><p>To compete in a data-driven world, organizations must consolidate data into centralized warehouses and use it to enhance products and inform decisions.</p><p>Data is now a strategic asset. But how can organizations ensure they can trust the data underpinning these products and decisions?</p><p>Most data teams conclude that they need to begin testing their data — using a carefully maintained library of rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bx2K1OkAjVfQ2Ogo1Z5gfg.png" /><figcaption>The Sisyphean task of creating and maintaining data quality rules in large warehouses. <em>Credit: Josie Stanley.</em></figcaption></figure><p>But monitoring <em>all</em> of the data in an enterprise warehouse can be daunting. It is common for such warehouses to contain tens of thousands or even hundreds of thousands of tables.</p><ul><li><strong>Top 10 tables<br></strong>Drive board-level metrics and company goals</li><li><strong>Top 100 tables<br></strong>Cross-functional data that inform product and operations</li><li><strong>Top 1,000 tables<br></strong>Detailed data owned by single teams driving process and products</li><li><strong>Remaining 1,000+ tables<br></strong>Special purpose project or feature data</li></ul><p>The critical tables in an organization should be <em>thoroughly</em> tested and monitored. See our <a href="https://medium.com/anomalo-hq/airbnb-quality-data-for-all-a4ca6b4c97e6">Airbnb-quality data for all</a> post for details on how that can be achieved. But what about the rest?</p><p>If the average table contains 50 columns, and each column requires 5 rules or metrics to be well monitored, then a warehouse with 1,000 important tables requires managing 250,000 rules!</p><p>Even if each rule requires just 10 minutes to maintain each year, that would require a dedicated team of 20 highly trained data professionals (most of whom would quickly quit in protest of the drudgery):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XqnCnfoGSz9ZyshXhaZucQ.png" /></figure><p>Yet, an organization still depends upon the quality of that data. This is where <em>unsupervised data monitoring </em>can be critical.</p><p>Uber summarized this well in their post on <a href="https://eng.uber.com/monitoring-data-quality-at-scale/">Monitoring Data Quality at Scale</a>:</p><blockquote>Conventional wisdom says to use some variant of statistical modeling to explain away anomalies in large amounts of data. However, with Uber facilitating 14 million trips per day, the scale of the associated data defies this conventional wisdom. Hosting tens of thousands of tables, it is not possible for us to manually assess the quality of each piece of back-end data in our pipelines.</blockquote><p>This first post in the series will demonstrate how <a href="https://www.anomalo.com/">Anomalo</a> uses unsupervised learning to monitor data quality at scale. In subsequent posts, we will cover:</p><ul><li>The key requirements of our system and why traditional time series and outlier detection approaches do not work</li><li>The architecture of the Anomalo unsupervised learning system — from modeling the data to explaining root causes of issues</li><li>How we define and minimize false positives, and how we benchmark our algorithm using our data chaos library</li></ul><p><strong>The role of unsupervised data monitoring</strong></p><p>To illustrate how our <em>unsupervised monitoring </em>works, we will use a simple demo environment with just one table, public.fact_listing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gF8nNgmsgtqcwh44jbZWfA.png" /><figcaption>A single table of concert and sporting event ticket sales data configured in a demo warehouse.</figcaption></figure><p>This is a demo dataset of concert and sporting event ticket sales data. You can see that we have 3 checks passing on this table and that the checks run daily when the data is fresh.</p><p>Clicking into the table presents the table homepage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A5G8QDZhIWLO5iwxX03bVw.png" /><figcaption>The table home page, where new checks are added and check results are inspected.</figcaption></figure><p>As you can see, <strong>Data freshness</strong> has already run for this table, which determines when the data is complete each day, and automatically kicks off all other checks.</p><p>At the bottom are <strong>Key metrics</strong> and <strong>Validation rules </strong>sections where the user would leverage our time series models or library of custom validations to check their data.</p><p>In-between is the <strong>Table anomalies</strong> section, which contains two checks that are automatically configured for any monitored table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w8KjuiziEv8UzaAG_7ogGg.png" /><figcaption>The two unsupervised learning variants used to identify table anomalies.</figcaption></figure><p>Our machine learning model learns a representation of the typical data in the table. As new data arrives, it detects if that data is meaningfully different from what appeared in the table before.</p><p>We run two variants of this algorithm:</p><ul><li><em>no increase in NULL values<br></em>A constrained model looking for significant increases in NULL values</li><li><em>no anomalous records<br></em>Our full machine learning algorithm, which identifies changes in continuous distributions, categorical values, time durations, or even relationships between columns</li></ul><p>The first variant runs at a high priority level and notifies users when a sudden spike in NULL values is observed, as this may indicate missing data that should be fixed quickly. The second variant, <em>no anomalous records</em>, produces a log of meaningful changes in each table.</p><p>For example, in this <a href="https://console.cloud.google.com/marketplace/product/university-of-oxford/covid19_govt_policy?project=data-quality-testing&amp;folder=&amp;organizationId=">Oxford COVID-19 Government Response dataset in BigQuery</a>, in the column public_information_campaigns_flag, the value 1 almost entirely disappeared and was replaced with NULL values on October 30th.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZ4cF4HlaSro-EX-05Exjg.png" /><figcaption>A time-series view of table anomalies in a BigQuery public COVID dataset. The table columns are on the vertical axis and time is on the horizontal axis. The circle sizes correspond to the strength of the anomalies.</figcaption></figure><p>Of course, not all columns are important, and so the user can control which tables and columns they wish to see notifications for.</p><p><strong>Finding and characterizing data chaos with unsupervised learning</strong></p><p>To illustrate how this works in practice, let’s introduce an anomaly into this dataset. We will use our command-line client to trigger one of our <em>chaos</em> operations: TimeColumnZero. This introduces zero values into a column at a specific point in time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ABUDz1XPyWcG7O9ekEEG6Q.png" /><figcaption>Causing chaos in a table by inserting zero values into a column on a given date for a subset of rows.</figcaption></figure><p>The column numtickets in fact_listing will now contain 30% zero values on 2021–01–17 whenever the venuestate is equal to “NY.” This illustrates a common data quality issue — an invalid value suddenly appears for a fraction of rows in a key data segment.</p><p>Next, we can re-run the table anomaly checks, and we find that the no anomalous records variant fails (as it is looking for <em>any</em> meaningful change):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KcAAPzXf9-MHT2GrBCNAWQ.png" /><figcaption>A failing table anomaly check after having introduced chaos into the table.</figcaption></figure><p>We can click into <em>view details </em>to see the explanation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XEDKkygxxg38fEITxZi8WQ.png" /><figcaption>Summarizing the anomaly in natural language and evaluating its severity.</figcaption></figure><p>The table anomaly check has correctly identified that the column numtickets has a sudden increase in 0 values. Note that we never told it to look at this column or to look for zero values.</p><p>It also scores the anomaly&#39;s severity (this one is strong) and compares that to a learned threshold for this table, which accounts for how much background noise there is in each column. Because the severity exceeds the threshold, this check fails and is highlighted in the user interface (and could notify the user in Slack or Teams).</p><p>Scrolling down, we see a custom visualization selected based on the anomaly type and data distribution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wDGLjTpz-mFgyz55UGYjNA.png" /><figcaption>The algorithm chooses a dynamic visualization to help contextualize the anomaly, in this case showing the distribution of the top values in the column on the prior and current dates as a tornado.</figcaption></figure><p>In this case, a <em>top values</em> chart shows the most common numtickets values and compares the distribution on 2021–01–16 (the left bars) to the distribution on 2021–01-17 (the right bars). You can see that the value 0 was not there before and is now suddenly 10.4% of records.</p><p>Scrolling further, we can see the <em>Root Cause Explanation</em>, which analyzes the raw data underlying our unsupervised model to identify if there are segments of the data where the issue is most prominent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v2n3f4ir9THBnZZGtc1JIw.png" /><figcaption>A root cause analysis performed to identify <em>where the anomalous records occurred.</em></figcaption></figure><p>As you can see, the algorithm correctly identifies that NY is where the anomaly occurred. 100% of the anomalous rows are in that state, but only 29.8% of the population rows are in NY.</p><p>This automatic identification of <em>where</em> an issue occurs is powerful. Without it, a user would need to examine records, trace lineages, or repeatedly query and visualize the data to isolate the issue.</p><p>The algorithm can find even more complex issues, such as when the relationship changes between columns. For example, consider this chaos operation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9NVBkM12Tjfn2KISLwJn4w.png" /><figcaption>Introducing a more complex form of chaos, where a single column is randomly shuffled on a date.</figcaption></figure><p>Here we are <em>shuffling </em>the priceperticket column so that the values no longer correspond to the correct rows. The actual values remain the same (and have the same distribution and mean), but the relationship between that column and other columns in the table has been broken.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8Gdmp9_1INcW_m4z0qHgA.png" /><figcaption>In this case, the anomaly cannot be easily summarized in natural language, but we can still score its severity.</figcaption></figure><p>In this case, the algorithm identifies that priceperticket is the most problematic column, and that the issue is related to listid and totalprice as well.</p><p>Examining the distribution of priceperticket values on 1/16 and 1/17 shows that the anomaly is the strongest in the lowest and highest priceperticket values:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*auINSv826DQlNajLVKj2Tg.png" /><figcaption>This visualization bins the continuous column into deciles. While the distribution is unchanged between the two days, we can see that the anomaly severity (color) is more intense in extreme deciles.</figcaption></figure><p>We can examine a sample of individual rows, where we can see that the algorithm is scoring <em>every value </em>in the table for how anomalous it is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T1k0V5_OFJCJtocnRCz7pA.png" /><figcaption>The most anomalous row in a sample of the data — with color indicating how much credit each value contributed towards the anomaly.</figcaption></figure><p>In this example, the $1,960 price per ticket doesn’t make any sense in the context of 28 tickets for $1,568. Plus, the price per ticket is unusually high for the Vampire Weekend show.</p><p>Zooming out, we can see this effect across many rows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f1HLqZiX9B2t876cIMiF0g.png" /><figcaption>The most anomalous 25 rows in a sample of the table, again colored by how much each value contributed to the anomaly.</figcaption></figure><p>Now you can more clearly see which specific values of the table the algorithm believes are contributing the most to the anomaly, as indicated by the severity color scale on the right-hand side.</p><p>This granular allocation of the anomaly into the table&#39;s specific values is key. It allows our system to visualize and explain the underlying issue clearly.</p><p>When embarking on a journey to monitor and test data quality in your warehouse, it makes sense to start simple. You can use open source libraries, write your own tests, or leverage a platform like ours at Anomalo to thoroughly test your data.</p><p>But as warehouses, organizations, and testing ambitions scale, simple rule and time series based approaches fall over. They cannot effectively cover the long tail of data quality issues that commonly occur.</p><p>That is where <em>unsupervised data monitoring </em>comes in. You leverage a machine to learn the structure of your data and monitor for significant unexpected changes. It notifies you when a meaningful negative change occurs and presents you with visual summaries and explanations that dramatically accelerate your triage and resolution times.</p><p>Stay tuned for our next post in this series, which will explain how our unsupervised algorithm works behind the scenes.</p><p>To get started with Anomalo, and begin monitoring your data at scale using our algorithms, be sure to <a href="https://www.anomalo.com/requestademo">request a demo</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36cb2304c61e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anomalo-hq/unsupervised-data-monitoring-36cb2304c61e">Unsupervised Data Monitoring</a> was originally published in <a href="https://medium.com/anomalo-hq">Anomalo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Airbnb-quality data for all]]></title>
            <link>https://medium.com/anomalo-hq/airbnb-quality-data-for-all-a4ca6b4c97e6?source=rss-eac4abbe4148------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4ca6b4c97e6</guid>
            <category><![CDATA[airbnb]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[data-quality]]></category>
            <category><![CDATA[anomaly-detection]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Jeremy Stanley]]></dc:creator>
            <pubDate>Wed, 02 Dec 2020 16:33:00 GMT</pubDate>
            <atom:updated>2020-12-02T16:33:00.663Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How to build and maintain high quality data without raising billions</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPmlqEZk6LGPqVn0TpyjzQ.png" /></figure><p>Airbnb has always been a data driven company.</p><p>Back in 2015, they were laying the foundation to ensure that <a href="https://medium.com/airbnb-engineering/at-airbnb-data-science-belongs-everywhere-917250c6beba">data science was democratized at Airbnb</a>. Meanwhile, they have grown to more than 6,000 people and have raised more than $6b of venture funding.</p><p>To <strong><em>stay</em></strong><em> </em>data driven through this massive change has required making big investments in data quality, as outlined by their recent Data Quality at Airbnb series: <a href="https://medium.com/airbnb-engineering/data-quality-at-airbnb-e582465f3ef7">Part 1 — Rebuilding at Scale</a> and <a href="https://medium.com/airbnb-engineering/data-quality-at-airbnb-870d03080469">Part 2 — A New Gold Standard</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mcc0hDZQ6BFF6PjqdAbh7Q.png" /><figcaption>The first two Data Quality at Airbnb posts: <a href="https://medium.com/airbnb-engineering/data-quality-at-airbnb-e582465f3ef7">Part 1 — Rebuilding at Scale</a> and <a href="https://medium.com/airbnb-engineering/data-quality-at-airbnb-870d03080469">Part 2 — A New Gold Standard</a></figcaption></figure><p>Companies aspiring to be as data driven and successful as Airbnb will also need to prioritize data quality.</p><p>It does not matter how much data is collected, how fast it can be queried, how insightful analyses are or how intelligent a machine learning model is. If the underlying data is unreliable and of poor quality, then everything that depends upon it will also be suspect.</p><p>Fortunately, companies no longer need to reinvent the wheel or make massive investments to improve and maintain high quality data. New startups, such as ours at <a href="https://www.anomalo.com/">Anomalo</a>, are building the technology needed to monitor, triage and root cause data quality issues efficiently at scale.</p><p>In their first post, <a href="https://medium.com/airbnb-engineering/data-quality-at-airbnb-e582465f3ef7">Part 1 — Rebuilding at Scale</a>, Airbnb set the following goals for themselves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uDe6rZsn1jWYz5L3WwBMZg.png" /><figcaption>The five data quality goals set by Airbnb in <a href="https://medium.com/airbnb-engineering/data-quality-at-airbnb-e582465f3ef7">Part 1 — Rebuilding at scale</a>, and where <a href="https://www.anomalo.com/">Anomalo</a> can help.</figcaption></figure><p>All of these investments are critical, and projects like <a href="https://www.getdbt.com/">dbt</a> are making it easier to build high quality data pipelines, and there are <a href="https://eugeneyan.com/writing/data-discovery-platforms/">many open source data discovery tools under development</a>.</p><p>But in this article I want to focus on two of their goals in particular: ensuring important data meets SLAs and is trustworthy and routinely validated.</p><p>In their latest post, <a href="https://medium.com/airbnb-engineering/data-quality-at-airbnb-870d03080469">Part 2 — A New Gold Standard</a>, Airbnb outlines the following automated data quality checks they run to validate important datasets:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ATchG2VZMRgTWt17ho-rCA.png" /><figcaption>The data quality checks Airbnb runs on important datasets, from <a href="https://medium.com/airbnb-engineering/data-quality-at-airbnb-870d03080469">Part 2 — A New Gold Standard</a>.</figcaption></figure><p>To summarize, Airbnb has the following key requirements:</p><ol><li><strong>Row count time series analysis<br></strong>Has the table row count dropped below a predicted range? Have the row counts plummeted for any key segments? Did fresh data arrive in the table on time?</li><li><strong>Time series anomaly detection for key business metrics<br></strong> Did a metric suddenly move outside of a predicted range? Is the movement unusual given seasonality, trend and holidays?</li><li><strong>Standard run-time data quality checks<br></strong>Are basic data constraints satisfied: no unexpected NULL or blank values, no violations of unique constraints, strings match expected patterns, timestamps follow a defined order, etc.?</li><li><strong>Perfect metric consistency checks<br></strong> Do columns and metrics satisfy critical relationships that can be expressed as simple equations?</li></ol><p>For the rest of this post, we will use <a href="https://console.cloud.google.com/marketplace/browse">open source data in BigQuery</a> to illustrate how each of these requirements is supported in Anomalo.</p><p><strong>1. Row count time series analysis<br></strong><em>Has the table row count dropped below a predicted range? Have the row counts plummeted for any key segments? Did fresh data arrive in the table on time?</em></p><p>The first question to answer for any production dataset is “has it been updated?” In particular, are there <em>any </em>records from the most recent date and is the row count within an expected range?</p><p>If not, then something probably broke upstream in the collection, loading or processing of the table. This must be fixed before anyone can trust the latest data.</p><p>In Anomalo, every table is automatically configured to monitor if the most recent period of data is complete.</p><p>For example, for the <a href="https://data.cityofnewyork.us/Social-Services/NYC-311-Data/jrb2-thup">NY 311 service request data</a>, here is the time series of row counts by day, and the predicted interval used to determine if the row counts are complete:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gj8wWj-ccN6Ph6fLtgzJjQ.png" /><figcaption>Monitoring the row count for <a href="https://data.cityofnewyork.us/Social-Services/NYC-311-Data/jrb2-thup">NY 311 service request data</a> by day, the grey points are the actual row counts, and the green band is the predicted interval.</figcaption></figure><p>For November 23rd, we expected at least 5,223 rows, and in fact there were 7,056.</p><p>You can also pick any column and check that the row counts haven’t plummeted for any important segments in that column. For example, we can evaluate the row counts by borough (neighborhood) in the NY 311 data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7npTzFHtMbsgTcxKEE1HNw.png" /><figcaption>Predicted row counts for November 23rd in the <a href="https://data.cityofnewyork.us/Social-Services/NYC-311-Data/jrb2-thup">NY 311 service request data</a> for every borough (neighborhood) value. If any borough falls below the 99% predicted interval, a notification would be sent.</figcaption></figure><p>Anomalo customers use this feature to ensure their data is complete for a wide variety of segments. Ranging from geography (country, state) to event or API call type to device platform (iOS v Android).</p><p>Finally, we can also tell if the data was significantly delayed. This can indicate that an upstream processing stage is taking longer than normal, and may eventually cause data to be incomplete when users query for it.</p><p>Here is how long it took for each of the last 8 days of data to arrive for the New York 311 dataset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8hhCNSVqTaybIFNOTlkGoA.png" /><figcaption>How long it typically takes <a href="https://data.cityofnewyork.us/Social-Services/NYC-311-Data/jrb2-thup">NY 311 service request data</a> to appear in BigQuery — such delays are common for 3rd party datasets, and can increase suddenly causing downstream query issues</figcaption></figure><p>On average, it takes around 25 hours for the New York 311 data to arrive in BigQuery, and you can easily set a threshold of when you would like to be notified for delayed data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fp3XPCWNVunocOPK" /><figcaption>You control when you are notified if a given table isn’t complete yet.</figcaption></figure><p>For more on data completeness, why it happens so often and how tools like Anomalo can be used to monitor it check out our post on <a href="https://medium.com/anomalo-hq/when-data-disappears-d97f9deecf54">When Data Disappears</a>.</p><p><strong>2. Time series anomaly detection for key business metrics<br></strong> <em>Did a metric suddenly move outside of a predicted range? Is the movement unusual given seasonality, trend and holidays?</em></p><p>Once we know that data is complete in a timely manner, the next step is to ensure that any metrics we compute from the data are within expected ranges.</p><p>In Anomalo, you can easily configure new metrics, for example, we can easily monitor the mean score for posts on the <a href="https://console.cloud.google.com/marketplace/product/y-combinator/hacker-news">Hacker News dataset in BigQuery</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1YQxXwllfve-kSqEPMNiEg.png" /><figcaption>It takes just a few clicks to begin monitoring a metric — in this case the mean of the score column in the <a href="https://console.cloud.google.com/marketplace/product/y-combinator/hacker-news">Hacker News dataset in BigQuery</a></figcaption></figure><p>If the score ever moves sharply outside of the predicted interval, a notification is sent in Slack. This saves a lot of time spent watching metrics for suspicious changes.</p><p>Underneath the hood, Anomalo is building a sophisticated time series model, which decomposes the metric into an overall trend (blue), holiday spikes (orange), season of year (red) and day of week (teal) components:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C3UolWKOQJdgdPfJaUEroA.png" /><figcaption>Behind the scenes of how Anomalo monitors a time series, it is decomposed into overall trend (blue), holiday spikes (orange), season of year (red) and day of week (teal) components</figcaption></figure><p>It looks like hacker news scores have been trending up over time, are sensitive to holidays (Thanksgiving and Christmas look good, others bad), and are much higher on weekends. Hopefully someone posts this article on <a href="https://news.ycombinator.com/">hacker news</a> on a Sunday near Christmas 🎄.</p><p>In Anomalo, metrics can be defined using a variety of pre-defined aggregates:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4dcLw0S7ZztA1nUs1l3ZA.png" /><figcaption>The types of metrics that can be easily defined and monitored in Anomalo.</figcaption></figure><p>Or you can define a custom metric using any SQL aggregate statement available in your warehouse. For example, in the <a href="https://console.cloud.google.com/marketplace/product/san-francisco-public-data/sffd-service-calls">SF Fire Department service calls dataset in BigQuery</a>, we can measure how many minutes on average it takes for the fire department to reach the scene of a call, and be alerted whenever it takes longer than 15 minutes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-PUdf3xMnpHYNLN225Hdrg.png" /><figcaption>Adding a metric that uses a custom SQL aggregate statement to define the average time between when a SF Fire department call was received, and when they arrived on the scene.</figcaption></figure><p>It looks like the average time for the SF Fire Department to respond to calls increased dramatically on October 19th:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4XszyRwdkuU8utKmvhEcdA.png" /><figcaption>It usually only takes 10 minutes to arrive to a scene, but that spiked to longer than an hour on October 19th.</figcaption></figure><p>To learn more about testing your data with time series and unsupervised learning models, check out our post on <a href="https://medium.com/anomalo-hq/dynamic-data-testing-f831435dba90">dynamic data testing</a>.</p><p><strong>3. Standard run-time data quality checks<br></strong><em>Are basic data constraints satisfied: no unexpected NULL or blank values, no violations of unique constraints, strings match expected patterns, timestamps follow a defined order, etc.?</em></p><p>Ensuring that metrics are within expected ranges is important, but ultimately only tests the <em>surface</em> of your data. Even if all of your metrics are within expected tolerances, there could be cracks appearing in your data foundation.</p><p>That is where rule based data quality checks come in. These checks typically test that a condition <em>never</em> or <em>always </em>is satisfied.</p><p>For example, in Anomalo we can easily set up a number of foundational data quality checks on the <a href="https://console.cloud.google.com/marketplace/product/y-combinator/hacker-news">Hacker News dataset in BigQuery</a>. For example, to test that id is always unique:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kHE2Mdmjhdw-L9SW" /><figcaption>Adding a new validation rule in Anomalo can be done in just a few clicks.</figcaption></figure><p>We can then see at a glance which rules have passed, and which have failed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mCZBP9LXs7KkIlQv" /><figcaption>Every table has a dashboard showing the latest status for all of the configured validation rules.</figcaption></figure><p>For failing checks, such as “timestamp is never NULL”, we can see a summary of the issue:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k3X-yU6RUjtep_Jxdqjp2w.png" /><figcaption>When validation rules fail, we show exactly how many records are affected.</figcaption></figure><p>A sample of bad and good records we can scan through:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NGaxWJuTPpx54FfzTayQrw.png" /><figcaption>You can scan through good and bad records to better understand the context of the data quality issue.</figcaption></figure><p>And a statistical analysis identifying the segments of data where the issue is most prominent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y9vh7Si7k6_ZveBYCa8edg.png" /><figcaption>Anomalo performs automated statistical analyses to identify if the issue is more common in any subset of the table. This saves a lot of time in triaging and root causing data quality issues.</figcaption></figure><p>Depending upon the nature of the check, the summary visualization changes to provide the most useful context. In this case, it appears there are many stories with duplicate titles:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6wVmv8N328kmMECT" /><figcaption>The most common duplicate Hacker News titles.</figcaption></figure><p>Knowing not just that the data is broken, but exactly how, where and when the issue occurs is critical to quickly triaging, root causing and fixing it.</p><p><strong>4. Perfect metric consistency checks<br></strong> <em>Do columns and metrics satisfy critical relationships that can be expressed as simple equations?</em></p><p>Real world data is <em>complicated</em>. While key metric and fixed rule based checks may capture 95% of the common data quality use cases, the last 5% often require complex logic specific to an organization and dataset.</p><p>For example, <a href="https://console.cloud.google.com/marketplace/product/city-of-new-york/nypd-mv-collisions">in the New York Police Department dataset of motor vehicle collisions on BigQuery</a>, there are multiple fields tracking how many people were injured or killed in an accident.</p><p>We can validate that the fatality counts are consistent with the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4sevtTHpxLDBTPCrcHZQOQ.png" /><figcaption>Setting up a custom validation to compare metrics — in this case fatalities for people killed in NYPD motor vehicle collisions.</figcaption></figure><p>When run, we find that there are 0.003% of records (45 of 1,734,004 as of 2020-11-27) that have inconsistent fatality counts.</p><p>When such a validation rule fails, we can also see sample bad and good records:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t84K4KXBCd3btp33bL_dXQ.png" /><figcaption>Specific examples of good and bad records often make it clear why an issue is occurring.</figcaption></figure><p>In this case, it appears that there are records where motorists were killed, and yet they are not appearing in the total. Again, we also show any segments of the data that indicate where the issue is occurring most often (limited in this case to just records with some non-zero fatality rows).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0EfoGnCYLxf-7guwHIQ7g.png" /><figcaption>When the 3rd vehicle is unspecified this data quality issue happens more frequently.</figcaption></figure><p>In this case, when at least one of the fatality columns is non-zero this issue is most likely to happen when the contributing_factor_vehicle number 3 column is unspecified. This intelligence could be a meaningful hint towards identifying where and how this data quality issue arose.</p><p>Today, it is easier than ever to become a data driven organization.</p><p>The volume and diversity of data keeps growing. Warehouses like <a href="https://www.snowflake.com/">Snowflake</a> and <a href="https://cloud.google.com/bigquery">BigQuery</a> make storing and querying it all easy. From BI and visualization through to machine learning, there are a <a href="http://mattturck.com/wp-content/uploads/2019/07/2019_Matt_Turck_Big_Data_Landscape_Final_Fullsize.png">plethora of tools</a> that we can leverage to generate insights and create value.</p><p>But most companies have only just begun the journey to ensure the data they depend upon can be trusted. As demonstrated by Airbnb, investing in data quality is critical to <strong><em>staying</em></strong> data driven as data organizations mature.</p><p>At <a href="https://www.anomalo.com/">Anomalo</a>, we have built a platform that will allow any company to achieve and sustain the same vision of high quality data. If you are interested in starting a trial, head to <a href="https://www.anomalo.com/">our site to learn more</a> or <a href="https://www.anomalo.com/requestademo">request a demo</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4ca6b4c97e6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anomalo-hq/airbnb-quality-data-for-all-a4ca6b4c97e6">Airbnb-quality data for all</a> was originally published in <a href="https://medium.com/anomalo-hq">Anomalo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Data Testing]]></title>
            <link>https://medium.com/anomalo-hq/dynamic-data-testing-f831435dba90?source=rss-eac4abbe4148------2</link>
            <guid isPermaLink="false">https://medium.com/p/f831435dba90</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-quality]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[time-series-analysis]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Jeremy Stanley]]></dc:creator>
            <pubDate>Wed, 18 Nov 2020 16:03:18 GMT</pubDate>
            <atom:updated>2020-11-18T16:03:18.660Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXo4cl38eRF1ky3-onsNdA@2x.png" /><figcaption><em>Data is rarely static, so why should data tests be?</em></figcaption></figure><p>When testing data, our first instinct is to reach for perfection. Can’t we write down a clear set of rules that govern <em>exactly how our data should behave, </em>just like we do when testing software?</p><p>Of course we can’t! Data isn’t software, and shouldn’t be tested in the same way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QA5SIlX4CBEw71x3M6OvaA.png" /><figcaption>When testing your data, there are far more factors that are out of your control.</figcaption></figure><p>The reality is that the factors affecting your data that are out of your control will usually far outweigh those that are in your control.</p><p>As your organization grows your business decisions, processes, products and code can all change your data in unexpected ways. And your data is truly at the mercy of many external factors<em>. </em>From how users behave, to what events occur, to the combined actions of competitors, suppliers or market forces.</p><p><strong>To test data effectively we need tests that adapt with these forces.</strong></p><p>In this post, we outline a framework for data testing, from static tests that can be written in SQL, to dynamic tests that require statistics or machine learning. Then we compare both approaches with an example from COVID-19 data in the EU.</p><p>In practice, data can be tested with the following four broad approaches:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zfatqPARKr9j1dT3ovPAiQ.png" /><figcaption>The relative importance of static and dynamic data testing strategies.</figcaption></figure><p><strong>Fixed rules</strong> make a statement in absolute terms about a dataset, such as “this column is never NULL” or “this string always matches a pattern.” These tests are great when your data must be perfect in some clear and known way.</p><p><strong>Specified ranges</strong> require a computed number to be within a pre-determined interval, such as “values should be zero for 1–3% of records” or “the mean of a column should be between 13 and 16”. These can be used when you know in advance that a key metric or data statistic should never drift outside of a range.</p><p><strong>Predicted ranges</strong> are just like specified ranges, except the range is predicted by a time series model. The user can control how much uncertainty should be in the predicted interval, such as “the mean is within a 95% predicted confidence interval”. These are more powerful tests that can find any significant change in key metrics or summary statistics.</p><p><strong>Unsupervised detection</strong> is the most sophisticated approach, where anomalous changes are found in an important dataset. All that is required is that the user specify what data is important. Such tests can identify unexpected changes that you hadn’t thought to test for. <em>Stay tuned for future posts on unsupervised detection.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aJjj058iLIRpr_ldNKEQRA.png" /><figcaption>An example of each of the four types of data testing strategies on EU CDC COVID-19 data.</figcaption></figure><p>Dynamic testing strategies such as <em>predicted ranges</em> or <em>unsupervised detection</em> have some significant advantages. They are easier to set up and easier to maintain over time. They can also be used to test any data for any condition, regardless of the current quality of the data.</p><p>Of course, there are still very good reasons to use static tests. They are powerful when you know exactly how your data should behave, and want to be alerted even if the data varies only slightly from this expectation.</p><p>But relying only on static tests leads either to poor test coverage — where the majority of important data is not well tested, or to a high maintenance burden that will prevent a testing strategy from being sustainable.</p><p>Let’s consider an example. The European CDC provides COVID-19 data hosted in <a href="https://console.cloud.google.com/marketplace/product/european-cdc/covid-19-global-cases">BigQuery here</a>. In addition to statistics like cases and deaths broken out by country and date, this dataset also tracks intensive care patients.</p><p>But many of the intensive care records appear to be NULL. For example, in the BigQuery console we find that 98% are NULL:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KGXLm3MzZm5PCdjQe-SmVQ.png" /><figcaption>Using the BigQuery console to compute the fraction of NULL records in the cumulative_intensive_care_patients column of the covid19_open_data_eu dataset.</figcaption></figure><p>Suppose we are back at July 1st, and we want to set manual bounds for the percent of NULL values in the cumulative_intensive_care_patients column.</p><p>We review the percentages by day, and decide on a bound of 97.5% — 98.5%:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nzswV4Km7m-KCUEQTgm4fg.png" /><figcaption>We begin testing the NULL % (grey line) with a tight expected range (green band).</figcaption></figure><p>Fast-forward to August 6th, and the NULL percentage has dropped below our initial guess.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2EsiK6p3eQeb5w1wP8mirA.png" /><figcaption>The NULL % eventually drifts below our expected range.</figcaption></figure><p>We investigate and find that this is a natural trend due to expanding data collection. Worried about getting more false positive alerts, we widen our interval to 97% to 99%, and everything looks good for a few months:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Ght_Sw7zZPfGsa6zE1DPA.png" /><figcaption>We widen the range, and everything is fine for a few months.</figcaption></figure><p>But then a sudden spike occurs on November 8th that we miss entirely:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YiILuHmt7vbppqpnUgl7ww.png" /><figcaption>We entirely miss a concerning large spike in missing values. Note that this spike appears to have been a temporary issue, and has since been resolved in the BigQuery data.</figcaption></figure><p>Instead, if we had used a <em>predicted range </em>test, this data quality issue would have been caught immediately:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KOe9O7WeU4gINRbg" /><figcaption>A predicted range test, which utilizes a time series model, effectively identifies the spike in NULL % without any manual configuration or maintenance.</figcaption></figure><p>Behind the scenes, this test uses a time series model which dynamically adjusts to the data. The model controls for changes in trend (blue) and seasonality (purple). It then produces a well calibrated predicted range (green). This allows us to clearly identify the anomaly (red):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EeV3uy8_I6GIMO2GjB4n2Q.png" /><figcaption>The anatomy of a predicted range test, where trend (blue) and seasonality (purple) are controlled for, and a predicted interval (green) makes it clear that the most recent observation (red) is anomalous.</figcaption></figure><p>Predicted range tests should:</p><ul><li>Control for changes in trend and seasonality, without over-reacting</li><li>Adjust for holidays, which can cause sudden spikes or dips in metrics</li><li>Identify and treat historical outliers, so they do not unduly influence future predictions</li><li>Accurately predict an <em>interval</em> of possible outcomes based on historical variance in the series</li></ul><p>Once these factors are accounted for, predicted range tests are a very powerful data testing strategy.</p><p>To effectively test their data, companies should use a portfolio of testing strategies. Static tests such as fixed rules or specified ranges should be used only when there are clearly known expectations about data that is already of high quality.</p><p>The majority of data tests should be <em>dynamic</em> to ensure high data test coverage that adapts as your data changes without requiring constant maintenance.</p><p>We are building a data testing product with a strong emphasis on dynamic testing over at Anomalo. So, if you’re interested in easily enabling dynamic tests for your data, head to <a href="https://www.anomalo.com/">our site to learn more</a> or <a href="https://www.anomalo.com/requestademo">request a demo</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f831435dba90" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anomalo-hq/dynamic-data-testing-f831435dba90">Dynamic Data Testing</a> was originally published in <a href="https://medium.com/anomalo-hq">Anomalo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Data Disappears]]></title>
            <link>https://medium.com/anomalo-hq/when-data-disappears-d97f9deecf54?source=rss-eac4abbe4148------2</link>
            <guid isPermaLink="false">https://medium.com/p/d97f9deecf54</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[data-warehouse]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-quality]]></category>
            <dc:creator><![CDATA[Jeremy Stanley]]></dc:creator>
            <pubDate>Tue, 10 Nov 2020 16:32:55 GMT</pubDate>
            <atom:updated>2020-11-10T16:32:55.289Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9mvWGd-_iqVnbu44.png" /><figcaption><em>The most common data quality issue is no data at all</em></figcaption></figure><p>When we think of data quality, the first issues that come to mind are visible problems like duplicate rows, NULL values or corrupted records. But in fact the most common data quality issue is that data has simply <em>disappeared.</em></p><p>In this post we will describe how data disappears, what the common causes are and what data teams can do to identify these issues.</p><p>Consider how companies process data into their warehouses:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3or3rop5ljVnEjWW" /></figure><p>Raw data is captured through logging systems or from external sources, then data loading systems pre-process the raw data and load it into a data warehouse. Then complex SQL pipelines filter data for important records, join multiple sources together and perform complex aggregations.</p><p>The resulting tables, often referred to as “fact tables”, are the golden datasets of an organization. Cross-functional teams leading strategic initiatives rely upon them, product managers make decisions using them and operations and sales teams are managed based on them.</p><p>It is hard to underestimate the importance of ensuring these tables are reliable.</p><p>But important fact tables can be the result of many transformations across disparate systems linking varied source datasets. This complexity increases the likelihood of incomplete data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WtxdJF60al-uCV_Io8BoRw.png" /><figcaption>Data processing stages, popular platforms and examples of what breaks along the way</figcaption></figure><p>However, unlike some other data quality issues, there isn’t a single SQL query to validate that data is complete. This is because incomplete data can take many forms.</p><p>The simplest issue is that there is no recent data <em>at all</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Gv-gImQDf1_LOUStR-spQ.png" /><figcaption>The data went entirely missing on the most recent date</figcaption></figure><p>Even this can be fraught with challenges, as we need to know when there <em>should</em> be data there. Ideally systems track how long a dataset typically takes to update, and alerts when new data is significantly delayed.</p><p>A more nuanced issue that can go undetected is that there are fewer records than expected, or that data disappeared for a small period of time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kSoB3ugGy1cuzQgAsVCq-w.png" /><figcaption>The data appears to be incomplete on the most recent date.</figcaption></figure><p>In this case, you need a time series model to predict what range of row counts are expected. Such models need to control for trend, weekday seasonality, annual seasonality and holidays. Doing this reliably at scale can be challenging.</p><p>Even more difficult to handle is when data disappears for an important segment of the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UNbz2lul-IYGM6BVUYoDMg.png" /><figcaption>An important segment of the data is almost entirely gone, but overall row counts remain plausible.</figcaption></figure><p>The missing segment might be small enough to not affect the overall row counts, but still mission critical for your business.</p><p>So what happens when data disappears? The consequences can be widespread:</p><ul><li>Dashboards fail to update, or show misleading charts based on limited data</li><li>Machine learning models miss training on the latest observations or are biased by incomplete data</li><li>Data products deliver stale or unrepresentative data to internal or external consumers</li></ul><p>Usually, a data organization’s first instinct is to rely upon the monitoring of the systems that <em>produce</em> the data. Infrastructure engineering is monitoring the logging system with production metrics. And data engineering is monitoring the data coordination and loading systems for outages or missing data.</p><p>But as an organization matures the way data is produced increases in complexity, and it becomes dangerous to rely upon monitoring of individual components:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HZOsAhbZBIALRaRd" /><figcaption>Data processing flows almost always start simply, but become increasingly complex over time.</figcaption></figure><p>At <a href="https://www.anomalo.com/">Anomalo</a>, we’ve found the only way to be certain your data is available is to test it <em>independently from the systems producing it</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Oryz4Iq-0RwT54PH" /><figcaption>Data processing pipelines are complex, and require independent monitoring of the important data <em>in the warehouse.</em></figcaption></figure><p>To ensure that data is available and complete, we run the following sequence of tests:</p><ol><li>Are there any rows from yesterday?</li><li>Is the row count above a predicted lower bound?</li><li>Is there any missing data at the very end of the day?</li><li>Are there any key segments with far fewer than the expected number of rows?</li></ol><p>To set this up for a new table only requires a few pieces of information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vnwjMUcR9_8wc2FD" /><figcaption>How to configure a table to be monitored for missing data in Anomalo.</figcaption></figure><p>Then, if we ever discover an issue with incomplete data we send a notification to the relevant teams’ Slack, Teams, PagerDuty or e-mail:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fwNLAFXmLFoUZNJh" /><figcaption>A slack notification showing an incomplete data issue. The green band is the predicted row count range per day, and the dots and lines are the actual row counts.</figcaption></figure><p>For example, the above Slack message is for a Google BigQuery Public dataset of San Francisco transit stops. We saw a big decrease in records on 2020–10–29. Our model predicted that there should be at least 10,053 rows, but only 3,672 rows exist. What happened to the other 6,500 rows?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*Q9iAbN0AF31Ou82YfNfHOw.png" /></figure><p>We also note that this was the first time this table had failed to load data on time in the last 34 runs, providing users with a sense of just how unusual or extreme this behavior is.</p><p>Digging deeper, we show exactly what happened on the 29th:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5X1GWmTYhrWEX_8ZuA2wog.png" /><figcaption>Predicted row counts per hour range (green band) versus actual (lines and dots).</figcaption></figure><p>It appears that the data disappeared by 8am, and never returned that day.</p><p>When it is relevant, we show a breakdown of exactly which segments are appearing less frequently than expected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A0bzbny0HrgoUxvu" /><figcaption>A detailed view by segment, showing the predicted range of rows as green bars, and red dots indicating what actually happened for 4 types of content.</figcaption></figure><p>This chart is from a COVID-19 online news dataset, and is showing that on November 4th there were fewer articles online about Cases, Quarantine, Prices and Ventilators than expected.</p><p>These details help data teams rapidly triage issues, identify root causes, and communicate to the affected teams internally. In many cases, they even help accelerate the development and deployment of resolutions. Moving quickly and confidently to identify and resolve such issues greatly reduces the chances they negatively impact the rest of the company.</p><p>Before any dataset is used for mission critical decisions or products, data-driven organizations should validate the quality of the data using an automated system. The first step to get right is to ensure the data hasn’t disappeared.</p><p>To learn more about Anomalo, <a href="https://www.anomalo.com/requestademo">request a demo</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d97f9deecf54" width="1" height="1" alt=""><hr><p><a href="https://medium.com/anomalo-hq/when-data-disappears-d97f9deecf54">When Data Disappears</a> was originally published in <a href="https://medium.com/anomalo-hq">Anomalo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 NIPS Papers We Loved]]></title>
            <link>https://tech.instacart.com/3-nips-papers-we-loved-befb39a75ec2?source=rss-eac4abbe4148------2</link>
            <guid isPermaLink="false">https://medium.com/p/befb39a75ec2</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[visualization]]></category>
            <dc:creator><![CDATA[Jeremy Stanley]]></dc:creator>
            <pubDate>Thu, 14 Dec 2017 18:10:01 GMT</pubDate>
            <atom:updated>2017-12-15T01:17:23.192Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Know your model’s limits, interpret it’s behavior and learn from variable length sets.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uQ4JKyqTBktkVcddZXGu2Q.png" /><figcaption>One of two “breakout sessions” with presenter and GIANT screen for scale.</figcaption></figure><p>At <a href="https://nips.cc/">NIPS 2017</a> what surprised me the most was not the size of the crowds (they were huge), the extravagance of the parties (I sleep early) or the controversy of the “<a href="https://twitter.com/haldaume3/status/938478425777377280">rigor police</a>” debate (it was entertaining).</p><p>No, what surprised me the most was the number of papers I saw that (when combined with talks and posters) were both relatively easy to understand and of immediate practical use.</p><p>In this post, I will briefly explain three of our favorites:</p><ol><li><strong>Knowing your model’s limits</strong><br><em>Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles<br></em>Lakshminarayanan et. al 2017, <a href="https://arxiv.org/abs/1612.01474">paper</a> &amp; <a href="https://www.facebook.com/nipsfoundation/videos/1554654864625747/">video</a> (1:00:10)</li><li><strong>Interpreting model behavior</strong><br><em>A Unified Approach to Interpreting Model Predictions<br></em>Lundberg et al. 2017, <a href="https://arxiv.org/abs/1705.07874">paper</a>, <a href="https://www.facebook.com/nipsfoundation/videos/1553537531404147/">video</a> (17:45) &amp; <a href="https://github.com/slundberg/shap">github</a></li><li><strong>Learning from variable length sets</strong><br><em>Deep Sets<br></em>Zaheer et al. 2017, <a href="https://arxiv.org/abs/1703.06114">paper</a> &amp; <a href="https://www.facebook.com/nipsfoundation/videos/1555553784535855/">video</a> (16:00)</li></ol><p>I’d like to extend a <strong>huge</strong> thank-you to <a href="https://arxiv.org/find/stat/1/au:+Lakshminarayanan_B/0/1/0/all/0/1">Balaji Lakshminarayanan</a>, <a href="https://arxiv.org/find/cs/1/au:+Lundberg_S/0/1/0/all/0/1">Scott Lundberg</a>, <a href="https://arxiv.org/find/cs/1/au:+Zaheer_M/0/1/0/all/0/1">Manzil Zaheer</a> and their co-authors for doing this work and presenting at NIPS. Their cogent presentations and detailed answers to my many questions at their poster sessions enabled and inspired this post.</p><h3>Knowing your model’s limits</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hP2OCyPv07m1Rppu3MsyZw.png" /><figcaption>Lakshminarayanan et. al 2017, <a href="https://arxiv.org/abs/1612.01474">paper</a> &amp; <a href="https://www.facebook.com/nipsfoundation/videos/1554654864625747/">video</a> (1:00:10)</figcaption></figure><p>Deep learning models can be surprisingly brittle. They can fail to generalize on data drawn from slightly different distributions and can give very different predictions given minor changes in the learning algorithm or initialization.</p><p>This begs the question — can we know when our deep learning models are uncertain about their predictions?</p><p>If so, this would help in many applications at Instacart, such as:</p><ul><li>How uncertain are we about an item being in stock at a store location?</li><li>How much risk is there in a grocery delivery being late?</li><li>Is there a chance we should explore showing a rare item for a search?</li><li>What range of delivery demand should we anticipate at a store location?</li></ul><p>In particular, anytime you make a decision based upon many noisy predictions, you risk favoring observations with large noise values (common in ranking for search or ads, or in optimization for pricing or logistics applications). Ensuring you control for prediction uncertainty to avoid this effect can be important.</p><p>Other methods can be used to quantify uncertainty, but have drawbacks. For example, bayesian methods require assumptions about priors and are computationally expensive.</p><p>This paper provides an elegant method to quantify the uncertainty in deep learning models:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fgsx2vWWlbou92N0-ejxGw.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1554654864625747/">Lakshminarayanan et. al 2017 (video)</a></figcaption></figure><p>In practice you:</p><ul><li>Choose a distribution for your output (gaussian if you are optimizing for MSE, poisson for counts, etc.)</li><li>Change the final layer in your deep network to output a variance estimate (or other distribution parameters) in addition to an estimate for the mean</li><li>Minimize the negative log-likelihood for the output distribution (e.g., with a custom loss function in Keras)</li><li>Train M networks in this way, each with a different random initialization</li><li>Let your final predicted distribution be the evenly weighted mixture of distributions from the M networks</li></ul><p>While the paper also adds <a href="https://arxiv.org/abs/1412.6572">adversarial training</a> (hard to implement for discrete inputs), some of their experiments showed that this was less important.</p><p>What is critical is that your network must produce an estimate of mean and variance, and then optimize the negative log likelihood loss function. If you assume your errors are gaussian distributed, then your loss function is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*fjpusF7VtVdto9gorxrDlA.png" /><figcaption><a href="https://arxiv.org/abs/1612.01474">Lakshminarayanan et. al 2017 (paper)</a></figcaption></figure><p>Where <strong>𝜇</strong> is the network’s estimate of the mean (conditioned on weights <strong><em>θ</em></strong> and input 𝒙), and <strong>σ² </strong>is the networks’ estimate of the variance. If you assume a constant σ, this can be simplified to classical regression with MSE.</p><p>For an example on implementing a similar loss function in Keras, see the <a href="https://github.com/ragulpr/wtte-rnn/tree/master/python">WTTE package</a>, which uses a Weibull distribution instead of a Gaussian.</p><p>The following toy example from their paper illustrates the impact, where each red point is drawn from y = x³ + ε where ε ∼ N(0, 32), the blue line is y = x³ and the grey range is the method’s variance estimate conditioned on x:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K0n1gjNSSgwiPotkJejXUQ.png" /><figcaption><a href="https://arxiv.org/abs/1612.01474">Lakshminarayanan et. al 2017 (paper)</a></figcaption></figure><p>The leftmost plot shows the variance of training M=5 simple networks which only output the mean and were optimized for MSE. Each model produces only a point estimate, and there is little variance observed over the ensemble.</p><p>The second plot shows the results of following the above recipe but with M=1. In this case, the network produces a distribution, but it’s level of uncertainty remains constant even when generalizing outside of it’s domain.</p><p>The third plot includes adversarial training (note how little difference it makes) with M=1, and the final plot does everything (mean and variance outputs, adversarial training and M=5.) <strong>Only the final plot does a reasonable job of estimating uncertainty outside of the range of the training data.</strong></p><p>The authors then show that an ensemble of networks trained in this way on digit classification with MNIST data do a far better job of estimating their uncertainty than other techniques like monte-carlo dropout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vXKb7Ri6f7ZbaOryM5yIVg.png" /><figcaption><a href="https://arxiv.org/abs/1612.01474">Lakshminarayanan et. al 2017 (paper)</a></figcaption></figure><p>In the above visualization, they vary the number of networks in the ensemble, and compare monte-carlo dropout (green) to a simple ensemble (red) to an ensemble with adversarial training (blue). The grey curves use random data augmentation (rather than adversarial), and show that using the adversarial approach is what adds incremental value to a simple ensemble.</p><p>Finally, and perhaps most impressive of all, the authors show that their method responds appropriately when presented with data from an entirely different domain (letters rather than numbers):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jqbf9tRJp5RreLpoVMCq8Q.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1554654864625747/">Lakshminarayanan et. al 2017 (video)</a></figcaption></figure><p>The blue plots show the uncertainty (measured in entropy given this is a classification problem) for digit classification when presented with numbers. The bottom red plots show the uncertainty when presented with letters.</p><p>When using just 1 network in the ensemble (how most deep learning models are deployed), the model trained only on numbers gives equally confident (but obviously wrong) classification results for letters! But increasing to even just 5 networks produces significantly less confident predictions.</p><h3>Interpreting model behavior</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZd9Nrp0HvxU3K1Wqi0QvA.png" /><figcaption>Lundberg et al. 2017, <a href="https://arxiv.org/abs/1705.07874">paper</a>, <a href="https://www.facebook.com/nipsfoundation/videos/1553537531404147/">video</a> (17:45) &amp; <a href="https://github.com/slundberg/shap">github</a></figcaption></figure><p>Most complex machine learning models are black boxes — we simply cannot fully understand how they work. However, we can gain deeper insight <em>locally</em> into the predictions that they make, and through this insight can better understand our data and models.</p><p>This understanding can be used to:</p><ul><li>Build intuition for how our algorithms behave</li><li>Alter end user experiences to provide more context for predictions</li><li>Debug model building issues arising from data quality, model fit or generalization ability</li><li>Measure the value of different features in a model, and inform decisions for future data collection and engineering</li></ul><p>At Instacart, we often want to deeply understand models we build such as:</p><ul><li>The expected time until a user places their next order, as a function of their past order, delivery, site and rating behavior</li><li>What product pairs are good replacements for each-other in case we cannot find what the customer originally requested</li><li>How our customers react to limited delivery availability options or busy pricing</li></ul><p>The SHAP (SHapley Additive exPlanations) paper and package provides an elegant way to decompose a model’s predictions into additive effects, which can then be easily visualized.</p><p>For example, here is a visualization that explains a Light GBM prediction of the chance a household earns $50k or more from a <a href="https://slundberg.github.io/shap/notebooks/Census+income+classification+with+LightGBM.html">UCI census dataset</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZcHM-BvH0yu0Ol8QdsvNIw.png" /><figcaption><a href="https://github.com/slundberg/shap">Lundberg et al. 2017 (github)</a></figcaption></figure><p>In this case, the log-odds likelihood of high income is -1.94, and the largest factor depressing this chance is young age (blue), and the largest factor increasing income is marital status (red).</p><p>Furthermore, you can visualize the aggregate impact of features on model predictions over an entire dataset with visualizations like these:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5xxTNC3KB6OFEphbh6VYjg.png" /><figcaption><a href="https://github.com/slundberg/shap">Lundberg et al. 2017 (github)</a></figcaption></figure><p>Here they find that Age is most predictive, but really because there is a group (young) which is separated and low income. Capital Gain is the next most predictive, in part because of both very high and very low contributions.</p><p>This is a huge improvement over the typical information gain based variable importance visualizations commonly used with packages like XGBoost and LightGBM, which only show the relative importance of each feature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*IwLr34RoTjjcWrLJQ0orhg.png" /><figcaption><a href="https://cran.r-project.org/web/packages/xgboost/vignettes/discoverYourData.html">R XGBoost Vignette</a></figcaption></figure><p>The package can also provide rich partial dependence plots which show the range of impact that a feature has across the training dataset population:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*6K-wuDWb_x4_YsDAQixZAA.png" /><figcaption><a href="https://github.com/slundberg/shap">Lundberg et al. 2017 (github)</a></figcaption></figure><p>Note that the vertical spread of values in the above plot represent interaction effects between Age and other variables (the effect of Age changes with other variables). This is in contrast to traditional partial dependence plots which show only the effect of varying Age in isolation.</p><p>To understand how the SHAP algorithm works, consider this example for a single observation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*6IxC6PRl5HtQYH8ceMCNuQ.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1553537531404147/">Lundberg et al. 2017 (video)</a></figcaption></figure><p>Their model is predicting the chance of high income, and on average predicts a base rate of 20% for the entire population, denoted by <em>E</em>[<em>f</em>(<em>x</em>)]. For this specific example (named John in the talk), they predict a 55% probability, denoted by <em>f</em>(<em>x</em>).</p><p>The SHAP values answer the question of how they got from 20% to 50% for John.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*-5UCoSUtBVHODzHWRUIUYg.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1553537531404147/">Lundberg et al. 2017 (video)</a></figcaption></figure><p>They begin by ordering the features randomly, perhaps starting with Age, and ask how much the average prediction of 20% changes for users whose age is the same as John’s, denoted <em>E</em>[<em>f</em>(x) | <em>x</em>₁]. This can be found by integrating <em>f</em>(x) over all other features besides <em>x</em>₁ in the training dataset (a process that can be done efficiently in trees).</p><p>Suppose that they find that the prediction goes up to 35%, and so this gives them an estimate for the effect of Age, <strong><em>ϕ</em></strong>₁=15%. They then iteratively repeat this process through the remaining variables (concluding with marital status), to estimate <strong><em>ϕ</em></strong>₂, <strong><em>ϕ</em></strong>₃ and <strong><em>ϕ</em></strong>₄ for each of the other three features in this example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*G3iy4fJsoQZfTECsgVuMZg.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1553537531404147/">Lundberg et al. 2017 (video)</a></figcaption></figure><p>However, unless a model is purely additive, the estimates for <strong><em>ϕ </em></strong>will vary with the ordering of features chosen. The SHAP algorithm solves this by averaging over all possible 2ᴺ orderings. The computational burden of computing all such orderings is alleviated by sampling M of them and using a regression model to attribute the impact from the samples to each feature.</p><p>The paper justifies the above approach using game theory, and further shows that this theory unifies other interpretation methodologies such as LIME and DeepLIFT:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-tsnGs4xREmIFxPx_Uw7Yw.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1553537531404147/">Lundberg et al. 2017 (video)</a></figcaption></figure><p>And finally, because no NIPS paper would be complete without an MNIST example, they show that the SHAP algorithm does a better job at explaining what part of an 8 represents the essence of an 8 (as opposed to a 3):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*830rIhb4gqHJO3TsXmAyyA.png" /><figcaption><a href="https://arxiv.org/abs/1705.07874">Lundberg et al. 2017 (paper)</a></figcaption></figure><p>This shows that their approach can work well even for deep learning models.</p><h3>Learning from variable length sets</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9IhmFG61X6bPRaTn8W1Qiw.png" /><figcaption>Zaheer et al. 2017, <a href="https://arxiv.org/abs/1703.06114">paper</a> &amp; <a href="https://www.facebook.com/nipsfoundation/videos/1555553784535855/">video</a> (16:00)</figcaption></figure><p>Established deep learning architectures exist for modeling sparse categorical data (embeddings), sequence data (LSTMs) and image data (CNNs). But what do you do if you want your model to depend upon a <em>variable length unordered set</em> of inputs?</p><p>This was precisely the question we asked ourselves at Instacart a year ago while pondering our work on sorting grocery shopping lists in our <a href="https://tech.instacart.com/deep-learning-with-emojis-not-math-660ba1ad6cdc">Deep Learning with Emojis (Not Math)</a> post.</p><p>I was overjoyed (and humbled) to see this paper at the NIPS poster session Wednesday night, which generalizes our work, and immediately reminded me of this tweet by <a href="https://twitter.com/math_rachel">Rachel Thomas</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*SE2DQc_reykcn2RLjXauCw.png" /><figcaption><a href="https://twitter.com/math_rachel/status/937814542444138496">Tweet</a> by <a href="https://twitter.com/math_rachel">Rachael Thomas</a></figcaption></figure><p>In the Deep Sets paper, the authors explain that set based modeling problems fall into two classes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rGZ3pw0eQZn2JyJUT79Q0g.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1555553784535855/">Zaheer et al. 2017 (video)</a></figcaption></figure><p>In the permutation invariant case, you want to be able to re-order the inputs into your model without affecting the prediction (which is often into a space of a different dimension from your input).</p><p>For example, at Instacart we could predict:</p><ul><li>How much time it will take to pick a basket of groceries at a store location</li><li>Will a user add to cart any item given a query and a set of product search results</li><li>How efficient will we be in a city given a set of deliveries and their location and due times, and a set of shoppers and their locations and current status</li></ul><p>In the permutation equivariant case, you will produce a predicted value for every input in the set, and you want to be able to re-order the inputs and ensure that the ordering of the outputs changes accordingly.</p><p>For example, at Instacart we could predict:</p><ul><li>The probability that each item in a set will be picked by an in-store shopper next given the previous item and store (our <a href="https://tech.instacart.com/deep-learning-with-emojis-not-math-660ba1ad6cdc">Deep Learning with Emojis (Not Math)</a> use case)</li><li>Which of the products a user has purchased in the past they will re-purchase in their next order (our <a href="https://tech.instacart.com/3-million-instacart-orders-open-sourced-d40d29ead6f2">3 Million Instacart Orders, Open Sourced</a> use case)</li></ul><p>The paper proves that any such set based architecture must take the following form:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GonIjotFb7ZE-QTnd7xxxg.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1555553784535855/">Zaheer et al. 2017 (video)</a></figcaption></figure><p>For the permutation invariant case, the architecture will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5s4GE9GETyEgWfcW0t9tqg.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1555553784535855/">Zaheer et al. 2017 (video)</a></figcaption></figure><p>Where <strong><em>ϕ</em></strong> is an arbitrary neural network architecture applied iteratively over every set element 𝒙 (for example, using the <a href="https://keras.io/layers/wrappers/">Keras TimeDistributed layer wrapper</a>). The outputs of <strong><em>ϕ</em></strong> must then be summed along the set dimension, and can then be passed into yet another arbitrary neural network <strong><em>⍴</em></strong>, which can produce the final output predictions.</p><p>For the permutation equivariant case, the architecture is the same as above, but instead of using <strong><em>⍴</em></strong> you use DeepSets layers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jLly2QTGbceu15ShP-vsNA.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1555553784535855/">Zaheer et al. 2017 (video)</a></figcaption></figure><p>Where you can see that the output is invariant to the ordering of the input given the symmetry in weight sharing.</p><p>The paper provides an obligatory MNIST example, where they seek to learn an architecture that can sum hand-written digits:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hxQowjEx3iHFPCDbgqECTA.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1555553784535855/">Zaheer et al. 2017 (video)</a></figcaption></figure><p>In this case you want the architecture to be permutation invariant, so that sum(1, 2) = sum(2, 1), and to handle variable length input such as sum(1, 2, 7).</p><p>Two simple alternative approaches both fail:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ouhxd_T-2oLuQyKHhv6N5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GS8mlG_FonjvRj7FD_IMA.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1555553784535855/">Zaheer et al. 2017 (video)</a></figcaption></figure><p>On the left hand side, they concatenate the digits and pass them into a hidden layer, but this fails to handle variable sequence length inputs. On the right hand side, they pass them into a recurrent layer, but the results will not be order invariant.</p><p>How big of a deal is that? In practice, they found that both GRU and LSTM layers failed dramatically to generalize to sequence lengths longer than 10:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_EXwo4Ds8JXNWX2Yg_IJhA.png" /><figcaption><a href="https://www.facebook.com/nipsfoundation/videos/1555553784535855/">Zaheer et al. 2017 (video)</a></figcaption></figure><p>This paper is particularly rich with application examples, ranging from image tagging, to outlier detection, to point-cloud classification:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aROGbpveRQ-R1Ov5bgdWgQ.png" /><figcaption><a href="https://arxiv.org/abs/1703.06114">Zaheer et al. 2017 (paper)</a></figcaption></figure><h3>Summary</h3><p>Beyond all the hype, NIPS 2017 was an amazing event, and these three papers demonstrate how practically useful these conferences are for applied AI and Machine Learning work. In each case, the author’s work provided mathematical rigor, practical advice, and experimental validation for questions we have been pondering at Instacart.</p><p>I hope that you are now as excited by these ideas as we are! If you are interested in working on one of the many challenging problems we have at Instacart, check out our careers page at <a href="http://careers.instacart.com">careers.instacart.com</a>.</p><p>Again, I’d like to thank <a href="https://arxiv.org/find/stat/1/au:+Lakshminarayanan_B/0/1/0/all/0/1">Balaji Lakshminarayanan</a>, <a href="https://arxiv.org/find/cs/1/au:+Lundberg_S/0/1/0/all/0/1">Scott Lundberg</a>, <a href="https://arxiv.org/find/cs/1/au:+Zaheer_M/0/1/0/all/0/1">Manzil Zaheer</a> and their co-authors for their work, and to everyone involved in organizing NIPS 2017. I’d also like to thank <a href="https://twitter.com/jeremyphoward">Jeremy Howard</a> for his feedback on this post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=befb39a75ec2" width="1" height="1" alt=""><hr><p><a href="https://tech.instacart.com/3-nips-papers-we-loved-befb39a75ec2">3 NIPS Papers We Loved</a> was originally published in <a href="https://tech.instacart.com">tech-at-instacart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[700 Women Founders]]></title>
            <link>https://medium.com/@jeremy.stanley/700-women-founders-2574766f09fd?source=rss-eac4abbe4148------2</link>
            <guid isPermaLink="false">https://medium.com/p/2574766f09fd</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[venture-capital]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <dc:creator><![CDATA[Jeremy Stanley]]></dc:creator>
            <pubDate>Sat, 24 Jun 2017 22:06:10 GMT</pubDate>
            <atom:updated>2017-06-24T22:06:10.505Z</atom:updated>
            <content:encoded><![CDATA[<p>Analyzing 700 women founders, and the VCs that invested in them.</p><p>On Friday, I awoke to a trickle of twitter updates about an article in <a href="https://www.theinformation.com/silicon-valley-women-tell-of-vcs-unwanted-advances">The Information</a>, detailing the unwanted advances of a VC, Justin Caldbeck of Binary Capital. The article was shocking, with three women on the record (and three others off) accusing him of blatantly abusing his position of power with women founders.</p><p>Over the course of the day, the trickle intensified, with reports from <a href="https://pando.com/2017/06/22/binary-capitals-justin-caldbeck-accused-unwanted-sexual-advances-towards-female-founders-wheres-outrage/">Pando</a>, <a href="https://www.axios.com/silicon-valleys-sexist-swamp-2446837635.html">Axios</a> and finally a <a href="https://www.linkedin.com/pulse/human-rights-women-entrepreneurs-reid-hoffman?published=t">reaction from Reid Hoffman</a>. The day concluded with <a href="https://www.axios.com/justin-caldbeck-takes-indefinite-leave-of-absence-from-binary-capital-2446988189.html">another Axios article</a> covering the VC’s indefinite leave of absence.</p><p>Much has been written about the gender and minority diversity of employees at technology companies (<a href="http://fortune.com/2015/07/30/tech-companies-diveristy/">this Fortune article</a>, for example). Yet little has been written about the gender diversity of VC investments.</p><p>This surprised me — as founders play <em>crucial</em> roles in building diverse and inclusive companies.</p><p>So I downloaded the freely available <a href="https://data.crunchbase.com/docs/2013-snapshot">Crunchbase © 2013 Snapshot</a> database of companies, their employees and their funding rounds. I extracted companies who raised capital in 2009–2013 in Seed, A, B or C rounds.</p><p>Then, using the <a href="https://cran.r-project.org/web/packages/gender/index.html">Gender package in R</a> I identified the likelihood that each founder was a woman or man. While gender analysis from first names is far from perfect, for over 80% of founder names we can be 95% certain they are female or male, and so aggregate conclusions should be reliable.</p><p>Not surprisingly, I found that a woefully small percentage of founders are women. Of the 17,961 investments by 2,435 investors in 6,771 founders from 3,867 companies analyzed with gendered names, only 10.5% were women.</p><p>Women are even less likely to be represented in late funding rounds, and the percentage of women founders increased until 2012, and then regressed in 2013. Some investment regions (Berlin, Tel Aviv) have higher percentage of women founders, while others (Philadelphia, Austin) have materially lower percentages.</p><p>Women are also more likely to be founders in companies tagged as fashion, e-commerce or gaming startups. They are much less likely to be founders in companies tagged as real-time, big data or marketing startups.</p><p>I then ranked the top 100 VCs (by companies invested in) over these 5 years by their percentage of women founders, and found that the 10 least diverse VC portfolios all had 5% or fewer women founders, and that only the top two most diverse VC portfolios had just over 20%.</p><h4>The Analysis</h4><p>Gender is not a field that is reported by Crunchbase, so I used the first names of the founders (identified by searching for ‘founder’ or ‘Founder’ in their title) to estimate gender.</p><p>This word cloud shows the top 500 founder first names, and colors predominantly male names in orange, female names in green, and unidentifiable names (e.g., ‘J.’) in grey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lV8QCrSNNCz8eBhwHhnEGA.png" /><figcaption>Top 500 most common founder first names by inferred gender (orange = male, green = female, grey = unknown)</figcaption></figure><p>There are many Michael and David founders, but it’s immediately clear that female names are few and far between.</p><p>The percent of founders that are women drops significantly as you progress from seed to a, b and c rounds of funding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*odsvC8pLmOpP7uSJNHd-Rg.png" /><figcaption>Percent of women founders by round</figcaption></figure><p>Over time, the percentage of women founders rose from roughly 7% in 2009 to almost 13% in 2012, but receded back to only 10% in 2013.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wvoUjSRFtZkrzsJyd7jQ3g.png" /><figcaption>Percent of women founders over time</figcaption></figure><p>Some regions (Berlin and Tel Aviv) have 16% or more women founders, while others (Philadelphia and Austin) have fewer than 3%. But these regions also have small sample sizes (70 or fewer companies).</p><p>New York, however, has a significantly higher percent of women founders (13%) as compared to the SF Bay area (10%).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XWgyloExcIfPwe5YSopP5A.png" /><figcaption>Percent of women founders by region and region size.</figcaption></figure><p>There are also tags that are much more or less likely to be associated with startups founded by women.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8yZwX7ptZRYzVwcEM1bM0g.png" /><figcaption>Percent of companies invested in by tag that have one or more women founders</figcaption></figure><h4>The VC Rankings</h4><p>Last, but not least, are the rankings of the top 100 VCs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GKU9IT7dBP99fP5XmbI_3g.png" /><figcaption>Top 100 investors sorted by percent of women founders</figcaption></figure><p>All of these firms have 24+ founders in this sample (and some as many as 374), and so the variation in results is clearly significant, but data points from firms with fewer investments may be less meaningful. Note that the size of the circles represents the firm’s number of portfolio companies.</p><p>The discrepancy between the top and bottom VCs becomes starkly clear when we compare the names of their founders:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2gwchILYTCBbe9TmLp6AfA.png" /><figcaption>Founder first names for the top 5 VCs (left) and bottom 5 VCs (right), where orange are men and green are women</figcaption></figure><p>Keep in mind that these findings are simply a summary of readily available data. A reputation for abusive behavior might cause a VC to have fewer women founders, but so could their investment focus, their networks, coincidence and countless other factors. Let’s not jump to any conclusions on specific VCs.</p><p>I would also hope that some VCs have made significant progress since 2013, but for now we’ll have to wait for Crunchbase to make more recent data available without subscription to find out.</p><h4>My Opinion</h4><p>I believe the women who have said that there are other, as yet unreported examples of sexism and abuse of power in both the VC and broader technology community. I hope more brave women speak out and ignite fires of indignation that, with sufficient attention, will lead to meaningful change.</p><p>But I also believe in the power of data, of transparency, and of holding our community accountable to outcomes.</p><p>I hope that this analysis can begin that for VCs.</p><h4>The Code &amp; Data</h4><p>This <a href="https://github.com/jeremystan/crunchbase_women_founders">github repo</a> contains the code used to produce this analysis. The data can be downloaded freely after approved registration at <a href="https://data.crunchbase.com/docs/2013-snapshot">Crunchbase © 2013 Snapshot</a>.</p><p>This post was made significantly better because of feedback from <a href="https://www.linkedin.com/in/michelle-suwannukul-781919b/">Michelle Suwannukul</a> and <a href="https://twitter.com/dtunkelang">Daniel Tunkelang</a>, thank you both!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2574766f09fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Space, Time and Groceries]]></title>
            <link>https://tech.instacart.com/space-time-and-groceries-a315925acf3a?source=rss-eac4abbe4148------2</link>
            <guid isPermaLink="false">https://medium.com/p/a315925acf3a</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[on-demand]]></category>
            <category><![CDATA[logistics]]></category>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Jeremy Stanley]]></dc:creator>
            <pubDate>Tue, 13 Jun 2017 17:59:27 GMT</pubDate>
            <atom:updated>2020-07-30T21:25:59.613Z</atom:updated>
            <content:encoded><![CDATA[<p>Grocery delivery visualized in python with <a href="http://datashader.readthedocs.io/en/latest/">datashader</a>.</p><p>At Instacart, we deliver a <strong>lot</strong> of groceries. By the end of next year, <a href="https://news.instacart.com/instacart-announces-nationwide-expansion-one-year-of-free-grocery-delivery-in-texas-and-the-dbc6313ae822">80% of American households</a> will be able to use Instacart. Our challenge: complete every delivery on-time, with the right groceries.</p><p>Over the course of a week, we traverse cities all over the United States many times over while delivering groceries:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rV--X0dKmTeaT0iiKVpudw.png" /><figcaption>Routes followed by shoppers in SF, Austin, Boston and Miami</figcaption></figure><p>How do we bring order to the chaos?</p><p>In the remainder of this post, we’ll first introduce the logistics problem Instacart is solving, outline the architecture of our systems and describe the GPS data we collect. Then we will conclude by touring a series of <a href="http://datashader.readthedocs.io/en/latest/">datashader</a> visualizations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IA61rSXxglUTPab1wXn_uA.png" /><figcaption>Example datashader visualizations at Instacart</figcaption></figure><p>Visualizations like these help us to build intuition about our system, generate hypotheses for improvements, sanity check our changes, identify best practices and improve our operations.</p><p>But before we get too caught up in these visualizations, let’s first quickly cover the problem we are solving.</p><h3>Logistics @ Instacart</h3><p>When using our app to order groceries, you first choose a retailer, and then shop for groceries to be delivered. Over the course of a few hours, we have thousands of such orders to deliver. Doing this efficiently is the job of our logistics systems.</p><p>At it’s simplest, our logistics problem can be viewed as solving a TSP (<a href="https://en.wikipedia.org/wiki/Travelling_salesman_problem">traveling salesman problem</a>) where the shopper must go to the store first. For example, the shopper drives to the store, picks your groceries (along with two other orders), and then delivers them in a sequence:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*apR4VgFp_dsFSkOTrCglZg.png" /></figure><p>There are many algorithms for solving TSPs, and perfect solutions can be found for up to tens of thousands of deliveries. Even with millions of deliveries, heuristics can come within 2–3% of the optimal solution.</p><p>But in practice we have a fleet of shoppers to fulfill orders. Each will be given a batch of orders to shop for, and will then deliver those orders in sequence:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T7F0-Hu5QATba6Tr0Mezog.png" /></figure><p>This problem is called a VRP (<a href="https://en.wikipedia.org/wiki/Vehicle_routing_problem">Vehicle Routing Problem</a>), which generalizes the traveling salesman problem. (<em>Generalizes</em> is a mathy euphemism for ‘even harder to solve optimally’.)</p><p>But we can’t stop there. Instacart is named <strong>Insta</strong>cart for a reason — we commit to narrow delivery windows for our customers (usually 1 hour long). So only a subset of assigned routes will be viable, and we must jointly optimize the expected timeliness of our deliveries with the speed of our movement.</p><p>This is called a VRPTW (Vehicle Routing Problem with Time Windows):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P9Lpc7uvyMPuSUH82xXmgA.png" /></figure><p>If only life were so simple!</p><p>In reality, not all of our shoppers are equivalent. Some have large vehicles, others have small ones. Some have club-cards for retailers like Costco, while others do not. Some can fulfill alcohol orders, while others may not. This means our problem is <em>capacitated</em>, and so we can add a big C to the front of our acronym.</p><p>Furthermore, each vehicle can take more than one trip, which lets us append the letters MT (for Multiple Trips). So really, we have a CVRPTWMT:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JBXl0G9e-_sQwSgzVZWAwQ.png" /></figure><p>Oh, and everything evolves continuously under many sources of uncertainty. New orders are placed. Shoppers come on and off of shift. Weather, traffic and other events wreak havoc on plans. Such problems are referred to as being <em>stochastic</em>, which gives us one more letter — an S!</p><p>So in the end, we are left to solve a SCVRPTWMT (😰). They say that the longer the acronym, the harder the problem is to solve.</p><p>But don’t fret, all is not lost.</p><h3>Naïve to Novel</h3><p>A simple system can be implemented for routing shoppers that accomplishes some of our goals without a great deal of complexity:</p><ol><li>Sort orders by when they are due</li><li>Find the shopper who is free that can do the first order the fastest</li><li>Search remaining orders for any that can be added without being late</li><li>Dispatch the orders found to this shopper</li><li>Repeat</li></ol><p>This will optimize for fulfilling the most urgent orders in the most timely fashion, and seek efficiencies where possible as a secondary objective.</p><p>We began with a variation of this kind of simple greedy algorithm, and have since introduced novel approaches that have had a dramatic impact on our speed, without compromising on late deliveries or order quality:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H2vOXbKBRrRPwPonSaiqyw.png" /><figcaption>We have halved the number of minutes per delivery in San Francisco, and continue to set aggressive goals.</figcaption></figure><p>Some of the changes we have introduced include:</p><ul><li>Machine learning to predict the distribution of time expected for any given shopper and assignment</li><li>Decomposing the CVRPTW into sub-problems (clustering deliveries, shopper assignment) and solving these sub-problems to near optimality</li><li>Applying heuristics for limiting search spaces, dealing with anomalies, fine-tuning solutions and adapting under uncertainty</li><li>Re-computing batch plans every minute and making dispatching decisions just in time</li></ul><p>The application that decides what orders each shopper should fulfill is called our ‘fulfillment engine’, and it is just one component of our overall logistics system, which also forecasts demand and shopper behavior, manages capacity and busy pricing and plans and adapts our staffing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dh523VjfW7rT4bt3dBt5nQ.png" /></figure><p>These systems are highly interdependent, and we are increasingly using <a href="https://www.slideshare.net/JagannathPutrevu/supply-optimization-instacartslideshare">simulations</a> to optimize them jointly under many sources of uncertainty.</p><p>In the months to come we will publish more detailed posts about these systems and the fun engineering, machine learning, optimization and operations challenges they present, so stay tuned!</p><h3>The Data</h3><p>In order to optimize the assignment and routing of our shoppers, and to communicate effectively with our consumers, we collect a stream of GPS location data.</p><p>For example, these are what ten updates might look like for a fictional shopper:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Qq7f2Q2MUe_QlBQirUg5w.png" /></figure><p>Every ~10 seconds, we collect the timestamp, latitude and longitude, speed, direction and accuracy reported by the device. The latitude and longitude are shown here rounded to 4 digits, but are collected to 6 digits in production. The speed is measured in miles per hour (this fictional shopper might be walking to their car). The direction is in degrees, and is -1 when a shopper is at a halt. The accuracy is in meters, and indicates the expected error of the measurement from the real position.</p><p>Over the course of a single day, we collect 10s of millions of these updates across the country.</p><h3>Datashader</h3><p><a href="http://datashader.readthedocs.io/">Datashader</a> provides the ability to quickly and interactively visualize millions, or even billions of points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*gjVvbTI2kAobkxApQZwdRg.gif" /><figcaption>An animation of interactively zooming into a SF datashader plot</figcaption></figure><p>For more information on datashader, I recommend you start with their <a href="https://anaconda.org/jbednar/plotting_pitfalls/notebook">plotting pitfalls</a> notebook. Many of the visualizations in this post are modeled after their <a href="https://anaconda.org/jbednar/nyc_taxi/notebook">NYC Taxi</a> and <a href="https://anaconda.org/jbednar/opensky/notebook">OpenSky</a> notebooks.</p><p>Note that for these visualizations, we show only data points where shoppers are moving quickly while driving and delivering groceries, or we are zoomed into store locations. This is to protect the privacy of our shoppers and our customers.</p><h4>Accuracy</h4><p>First, let’s inspect the accuracy of the GPS data we collect:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hfx8sRSNsrnTWegW30fNYQ.png" /><figcaption>GPS updates in San Francisco highlighting accurate (blue) measurements and inaccurate (red) measurements</figcaption></figure><p>The red points represent inaccurate measurements (more than 10 meters), whereas those in blue are accurate measurements (10 meters or less). We can immediately see that accuracy is poorer in the financial district (upper-right), where tall buildings obstruct the GPS. But even there the data accumulates to clearly show an outline of the streets. The measurements are also less accurate inside of any city block, where presumably the shoppers are indoors and the GPS signal is obstructed.</p><p>We can zoom into one of our store locations and see the shoppers moving through the parking lot with highly accurate GPS locations, but losing that signal within the stores themselves:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JU7oXjKHuGP2Lw3-_krAdw.png" /><figcaption>GPS updates around a store location highlighting accurate (blue) measurements and inaccurate (red) measurements</figcaption></figure><p>Furthermore, there appear to be buildings or other obstructions that ‘shade’ the GPS accuracy over certain parts of this parking lot (see the left hand side).</p><h4>Speed</h4><p>We can filter the the data to just the accurate observations, and then color the observations based on the speed the shopper is moving at:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wT9-l7On6d9n1fjSuNP8Q.png" /><figcaption>Speed of movement in San Francisco (dark blue is slow, yellow is fast)</figcaption></figure><p>This clearly shows our shoppers moving fastest on the highways in San Francisco, and slowest in the financial district. It also shows that moving quickly from the south to the north side of the city is difficult, as there are no fast routes making that connection.</p><h4>Direction</h4><p>If we instead color each point by the direction the shopper was moving in, we can clearly see the organization of the city streets:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dulCz-FeIj1RkKCGzybsWg.png" /><figcaption>GPS updates while moving with color mapped to direction of movement</figcaption></figure><p>One way roads alternate from one block to the next, some roads have traffic moving both ways, and other roads switch directions at certain intersections. The roundabouts and circular exit and entrance ramps make nice color wheels.</p><h4>Store Location</h4><p>When shoppers are delivering groceries, we know the store location they originated from, and so can color the map to visualize what stores frequently deliver to each neighborhood:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ye776YoL3GervVb9K17Rcg.png" /><figcaption>Paths taken when delivering from 10 store locations in SF (deliveries per location sampled to be constant)</figcaption></figure><p>Some stores dominate large areas, especially on the edge of the city. In more congested neighborhoods many streets are frequently traversed by shoppers from multiple stores, and the colors blend together into mixed hues.</p><h4>Shopper State</h4><p>We also measure where each shopper is in their workflow at any given moment. This lets us see what shoppers are doing inside the store locations (when measurement is accurate enough):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*Pp4aIOywZiNYfdRELHjE8Q.png" /><figcaption>High accuracy GPS updates from within a store location</figcaption></figure><p>The checkout area (brown) is near the shopping area (purple), but the staging area (pink) is on another side of the store.</p><p>Or, by visualizing paths instead of points, we can clearly see the movement of shoppers through store parking lots:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*kwMqr0Cf9pFWizu_HL9H3g.png" /><figcaption>Paths followed in the parking lot of a store location while in different states in the app (color)</figcaption></figure><p>Each lane is (mostly) one way (pink or orange), and shoppers enter the store to pick up groceries on one side of the building (blue). You can even see where shoppers typically park while waiting for their next order (yellow).</p><p>Visualizations like these help us to:</p><ul><li>Build intuition for how our logistics system functions at scale</li><li>Generate hypotheses for ways to improve our algorithms or operations</li><li>Confirm that changes to production have the expected behavior</li><li>Make better operational decisions about parking spaces, store locations and our product offering</li></ul><p>If you are interested in joining the team to help us engineer, optimize or analyze our logistics systems, or to work on any of the other many challenging problems we have at Instacart, check out our careers page at <a href="http://careers.instacart.com">careers.instacart.com</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a315925acf3a" width="1" height="1" alt=""><hr><p><a href="https://tech.instacart.com/space-time-and-groceries-a315925acf3a">Space, Time and Groceries</a> was originally published in <a href="https://tech.instacart.com">tech-at-instacart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>