<?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 Bradley Arsenault on Medium]]></title>
        <description><![CDATA[Stories by Bradley Arsenault on Medium]]></description>
        <link>https://medium.com/@brad.arsenault?source=rss-4cc13146bf71------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ubeaq2gBIBDX7025rMKp6g.jpeg</url>
            <title>Stories by Bradley Arsenault on Medium</title>
            <link>https://medium.com/@brad.arsenault?source=rss-4cc13146bf71------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 12:40:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@brad.arsenault/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[What do you need to put into your next chat-bot Request for Proposal?]]></title>
            <link>https://blog.chatbotslife.com/what-do-you-need-to-put-into-your-next-chat-bot-request-for-proposal-a28757a12a75?source=rss-4cc13146bf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/a28757a12a75</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[conversational-ui]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Bradley Arsenault]]></dc:creator>
            <pubDate>Mon, 01 Apr 2019 17:25:37 GMT</pubDate>
            <atom:updated>2019-04-03T17:00:01.650Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*tHNxMe5KHAeD8E6mNySSAQ.jpeg" /></figure><h3>Introduction</h3><p>So you want to make a chat-bot, but you don’t have the skills to build it in-house. You need to hire an outside firm to build it for you. You want to create a clear and concise document describing what to create. These RFPs (request for proposals) are a great way of communicating the needs of your chat-bot to potential firms. At Electric Brain, we have seen a variety of different RFP’s come our way and we can offer some tips on what to include.</p><p>There are three main sections for a good chat-bot RFP: Business Context, Interactions and Data. Additionally, for customer-service bots that need to integrate with complex software environments, its good to include a thorough Technology Context as well.</p><figure><a href="https://www.eventbrite.com/e/chatbot-ai-conference-tickets-55380774387"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ac4Wm94IFfL37KAAXnEUXQ.png" /></a></figure><h3>Business Context</h3><p>Designing your <a href="https://chatbotslife.com/">chat-bot</a> will necessarily involve many decisions and compromises, and to make those choices wisely, we need to know the business context for the chat-bot. Try to answer the following questions:</p><ul><li>What is your business?</li><li>Why do you want this chat-bot? Save money? Improve quality of service?</li><li>What type of activity is this chat-bot doing? Sales? Customer Service? Billing? Technical Support?</li><li>How many people do you have already in your contact center?</li><li>What are the typical handle times? How much does it cost you with humans?</li></ul><h3>Top 4 Most Popular Bot Design Articles:</h3><blockquote><a href="https://chatbotslife.com/how-to-quickly-improve-your-chatbots-retention-engagement-ed41ebbaca0b">1. How to Quickly Improve your Chatbot’s Retention &amp; Engagement</a></blockquote><blockquote><a href="https://chatbotslife.com/what-10-billion-messages-can-teach-us-about-making-chatbots-fb796781bb4a">2. What 10 Billion Messages can Teach us About Making Chatbots</a></blockquote><blockquote><a href="https://chatbotslife.com/bots-super-personalization-on-steroids-8cd4ee3a9e8b">3. Bots &amp; Super Personalization On Steroids</a></blockquote><blockquote><a href="https://chatbotslife.com/chatbot-conference-2019-in-nyc-8b010058f8f9">4. Chatbot Conference 2019 in NYC</a></blockquote><ul><li>How long has your contact center been operating?</li><li>How much training the agents in your call center take?</li><li>Are there are any significant projects / changes underway within your contact center?</li><li>How do you view quality vs cost trade offs within your contact center and your business overall? Do you focus on best customer service? Or lowest cost that meets SLA? If you can only pick one, which do you choose?</li><li>What kind of security, privacy, and regulatory compliance issues do you have to deal with?</li><li>What do you expect from the chat-bot? What kind of accuracy? What kind of cost savings of revenue gain?</li></ul><h3>Interactions</h3><p>Next you need to discuss the types of customer interactions your <a href="https://chatbotslife.com/">chatbot</a> needs to handle. Try to break apart the different interactions that you want as much as possible. The more detail the better. If you only want your chat-bot to triage incoming requests out to the humans, then you have just one interaction. If you want to handle all different departments and all different types of inquiries, then you may have many interactions. Try to answer all of the following questions, for each of the interactions that you want the chatbot to handle:</p><ul><li>What questions need to be asked for this interaction? E.g. What “data” is needed?</li><li>How standard is the conversation? Do you have a standardized call blueprint for this interaction? Do you have any templated responses for it? Or is every call very unique and different?</li><li>What does a typical dialogue look like for this interaction? Can you provide us access to the data for a few real examples of this interaction? Can you provide access to the call blueprints (if they exist)?</li><li>Is it common that customers are angry / upset / emotional in some way during this interaction?</li><li>What other software, like internal backend systems, CRMs, or third party software, is needed for this interaction? (get exact names of the software packages these agents are using to handle this interaction)</li><li>How much time does it take? What is the cost? How big is the variance on these two numbers? Highly predictable or large spread? Is it skewed heavily (e.g. 99% take only 10 minutes, 1% take 4 hours)? How often does it occur?</li><li>What level of knowledge is required to handle this query? Is this done by entry-level contact center individuals or does it require highly specialized experience / training?</li></ul><h3>Data</h3><p>Data is the core of every AI system and a <a href="https://chatbotslife.com/">chatbot</a> is no different. Try to answer the following questions about data within your chat-bot RFP?</p><ul><li>How have you been keeping records of historical conversations with your contact center agent? What software have you been keeping it in?</li><li>How many historic conversations do you have? (try to provide exact number, not rough estimate)</li><li>What ways do you use data to analyze your contact center already? What kind of classifications do you have? What tools do you use?</li></ul><h3>Technology Context</h3><p>If your chatbot is a customer service bot, then it will need to be integrated into the larger technology environment of your company. Executing transactions like password resets or billing changes require making hard changes in your backend software systems, which makes the technology context very important. This alone entails a thorough technology discovery session.</p><p>If your chatbot is a sales bot or a simple question answering bot, then complex integrations to your supporting technology may not be necessary, so you can safely skip this section.</p><p>Otherwise, try to give details on the following general technical discovery questions, as appropriate for your chat-bot:</p><h3>Architecture</h3><ul><li>Servers? APIs? Internal-microservices?</li><li>Databases? Message broker? Gateways / proxies? Data lakes? Hadoop clusters?</li><li>Operating systems? Programming languages?</li><li>Frameworks? Frontend? Backend?</li><li>Legacy parts of the codebase? Rewrites in progress? New projects under development?</li><li>Mobile app? Embedded software? Special / unusual portions of software?</li><li>Background tasks? Where is data analysis currently done (if any)?</li><li>Analytics tools? Security tools? Log analysis? Authentication services?</li><li>Third party systems interacted with?</li></ul><h3>Development &amp; Deployment</h3><ul><li>What is your development process? Agile? Scrum? Custom? What tools do you use for managing it?</li><li>Where is software deployed? On-site? Private cloud? Public cloud? Hybrid?</li><li>When do new versions get rolled out? How frequently?</li><li>Do you have different environments? Staging, Sandbox, Production? What is the breakdown?</li><li>Can we get access to a testing or staging environment for the next month?</li><li>Who approves new versions? What does a typical release look like?</li><li>How does on-site software get updated? Automatically? Manually? Is the client informed?</li><li>How does your team handle backwards &amp; forward compatibility issues?</li><li>How do new versions get tested? What is your quality assurance process?</li><li>How do customer support requests get handled? How does it fit back into your R&amp;D process?</li><li>What special services of the cloud provider do you take advantage of (if cloud)?</li><li>How do new clients get on-boarded? If on-site software, how does that on-site installation get done? Who does it?</li><li>Are their third parties / resellers / consultants involved in any of your relationships? How does that change the process?</li><li>How much customization is done for new clients?</li></ul><h3>Development &amp; Deployment</h3><ul><li>What is your database software? Do you have any alternative data systems for specialty data processing?</li><li>How does data get moved between the different systems? What is the “master” for different types of data?</li><li>How many tables? Which tables are relevant for the AI system? How do the tables relate to each other?</li><li>Go over fields for relevant tables. What are the types? What are the different values for the enums?</li><li>Can we get samples of the data for each of these tables? Potentially an entire sample database from a testing server?</li></ul><h3>Conclusion</h3><p>Creating an RFP for a chat-bot can seem like a daunting process, especially if you are new to the technology and don’t understand how it works. However, if you stay focused on communicating what you <strong><em>do</em></strong> know about your existing contact center, about your business, about your technology and about what you want from the chatbot, then it becomes very easy for agencies like Electric Brain to quote your chat-bot quickly.</p><h3>Don’t forget to give us your 👏 !</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/0*F1Hz__ZU1diFisz5" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F3e59ef%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F3e59ef&amp;image=http%3A%2F%2Fapi.screenshotlayer.com%2Fapi%2Fcapture%3Faccess_key%3Dfe59908dad3baab69ffab249a2224b03%26viewport%3D1024x612%26width%3D1000%26url%3Dhttps%253A%252F%252Fupscri.be%252F3e59ef%253Fscreenshot&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href">https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href</a></iframe><figure><a href="https://chatbotslife.com/bot-communities-mastermind-group-d2dae9876709#.53x0py6ou"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*6XUspT9JOSq0w0Fi35HIaA.png" /></a></figure><figure><a href="https://m.me/ChatbotsLife"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*c1LDMH5vbnIz9rmAka8Hwg.png" /></a></figure><figure><a href="https://chatbotslife.com/chatbot-development-hire-top-ai-chatbot-developers-c8b45ef7f207"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*D0Jf3dI6ZThtqcfwDYY7mg.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a28757a12a75" width="1" height="1" alt=""><hr><p><a href="https://blog.chatbotslife.com/what-do-you-need-to-put-into-your-next-chat-bot-request-for-proposal-a28757a12a75">What do you need to put into your next chat-bot Request for Proposal?</a> was originally published in <a href="https://blog.chatbotslife.com/">Chatbots Life</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Measuring Accuracy is Hard (and important!) Part 4. How to Measure Accuracy Better]]></title>
            <link>https://medium.com/data-science/why-measuring-accuracy-is-hard-and-important-part-4-how-to-measure-accuracy-better-e072a26f4827?source=rss-4cc13146bf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/e072a26f4827</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Bradley Arsenault]]></dc:creator>
            <pubDate>Wed, 20 Mar 2019 19:32:48 GMT</pubDate>
            <atom:updated>2019-03-28T12:53:50.543Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Measuring Accuracy is Hard (and important!) Part 4.</h3><h4>How to Measure Accuracy Better</h4><p>This is the last article in a 4 part series of articles about measuring accuracy.</p><p>In the first article, I discussed Why exactly measuring accuracy is important. If you haven’t, go check it out here: <a href="https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-very-important-part-1">https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-very-important-part-1</a></p><p>In the second article in this series, I discussed the most common and usual scenarios that get in the way of measuring accuracy of models. If you haven’t read the article, give it a look here: <a href="https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-important-part-2">https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-important-part-2</a></p><p>In the third article in this series, I discussed the more difficult and unusual scenarios that come up in measuring accuracy of models. If you haven’t read the article, give it a read here: <a href="https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-important-part-3">https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-important-part-3</a></p><p>Now in the fourth and final installment of this series, I’m going to get to the real meat — the information we all crave. How do we do it better? With all these problems that can come up in measuring accuracy, how do we avoid pitfalls and measure accuracy better? The unfortunate answer is — it depends. There is no easy answer and no one-size-fits-all solution to the problem. So instead of just giving you a few tips and suggestions (there will be some of those), I instead want to give you a framework for thinking about how to measure a model. Choosing the metrics to measure your model with is an intellectual exercise. The best route forward may involve several different metrics — different numbers used for different reasons.</p><p>In general, our process has a few steps:</p><ul><li>Carefully consider and discuss what you want the metric to do. What is the purpose of the metric? Is it a communicatory metric, intended for outside stakeholders to understand a model? Or is it a research metric, helping guide your team in their research of the model? Or is the metric used internally by elements of the model itself? Do you have multiple different purposes / reasons for metrics?</li><li>Brainstorm a list of candidate metrics. Don’t be afraid to engineer a metric or formula of your own creation</li><li>For each metric, consider the Pros/Cons relative to the purpose of the metric. Don’t just leave this in your head, really get these pros and cons written down on paper and laid out in front of you.</li><li>Select a metric, and stick with it until it has served its purpose.</li></ul><p>Now we will go through each of these steps.</p><h3>Define the purpose of the metric</h3><p>The first step in measuring your model is to define the purpose of your measurement. It’s easy to just dive in, write a bunch of model code, wrap it in 5-fold cross validation and call it a day. What is harder is to take a step back, look at precisely why you are measuring accuracy, and carefully construct a metric to serve your purpose.</p><p>Metrics can have many distinct purposes, each with its own nuances and issues. I find that these purposes are put into a few broad categories:</p><p><em>The metric is used for communication with stakeholders:</em></p><ul><li>The metric may be used by managers and bosses to evaluate the performance of the team</li><li>The metric may be used by product managers and designers to understand the behavior of the algorithm and its potential impact on users</li><li>The metric may be used by salespeople to tout the strength and efficacy of the system to potential customers</li><li>The metric may be used by customers in order to understand how much faith they should put in the results of the model relative to other information that they have available</li><li>The metric may be used by regulators in order to understand the potential societal impacts of the model</li><li>The metric may be used by clients to check if the model meets their performance requirements</li><li>The metric may be used by other industry experts in order to benchmark your model against other models</li><li>The metric may be used by a whole variety of stakeholders to determine whether the model should be used at all — whether it meets a minimum performance level to be put into production</li></ul><p><em>The metric is used for internal R&amp;D and research:</em></p><ul><li>The metric is used to compare the performance of the model over time and how much improvement is being made by the R&amp;D team</li><li>The metric is used to directly evaluate whether a particular change in the model lead to better or worse performance</li><li>The metric is being used to understand the behaviour of the algorithm and generate clues as to what might work to improve the performance (as opposed to being used to evaluate a specific change that’s already been thought up)</li><li>The metric is being used to evaluate how much your model is expected to improve over time as your dataset size increases</li><li>The metric is being used to solve a specific / discrete problem with the model, such as a specific under-performing component or subsystem, or evaluating the models performance on important subsets of the data</li></ul><p><em>The metric is used for internally by the algorithm itself, to regulate or improve its own behavior:</em></p><ul><li>The metric is used by an optimization algorithm to tune the hyper-parameters of the core model and maximize its accuracy</li><li>The metric is being used by a wide model-search algorithm to automatically select from a wide variety of different models, for example, in AutoML</li><li>The metric is being used to perform early stopping on the algorithm, e.g. by stopping neural networks before they overfit or to select the number of boosting rounds in a boosted tree algorithm</li><li>The metric is being used to set acceptable confidence thresholds on the results of the algorithm</li></ul><p>Each of these different purposes for measuring your model will entail different strategies for measuring your model. You must choose and design a metric that is appropriate to your situation.</p><p>For example, let’s consider broadly a few of the differences between a metric designed for external stakeholders from one designed for internal R&amp;D.</p><p><strong>Metric for External Stakeholders</strong></p><ul><li>Must be simple and easy to interpret by non technical people</li><li>Needs to be very precise, to give confidence in the answer</li><li>Needs to capture the end-to-end / final result behavior of the system</li><li>Needs to be reliable and noise free to set expectations straight</li><li>Needs to reflect the current performance of the model in production, all things considered</li><li>Needs to reflect the data distribution from the users perspective, e.g. class inbalances in</li></ul><p><strong>Metric for Internal R&amp;D</strong></p><ul><li>Must provide a clear indication of improvement or regression</li><li>Precision needed varies by the level of noise in the model and whether your going for big improvements or small gains</li><li>Needs to capture internal behavior of the system</li><li>Needs to be fairly quick and easy to compute often</li><li>Needs to serve as a stable benchmark over time, isolating the impact that the research team has on the model from other factors</li><li>Needs to reflect the data distribution from the research perspective, e.g. with class in-balances normalized</li></ul><p>As you can see, the requirements for metrics for such differing audiences and purposes are quite different.</p><p>So the first step of our framework is just starting from the purpose of your metric. Don’t just do it in your head — really get it down on paper, in a document, why exactly you are measuring. You may find that there are multiple reasons you are measuring a model. If you really want to measure better, that may mean you have to invest in maintaining multiple different metrics. This can be a lot of additional work, but the result is that you can be confident in your measurements and focus your effort on your research objectives.</p><p>When going through this process, try to answer the following questions:</p><ul><li>Who is the audience of the metric? How tech savvy are they? How machine learning savvy are they?</li><li>What is that audience going to do with the metric? How would they behave differently if the metric is good? What if it is bad?</li><li>Is the audience going to use the metric just once? Or are they monitoring the change in the metric over time?</li></ul><h3>Brainstorm / Engineer A Few Candidate Metrics</h3><p>The next step in measuring your model better is to brainstorm a list of potential candidate metrics. Like any good brainstorming session, its best not to come to conclusions too early. Really try to spit-ball and just come up with different ideas for how you can measure a model. You can’t really make a decision if you don’t have multiple possibilities to decide between.</p><p>While brainstorming, you should at least write down / consider all of the well known metrics that serve your purpose. This may require you to do some research, especially if you are applying data-science into a new domain that is not your expertise.</p><p>However, you should also consider the possibility of engineering metrics to serve specific purposes. Often this might involve modifying a well known metric in a way that is specific to your problem. In other ways, it may involve genuinely going out on new territory, creating new equations and original methods of analysis. Some of the ways of constructing a metric include:</p><p><em>Evaluating a well known metric, but only on specific subsets of your dataset.</em></p><ul><li>For example, if you are a self-driving car company, you may care more about the performance of your vehicle in edge case situations. So although your broad dataset may contain mostly data in Sunny, normal driving conditions, you may instead decide to measure your model in various poor weather conditions, such as rain or snow, and completely omit the Sunny data from your measurement</li></ul><p><em>Creating a small dataset specifically for the purposes of measurement.</em></p><ul><li>For example, when doing clustering, you may go through 100 or 200 entries and just manually break them into clusters yourself. Then you can measure how often items that are clustered by the algorithm are put into the same clusters by your humans.</li><li>Another example is if your algorithm operates in the middle of your system, but its outputs are run through further post-processing to produce the final result. Then you may want to put together a small dataset of final results and validate them, just to ensure that your post-processing is correct</li></ul><p><em>Applying certain types of augmentation on the data your metric is measured on:</em></p><ul><li>For example, when doing image processing, training augmentation is standard. But in certain situations, you may wish to measure the accuracy of augmented validation images as well. For example, when processing images of perfectly round objects like pills, you may wish to measure accuracy at all 360 degree angles of rotation, to ensure the network isn’t overfitting to any particular orientation.</li></ul><p><em>Breaking down your metric results based on categories within your data:</em></p><ul><li>For example, when doing document processing of many forms, you may want to measure the differing accuracy of different formats of documents, even though you train your algorithm on all of them jointly</li></ul><p><em>Making your metric “harder” or “easier” if your model is at the very high or low end of typical metrics:</em></p><ul><li>When performing some types of data extraction on very standardized documents, it might be relatively easy to achieve very high levels of accuracy by measuring things on a word-by-word basis. Instead, you may switch your measurement to be on a whole-document basis — correct only if every single word in the document was correctly analyzed.</li></ul><p><em>Consider modifying the metric so that certain things considered a failure are instead counted positively, or vice versa:</em></p><ul><li>For example, when doing a hard classification model with a very large number of labels, you may consider a Top-5 style measurement. That is, if the correct label shows up anywhere in the top-5 predicted labels, then it is considered a correct result.</li><li>In many cases when doing data extraction, we have the problem that the vast majority of words in the document are meant to predicted as “null” or “don’t extract”. This might lead us to using metrics like Precision/Recall/F1 score, but we felt these metrics were hard to interpret for the audience of metric — the client, who is not technical. We have instead opted for a simpler metric, measuring the raw-accuracy but with a twist: excluding any entries that were both predicted as”‘null” and actually “null” within the dataset. That is to say, we measured the accuracy on True Positives vs False Positives and False Negatives, but we excluded True Negatives from the metric. This provided much needed interpretability to the metric, but didn’t artificially inflate it close to 99% because of the overwhelming number of True Negatives.</li></ul><p><em>Considering different ways of splitting your data between training, testing, and validation:</em></p><ul><li>You may consider doing more or less cross-validation, depending on the situation. E.g. with big deep learning models, you may only train a single model with no cross-validation. On highly noisy problems working with boosted trees, you may go all the way with a 10-fold cross.</li><li>You may consider splitting your data along different dimensions. E.g. when trying to predict user purchase behaviour, you have several possible splits. You can do a full 70/20/10 split across all data generally. You may also just split the users table to see how your algorithm generalized across users. You may also split cross the time dimension (sometimes called back-testing), e.g. how good are you at predicting user behaviour for March given all the data from February and before.</li><li>You may also consider having a metric for the “live” data coming into your system. E.g. how is a model trained on data from 2018 and before perform in 2019, in real-time</li></ul><p><em>Normalizing the metric in various ways:</em></p><ul><li>You may use a typical metric, but modify it so that is invariant to the wildly differing “sizes” of your samples, E.g. normalizing it between 0 and 1.</li><li>You may try to make the metric invariant to class-imbalances within different samples</li><li>You may decide to use statistical P-tests on your metrics and their changes, considering the noise of your algorithm, instead of just looking at the metric directly</li></ul><p><em>You may only consider your models performance relative to a “benchmark” model:</em></p><ul><li>When doing various forms of model-compression, where we take deep neural networks and compact them for processing on edge devices like phones and cars, we may have a full-size model that has been validated to work with high accuracy. What we care about is the performance of our shrunk model in comparison to that full-size model. This approach may open us up to measuring performance on a larger dataset, e.g. unlabelled data that can’t be used for training. We can use the full-size model as the benchmark of ground-truth to measure accuracy on the shrunk model</li></ul><p><em>You may consider measuring accuracy using some sort of validation routine. That is, if you have an effective way of validating whether the models output is at least good (although not correct), this may give you an additional way to measure your model on unlabelled data</em></p><ul><li>For example, when building receipt processing technology, we actually had a simple validation routine that we could run on the outputs of our model, to see if they made sense: We took all of the extracted item totals, and checked to see if they added up to the final total at the bottom of the receipt. If the numbers all added up, we could know the output from our model was at least reasonable, even without having any ground truth. In practice we had issues with certain retailers who’s receipts would not actually add up (ahem… Walmart, Apple) but the validation routine worked on most merchants most of the time.</li></ul><p><em>Creating your own equation to describe the behavior that you want:</em></p><ul><li>For example, in more esoteric and novel uses of machine learning, there may not be a clear direction on how to measure your model. A lot of generative models and reinforcement models fall into this category. You might be completely out a limb, using some frankenstein mashup of entropy statistics and other measures</li><li>In one situation when doing bayesian optimization on deep neural networks, I was having problems with the network falling into a good local minima quickly, but then not improving there-after. So instead of optimizing for the final validation accuracy, I instead optimized for the slope of accuracy over the training of the algorithm. I wanted a neural network that was continuously improving, instead of improving a lot quickly then flattening. And remarkably, it worked!</li></ul><p>With all of these considerations, you should be able to come up with at least a few different ways of measuring your model. Again it’s important not to just get caught up on picking some commonly used metric like F1 score and just running with it. If you haven’t really thought through the various options for yourself, then you can just end up shooting yourself in the foot with a metric that confuses stakeholders and does not reflect real-world performance.</p><h3>Evaluate the Pro’s and Con’s of each Metric</h3><p>With multiple possible metrics on the table, you now need to consider the Pro’s and Con’s of each of your metrics relative to the purpose of your metric.</p><p>Try to consider each of the properties of your metrics:</p><ul><li>How “interpretable” is the metric? That is, would it be easy for a non-technical lay-person to be told the metric and predict how well the model should behave?</li><li>How noisy is the metric? How much noise can your purpose deal with?</li><li>What type of generalization does the metric tell you about? What types of generalization might it ignore or not capture? Can your metric be good and your model still underperform in some way?</li><li>What are the success cases that the metric does not capture? What are the failure cases that your metric does not capture? How does your metric weight the different kinds of success and failure cases?</li><li>Is there a “harder” version of this metric that you can think of? An “easier” version?</li><li>Does the generalization this metric is supposed to capture match the generalization that your model needs in production?</li><li>Are there certain failure cases that you already know about, but wouldn’t be strongly reflected within this metric?</li><li>How does the metric cope with the changes in size / properties / composition of samples in your dataset? Is your metric “biased” in that it might over-represent or under-represent certain subsets of your data that are larger or more complicated than others?</li><li>Is there any way that this metric could be high and the model will still behave poorly in the way you care about? Is this metric directly measuring the outcome you care about, or is it only tangentially measuring an outcome related to what you care about?</li><li>Do any of the failure cases of measuring accuracy that are discussed in Articles #2 and #3 in this series apply to your situation? How does this metric cope with that problem?</li></ul><p>Now, we offer some tips on how to pick apart good metrics from bad ones. These are just our own thoughts and ideas, based on our past experiences with measuring models. You should thoroughly evaluate your own situation to ensure your metrics are fit for purpose:</p><p><em>Metrics meant for non-technical people need to be simple.</em></p><ul><li>They can not be constructed in the slightest bit from obscure math equations or statistics. Even MSE (mean squared error) is not easy to interpret. I instead find that MAE (mean absolute error), sometimes normalized to percentages, allows my client to really visualize the performance of the model in their head. Plain vanilla accuracy is better then obscure stats like F1 score or AUC for non technical people</li><li>They need to tell a story. They need to allow the person to visualize in their mind people interacting with the model, both when it succeeds and makes mistakes. This means the metric needs to be framed from the perspective of the end-user and how they will experience the model, rather than describing some internal property of the system.</li><li>They need to be in units people understand. Measuring the image-recognition of a self-driving-cars accuracy in a per-frame basis just doesn’t make sense for a non-technical audience. The metric is instead better constructed in minutes or hours, e.g. number of minutes or hours without mistakes.</li><li>They generally should be more plain vanilla — less normalized and with class in-balances included. The only normalizing you should do is putting a number in terms of percentages. Non technical people don’t like numbers between 0 and 1, but percentages are easily understood.</li></ul><p><em>Metrics that are meant to be used for internal R&amp;D need to be stable and consistent:</em></p><ul><li>If you’re metric could change over time, without any change in code, then it’s not useful for R&amp;D. For example, if your training dataset is growing rapidly with time. You need to lock in those testing, training, and validation sets before you proceed at the very least. You can update them regularly when needed, but you should go for at least a month or two with numbers that are comparable to each other. The longer the better.</li><li>Your metric needs to be relatively invariant to various properties of the samples in your dataset. It should be normalized across things like the size or complexity of a sample.</li><li>Ideally, your metric is invariant to any known class in-balances in your dataset</li><li>Your metric needs to be relatively “centered”, e.g. it should not be really close to perfect, and it should change in a meaningful way as you make improvements. If you’re already hitting close to 99.7% but you’re job is still to make improvements on those 0.3% errors, then you might be better off redefining your metric to be “harder”, so that improvements in those 0.3% errors are magnified and more noticeable. Instead of measuring a top-5 classification result, move down to top-1 measurement. Conversely a metric that stays near 0 even when you’re making progress is also not very useful. The granularity has to be right for the stage of research your at.</li><li>The metric should in general lean more towards the “hard” side. A very high value on this metric should give you utmost and total confidence that your model is really good. It should not leave any uncertainty or open questions</li><li>The metric should provide a “clear answer”, in the sense that when you get the result on the metric, it shouldn’t leave you with uncertainty about whether your change was actually better or worse. If you’re researching a specific sub-system or problem with your model, using a purpose built metric for that sub-system or problem is going to give you a more clear answer then your general purpose end-to-end metric. If your results have a noise rate that is larger then your expected improvement, you need to increase your cross validation.</li><li>It’s much more acceptable to use obscure and constructed metrics. It’s also more acceptable to have multiple metrics, metrics on specific subsets of the system, and to use graphs and charts instead of single metrics.</li></ul><p><em>Metrics that are being used to measure the relative performance between two models are different then measuring its absolute performance:</em></p><ul><li>When measuring relative performance, we have much more freedom to choose different metrics. Most metrics we can think of have a well formed definition of “better” or “worse” and we have reasonable expectations these correlate with end-user results.</li><li>When trying to measure absolute performance (e.g. for communication to managers, external stakeholders, or just for our own evaluation prior to product launch), we need to be much more picky. The metric needs to be very closely aligned to the “end-to-end” or “final-result” behavior of the system. Much like the metrics for non-technical people, these metrics need to be constructed from the perspective of users. They need to be done on the latest possible data, rather than on a training/testing set locked in months ago. They need to reflect the current expected production performance of this model, if it was deployed to production today.</li></ul><p><em>Metrics used for programmatic purposes, such as hyperparameter optimization, or early stopping are more tolerant of noise, but much less tolerant of poor metric construction.</em></p><ul><li>Bayesian optimizer by definition are probabilistic and resistant to noise. These algorithms can derive more inference and knowledge from having 5 times as many run, but with 5x noisy results, then they can with 5 times fewer runs but with 5x less noise. The problem comes if your metric is poorly constructed — now your bayesian optimizer may be making your model more and more overfit in a direction that you care about, while appearing to make it better. This generally occurs when you are close to the peak performance of the model, where a poorly defined metric prevents the model from hitting the correct peak.</li></ul><p><em>Metrics for all purposes need to capture the dimensions along which your algorithm is meant to generalize:</em></p><ul><li>For systems that are meant to make predictions of future behaviour based on past data, it’s common to make the error of measuring an algorithms performance at generalizing across different samples broadly, without considering how those samples are constructed. E.g. doing an 70/20/10 split across the entire dataset. But often what we really care about is measuring its performance across the time dimension. E.g. predicting how a user behaves in October based on their data from September and before. Doing a standard 70/20/10 split gives your metric an unfair advantage, since the algorithm was trained on data from the future and measured on the past. Your algorithm does not actually have any future data to learn from in the real operating environment, resulting in a form of leakage.</li></ul><p>Again, these are just some tips and things we have noticed about picking good metrics. There is no one answer to the question of how to measure a model. It’s very easy to tweak your measurements just slightly and then get the outcome you desired. If you’re model isn’t performing well enough to meet expectations, you can just tweak you’re measurement of it. But this isn’t a sound scientific practice — its just self-delusion. Poor use of metrics leads to false expectations and false hopes.</p><h3>Select a metric and stick with it</h3><p>When I was first becoming sophisticated in my understanding of data science and artificial intelligence, I worked at a startup called Sensibill. Our basic problem was to extract structured data out of images receipts. But none of us had any data extraction expertise — we were just a bunch of full stack developers who had come together to build the solution. Both the algorithms and the dataset they operated on were being cobbled together as we went.</p><p>One of my first experiences with the problem of measuring accuracy comes from those days. Over the 2 ½ years that I spent developing that system, we kept introducing more and more metrics. The managers would get confused when a metric indicated great performance, and their subjective evaluation of performance in the real world was not as good. The response would be to introduce a new metric. This would repeat every 3–6 months. We would create specific subsets of our dataset used for testing (a bunch of them). We would create different validation routines on results and measure our accuracy against them. We would have different metrics in different environments (production vs staging vs development). We had rolling average numbers and monthly numbers, recent-100 numbers, and numbers computed on the fly on testing sets. We would have some metrics that reported excellent results, and other ones that seemed to indicate that the model was near total shit. To me, it became metric salad, and none of us really knew how well the system behaved for our end users. We also didn’t have any clear idea of what was making the system better or worse.</p><p>Looking back on those years with more experience, I came to understand that the problem wasn’t that we weren’t trying to measure the accuracy. We certainly devoted a lot of effort to measurement of the system. Nor was it that we didn’t know how to measure our system — we certainly had a lot of expertise on that, and some of the metrics we did have I would now consider the “correct” ones that we should have trusted (although I’d make some improvements).</p><p>The reason it wasn’t working is that we were fundamentally conflating the different purposes for the different metrics. We knew the questions we wanted answered. But we weren’t carefully selecting which of the metrics available to us would give us those answers. Additionally, our metrics weren’t really fit for purpose and always had some sort of flaw versus what we cared about. This problem lead to a breakdown in communication between different teams and departments as people’s expectations did not align with what they were seeing in the application. And this wasn’t always in the negative direction — certain users experienced unusually good results from the application — however this only resulted because they uploaded short, easy receipts. It was a biased sample. This mismatch between expectation and reality then lead to more effort being spent developing ever more metrics.</p><p>If you have carefully designed your metric, and considered all the problems associated with it; if you are confident it will actually answer the question you want to answer, then stick with it. Trust it. Work to improve your model using it. Communicate it to people as appropriate. When you add new metrics, consider it thoughtfully and don’t let yourself become overwhelmed by metric salad. Have a few specific, thoughtful metrics that are designed for the requirements you have. Try to upgrade, improve or replace existing metrics, rather then create additional ones. Create temporary metrics to solve specific problems, and then discard them once the problem is solved, or at the very least, confine them to automated tests. Keep your eyes on the prize.</p><h3>Conclusion</h3><p>In this article, we have discussed a process for measuring your model better by going through a thoughtful exercise on what your needs for measuring are. The exercise should not take more than a couple of hours, but exhausting that brain energy and going through the process thoroughly may lead you to better performing models.</p><p>The process starts by considering the reason for measuring. You may in fact find you that you have multiple distinct purposes. At the very least, everyone will experience a dichotomy between the external communication purposes of metrics, and the internal R&amp;D purpose of metrics.</p><p>We then proceed to brainstorm a bunch of candidate metrics. The goal should be to not just presuppose that some commonly used method of measurement is correct for us. We should really try to consider different methods of measurement, and potential modifications that we can make that will serve the purpose of the metric better. Then only after brainstorming multiple candidates options, we evaluate the pro’s and con’s of each for our purpose.</p><p>Finally, after going through this process and actually selecting a metric (or multiple metrics) that serve the purposes that you have, you should stick with them. Having a set of metrics that can serve as a reliable benchmark over time is good for everyone — stakeholders, managers, and researchers all benefit.</p><p>Thank you for reading through this entire series of articles on measuring accuracy.</p><p><em>Originally published at </em><a href="https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-important-part-4-how-to-measure-accuracy-better"><em>www.electricbrain.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e072a26f4827" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/why-measuring-accuracy-is-hard-and-important-part-4-how-to-measure-accuracy-better-e072a26f4827">Why Measuring Accuracy is Hard (and important!) Part 4. How to Measure Accuracy Better</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Measuring Accuracy is Hard (and important!) Part 3. The hard problems in measuring accuracy.]]></title>
            <link>https://medium.com/data-science/why-measuring-accuracy-is-hard-and-important-part-3-the-hard-problems-in-measuring-accuracy-74c7249e7308?source=rss-4cc13146bf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/74c7249e7308</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Bradley Arsenault]]></dc:creator>
            <pubDate>Wed, 20 Mar 2019 19:31:45 GMT</pubDate>
            <atom:updated>2019-03-27T13:34:32.601Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Measuring Accuracy is Hard (and important!) Part 3.</h3><h4>The hard problems in measuring accuracy.</h4><p>This is the third article in a series of articles discussing the topic of measuring accuracy.</p><p>In Part 1 of the series, we discussed reasons why measuring accuracy correctly is very important. Check it out here: <a href="https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-very-important-part-1">https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-very-important-part-1</a> A quick TLDR: measuring accuracy is important for two major reasons. The first is that it allows us to make our models better — and know how good they are currently. The second is that it allows us to communicate to stakeholders what their expectations of the model should be.</p><p>In Part 2 of the series, we discussed the most common and typical problems that can get in the way of measuring accuracy. Check it out here if you have not read it: <a href="https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-important-part-2">https://www.electricbrain.io/blog/-why-measuring-accuracy-is-hard-and-important-part-2</a> A quick TLDR: there are a whole host of things that get in the way of measuring accuracy, from our complex expectations of how we want our models to behave, to the complex nature of the data that it is expected to operate on, through to the complex ways we have to piece together multiple algorithms to form a complete system.</p><p>In this article, Part 3 of the series, I will be discussing the more unusual, interesting, and difficult scenarios that come up in trying to measure accuracy for a model.</p><h3>You may not have any ground-truth data for your model</h3><p>This is probably the most difficult scenario to deal with in machine learning in general. You might ask, how can you possibly train a machine learning algorithm without any ground truth data? Isn’t the data used to train the algorithm capable of being used for ground-truth?</p><p>If you think about it more carefully, there are a variety of situations where we are applying machine learning without really having ground-truth data:</p><ul><li>When performing unsupervised learning of many types, e.g. clustering, or recommendation engines. There is no correct answer for what clusters or what recommendations are the correct ones, there are just various measures of better or worse</li><li>When we are building a new product from the ground-up, using synthetic data to bootstrap the system but then building a dataset based on real-world data after launch. Synthetic data is not a true ground truth for the data the algorithm is being applied on.</li><li>In many data science processes like lining up two different noisy datasets, e.g. matching two different databases based on company &amp; brand names. We may not have any ground-truth on the correct alignment between the two datasets. It may be possible to build some ground-truth, but just too expensive or time consuming that the organization does not feel it’s worth it. The whole point of the model in this instance is to avoid manually lining up entries</li><li>We may be training our machine learning algorithm on ground-truth from an intermediate step in the system, but the output then goes through a whole series of post-processing algorithms which transform it into the final result. We don’t have ground-truth on that final result.</li><li>When doing reinforcement learning, like training robot AI’s within simulations, and then trying to transfer that knowledge to a real robot.</li><li>We may be making heavy use of transfer learning to build our product</li><li>We are building a pipeline that doesn’t involve machine learning, e.g. using conventional computer vision techniques to build a person-tracking algorithm. It may be too expensive in your context to get any significant amount of data labelled, or something you’ll do when you R&amp;D budget is larger. For now, you just need a prototype that looks like it works.</li></ul><p>The more that you work in machine learning, the more you will be operating in environments where there is no real ground-truth for the problem you need to solve, or at least there is so little of it that its barely useful.</p><h3>There may be no off-the-shelf metric which measures accuracy for your model effectively</h3><p>When you are doing really pioneering work in AI and data science, you may encounter situations where it’s not really clear how to measure the performance of the model. It’s not that the performance can’t be measured, but there may be multiple seemingly equally valid ways of measuring that performance, but which say different things about the results. There may be obscure metrics and measurements that are buried deep within the research and literature, or even some more common metrics that you just aren’t familiar with.</p><p>I find this situation presents itself in a few different environments:</p><ul><li>You are taking a recently established machine learning approach into an entirely new field: E.g. Generative-Adversarial-Networks, the image generation GAN’s are often measured by something called the Inception score, which examines their behaviour using a standard classification-type image network along with measures of entropy to come up with a score. Now what if you are applying GAN’s to blueprints on buildings, 3d models, or music — there may not be an off-the-shelf classification model that you can use to form an inception-like score</li><li>Your product may have a unique form of output / behavior that is novel and not really well established within the research community. E.g. neural networks that turn night time images into daytime images. How do you measure that?</li><li>You may not be an expert in the specific domain that you are working in. There may be some metrics that do exist, but without deep domain expertise on that narrow field of research, you would never know about them</li><li>The commonly used metric for your type of machine learning may have specific weaknesses relevant to your algorithm, meaning that it will give low weight to important failure cases relevant to you</li></ul><p>I’ll tell you where this came up for me recently, where I felt the need to really design a metric. I was working on a system for analyzing resumes. The basic premise of the system was as follows:</p><ol><li>User uploads 1,000 resumes</li><li>User goes through 20–30 resumes, giving a “like, maybe, dislike” to each candidate</li><li>The algorithm sorts and ranks the other 970 resumes based on the preferences you taught it in those likes/dislikes</li></ol><p>Building and measuring this system presented several challenges. First was constructing appropriate test-cases that we could use to accurately measure the results of the system. The second was just picking what kind and form of metric made sense. The third was improving the result.</p><p>The way we constructed the test cases was to create a set of “target” resumes that the algorithm was supposed to find. Then we would add in 25–50 “negative” resumes for each target resume. The negatives were taken randomly from the dataset at large. We would then go through the test-case like it was any screening, reviewing 20–30 resumes with only a couple targets liked, and seeing how the system ranked the remaining resumes.</p><p>Not being familiar with information retrieval research, I really didn’t know what metric I should use here. A metric probably existed but I didn’t want to delve deep and figure that out. Plus, this system was based on likes/dislikes rather then keyword matches, more like a recommendation system. In my mind, there were a few initial ideas:</p><ul><li>The average “rank-order” of the target resumes within the larger sorting of resumes. Lower rank-order means closer to the top of the pile, which is what we wanted. It had a big problem — it varies depending on the ratio of targets to negatives, and by the total number of targets in the set.</li><li>One could do the above but normalize the rank order between 0 and 1. This metric is an improvement but its still hampered if the ratio of targets to negatives changes, which it certainly could in real environments. It also doesn’t have a clear best — the average rank for multiple targets could never be 0, since they are also ranked against each other</li><li>We could instead measure the minimum number of resumes that you have to go through in order to get all of the targets ranked at the top. This would frame the metric directly from the users perspective — how much value am I getting from this machine learning algorithm versus just going through the entire stack of resumes manually.</li><li>We could also represent the score using Accuracy, Precision and Recall. E.g. we would measure the number of target resumes which were in the top-10, top-20, or top-30 (or even top-10%) . This metric had the advantage of being somewhat invariant to several changes in the dataset size and ratios, but I didn’t like the introduction of the additional question of what K to choose for the Top-K metric.</li><li>Another idea I had is that eventually we might measure the algorithm based on its accuracy of predicting whether a user would like/dislike a resume based on the prior resumes. But we didn’t have enough data to train this type of machine learning algorithm — let alone measure it. Plus it wasn’t really representative of the problem we are trying to solve and the way the results were presented in the User Interface. The results in the UI were Ranked, not Grouped.</li></ul><p>So eventually I had to come up with my own idea of what a metric would look like. It had to capture the ability of the algorithm to put target resumes at the top of the heap based on only a few learnings, and it had to be invariant to the size of the test-case and to the ratio of targets to negatives, and it needed to be resistant to noise if possible.</p><p>So I formulated the mathematical properties I wanted from the metric as follows:</p><ul><li>The value is 1.0 if all target resumes are ranked above all negatives</li><li>The value is 0.0 if all negative resumes are ranked above all targets</li><li>The value is somewhere in-between for everything else</li><li>The value is invariant as much as possible to the ratio of targets to negatives and to the total size of the test-case.</li></ul><p>So the formula that I came up with looks as follows (excuse my pythonic math):</p><ul><li>NormalizedRank [Nr] = Rank / TotalResumes</li><li>BestPossibleMeanRank [Bpmr] = average(Nr(Rank) for Rank in range(NumberOfTargets))</li><li>WorstPossibleMeanRank [Wpmr] = average(Nr(TotalResumes — Rank) for Rank in range(NumberOfTargets))</li><li>MeanRank [Mr] = average(Nr(TargetRank) for TargetRank in Targets)</li><li>Score = 1.0 — ( (Mr — Bpmr) / (Wpmr — Bpmr) )</li></ul><p>The equation basically uses the mean ranking of the target resumes within the overall ranking of resumes. These rankings are first normalized to be between 0 and 1, and then the mean ranking of all the targets is normalized to go between the best possible mean ranking and the worst possible mean ranking. The best possible mean ranking isn’t actually 0 — since the target resumes are also sorted relative to each other. The best possible mean ranking is the ranking that would happen if all the target resumes are sorted at the top of the list. So if there are, say, 3 target resumes out of 10, then the best possible mean ranking is the average of 0.0, 0.1, and 0.2, for a overall best possible mean ranking of 0.1. The same is done with the worst-possible ranking, and the final score for a test-case is its normalized position between the best and worst possible mean rankings.</p><p>With this custom score equation, I was able to create a metric which had a relatively consistent behavior with other types of metrics that I like, e.g. 1.0 is the best possible result, 0.0 is the worst possible result. It also has good behavior with respect to changes both in ratios between targets v.s. negatives, and in the overall size of the dataset. This allows us to compare the scores between different test-cases reasonably well, which then further allows us to compute a mean-score for all the test-cases.</p><p>Engineering your own metric equation like this is an advanced technique, but it should be something you include in your arsenal of tools while developing measurements on a model.</p><h3>There may not be a clear way to define accuracy for your model</h3><p>This challenge mostly comes up when your doing unsupervised learning, e.g. clustering and generative models, or some forms of reinforcement learning.</p><p>If you’re working on a clustering problem, you will ultimately come across the question of What is a good cluster? This question is non-obvious. There are definitely metrics that you can use to to define what are better or worse clusterings in a statistical way, such as:</p><ul><li>Silhouette Coefficient — measuring the average center if each cluster against the average center of other clusters</li><li>Davies-Bouldwin — Measuring the average distance from each datapoint to the center of the clusters versus the distance of the clusters from each other</li></ul><p>But using these metrics may fail to capture what you really want from the algorithm. If, for example, the algorithm is being deployed in a marketing environment to segment customers, then what you really want is to group people together by how well a specific marketing strategy is going to work on them, because ultimately this is the purpose that these clusters are used for. However, you may be clustering on data that is extremely noisy and may have only marginal predictive value for marketing strategy. Your there to exploit whatever value there is and move on. A measure like the above can totally mislead you in developing this algorithm to serve that purpose — creating effective clustering of the data but not ones which line up with similarity in effective marketing strategies to any extent.</p><p>Another interesting case of this is generative models. What we care about is whether the model is capable of generating a healthy variety of realistic outputs. But what defines realistic? Its hard to measure the algorithm against the dataset it was trained on — if the algorithm only produced outputs highly similar to its training dataset, then it would be a very poor generative model. The techniques that are currently used for this, like the Inception-score (which uses a neural network along with statistical measures of entropy to score a model), are non-intuitive and have flaws. In some cases, like in natural-language synthesis, the most reliable technique for evaluating improvements remains a subjective scoring done by humans, e.g. scoring quality from 1 to 10. How else would you evaluate how good a general purpose chatbot can chat to you?</p><h3>The outcome you actually care about can’t be measured easily</h3><p>In this situation, we might have some way of measuring the accuracy of our model, and we have reasonable expectation our metric should correlate with the real world performance of the model, in the sense that a higher metric likely means better real world performance. But the performance of the model in the real world might not be something you can actually measure easily and report back on. It might be very hard to determine how well your metric correlates with real world performance, and how much accuracy you have lost.</p><p>I can think of a bunch of scenarios where this can occur:</p><ul><li>You’re deploying models on the edge, e.g. in IoT devices that can’t possibly upload all the data they are chewing through</li><li>You’re deploying in privacy restricted environments like security cameras where you can’t really repatriate data back to head office to measure accuracy</li><li>What you care about the most is the models performance in edge-case situations, such as self-driving vehicles operating in dangerous driving conditions, or a stock trading models performance when the economy sinks. The edge case you care about just doesn’t happen very often</li><li>You might be building a model for transfer learning, e.g. models that are intended to operate as pretrained networks that are then glued into an end-users system and applied to their problem. You care about how well the model adapts to new and unforeseen problems, by definition problems you can’t measure</li><li>You’re making an algorithm for general purpose usage that is both trained and run on the clients data in the client’s environment, which you don’t have access to. Again you care about how well the algorithm works in unforeseen situations, both in terms of training and execution</li><li>You’re algorithm must combine elements of training done at head office with the customers private data to produce a result</li></ul><p>Some of the most difficult situations like this is where the choices that your algorithm can take years to resolve into good or bad choices. For example, if an algorithm predicts that you should buy a particular house or a particular stock because it appears to be undervalued in the long term. By the very definition of the problem, it may take years to determine if an algorithms guess turns into reality.</p><h3>Measuring accuracy effectively is too computationally expensive</h3><p>In some cases, there are often perfectly reasonable ways to measure the accuracy of an algorithm. But it might be very computationally expensive to do so effectively, making partial measurements of accuracy necessary.</p><p>I can think of a bunch of situations where this may come up:</p><ul><li>Measuring the validation accuracy of a neural network while it is being trained. One pretty much always has to compromise between how much CPU power is allocated to validation measurement versus how much for training in order to get a precise, noise free measurement of how the accuracy is changing over time</li><li>Your data set is just so large that you can’t possibly train or even measure accuracy on all of it, and instead it must be done on a sample of data (e.g. common in big data)</li><li>The production environment for your algorithm is different then how it is trained. E.g. siamese / triplet networks, used for one-shot learning and image search. The neural network is trained in batches with predictable scaling characteristics. But in production, the neural network produces vectors which are matched to other vectors in a very large database using K-Nearest-Neighbors. It is the end result on the full database that you care about and want to measure, but doing those lookups on-masse might be prohibitively expensive</li><li>Your algorithm is both highly noisy and very computationally expensive. 5-fold cross-validation would be your go to technique to reduce noise in measurements, if it didn’t increase computation time by 5x on an already expensive model.</li></ul><p>In these situations, we must be very careful in how we sample data out of the larger production dataset in order to measure our algorithm. We have to pick an appropriate sample size that is computationally tractable but also representative of the whole, and we must do random selection in a way that considers various possible class imbalances within the larger dataset.</p><h3>Your algorithm might be working in tandem with humans</h3><p>Probably the most benign of the hard-problems in measuring accuracy is when an algorithm is meant to work in combination with humans. In general, what we actually care about is the effectiveness of the human-machine combined system — that’s ultimately what matters. Measuring the machine side might be easy — measuring the human side is often much more costly.</p><p>Think of the following situations:</p><ul><li>AI powered security cameras which are meant to trigger alarms to security staff. These systems are typically tilted towards giving false-alarms in order to ensure security staff catch every possible intrusion. But what if you give too many false alarms? The guards might get used to them and begin to ignore them. There is an optimal balance between too many false alarms and too few which maximizes the effectiveness of the overall system in catching intruders.</li><li>Many people are working on AI powered doctors which help diagnose people. Instead of just replacing the doctor, many teams take the approach that the AI should work in tandem with a real doctor in order to diagnose the patient. Now what you care about is the effectiveness of the combined doctor-AI team, versus just a doctor or just an AI alone. Does the AI’s recommendations just confuse the doctor, or genuinely help them diagnose the situation.</li><li>Many AI teams often use their outputs from the AI system to guide the labelling of data for humans who are building the dataset training that very AI system. For example, when building a document parsing system, we had an AI that would parse the document, and then a human would review what the AI did and correct any-mistakes. While this made things faster for the humans, it also lead to complacency as the system got better and better at recognizing documents. Humans would fail to catch mistakes, approving error filled documents into the dataset which would then be trained on, causing the AI to make more errors in the future.</li></ul><p>The presence of humans in a solution often leads to better performance then just doing machine learning alone, if it is done correctly. Often-times it’s just plain necessary when new AI products are being developed to keep humans in the loop to grow the dataset. But the presence of humans in the situation do complicate the measurement of accuracy.</p><p>Humans are hard to measure. For example, how do we measure how much noise and mistakes there are in a dataset? When the dataset is being constructed by people, the only option is to compare one persons opinion to another. For example, a manager may examine a subset of the labelled data of their subordinates and compare it to their own opinion on the correct classification.</p><p>Taken to the extreme, the technique becomes what I call double verification, where the same piece of data is sent to two different humans to be analyzed and classified. If the two humans disagree, it can be sent to a third, and a fourth, and a fifth, so on and so forth until a consensus is reached on the correct answer. This both produces high quality labelled data, and can give you great statistical clarity on the amount of mistakes in your dataset. But this process is expensive — greatly increasing the cost of the already pricey data labelling process.</p><h3>Your dataset or problem space might be changing and evolving over time</h3><p>There are many things in life that are static, or at least evolve so slowly that it takes generations to change. There are other things that are rapidly changing, both in characteristic and form, from one year to the next and sometimes even from one month to the next. The same is true of datasets and machine learning problems.</p><p>Here are some situations where we might find the problem we are working on to be evolving underneath our feet:</p><ul><li>You are a new startup, and your dataset is being built while you are growing. You might have started on English language data, but due to growth the dataset starts to include many other languages</li><li>You are a chat-bot and your continuously adding new features and functionality while simultaneously doing research on your core NLP. The dataset is expanding in both kind and form to necessitate more functionality, and so an algorithm that works on a small dataset with 10 labels may no longer get good results on a large dataset with 100 labels.</li><li>You are doing e-commerce in the early 2000’s, where consumer behaviour on the internet and our sophistication for tracking it was rapidly evolving and changing over time, with trends relevant in 2005 completely irrelevant by 2010.</li><li>You are doing an algorithm for high-speed trading on the stock market, where you are competing against an evolving set of other companies algorithms also doing the same thing, each algorithms best behaviour determined by the behaviour of the other algorithms</li></ul><p>In these situations, it can sometimes become necessary to continuously apply R&amp;D to your core algorithm just to stay in the same place, let alone to improve it. As your ambitions for using machine learning grow and your dataset grows with it, so too do the challenges of maintaining such an ambitious system. The prime use for measuring accuracy, which is to understand how well your system is going to work in the real world, is challenged by the constantly changing definition of “real world”. Your measurements of accuracy might only be good for a few months before something changes and accuracy drops.</p><h3>There are multiple dimensions along which you need your algorithm to generalize</h3><p>This concept came to me recently when thinking about doing machine learning on data derived from complex databases with multiple tables being relevant to the prediction, and the dataset was fairly small, so generalization was important. After thinking about the problem, I came to realize it has actually presented itself in a bunch of different projects in my past.</p><p>Consider the following example. You are building an algorithm to parse data out of documents. The documents you are parsing come in a number of different overarching formats, and within those overarching formats there can be different data within the documents. In your training dataset, you might have amassed documents in 50 different formats, and you have around 500 examples for each format of document. You reasonably believe that there is, at most, 100–200 formats out there “in the wild”, and most of them will be at least similar to existing formats.</p><p>Now if you just do a conventional 80/20 split on this data, you might get very good results, let’s say you get a perfect training accuracy and above 99% validation accuracy. This is very possible in this situation (has happened to me), especially if the data presented in each format is very consistent and you have good data augmentation. You might go and put your model into production based on that validation accuracy. But what happens what you receive a document in the 51’st format?</p><p>There are in fact two dimensions along which your algorithm needed to generalize, and the second dimension is not captured by your basic 80/20 split of all samples. Your algorithm first needs to be able to learn from new examples of documents in the same format. That’s dimension 1. Ideally though, your algorithm can also generalize to documents in new formats as well. That’s dimension 2. If you have labels for the formats of the documents, you can also do an 80/20 split along the different formats (40/10 in this example). Both of these splits are important and tell you different things about the ability of your model to generalize to new examples.</p><p>It wouldn’t be a surprise to see that if you do an 80/20 split along your formats, your validation accuracy might look very different from 99%. If documents within a format are highly similar to each other, but formats are very different from each other, then it wouldn’t be a surprise to see that a machine learning algorithm is unable to generalize to new formats when exposed to documents in only 40 existing formats, no matter how large your dataset or how many documents you have.</p><p>The more I thought about it, the more I realized just how often this particular problem occurs. For example, if you are building a recommendation engine for an e-commerce platform, your algorithm needs to generalize across a bunch of dimensions:</p><ul><li>Across different Users of the system, e.g. generalize to new users with behaviors not seen exactly in training data</li><li>Across different items within the catalogue, e.g. it needs to generalize to new items and descriptions when they are added into the system</li><li>Across entirely new categories of items, with words and phrases that are not used in any existing catalogue items</li><li>Along the time dimension — e.g it needs to generalize as behaviors of users and trends of products change and evolve. It also needs to be forward predictive, e.g. it can predict a users future behavior given their prior behavior. What you recommended last month may not be the best recommendation this month.</li></ul><p>If you are training an algorithm from data derived from a complex database, involving joining a bunch of different tables representing tangibly different types of data, then its very reasonable that you do separate 80/20 splits for each of those tables, each yielding a different metric, or some combination thereof. E.g. imagine a real estate valuation system, which must combine geographic data, like market conditions in a particular area, with data on the specific property and data from recent sales transactions in the area that are relevant. You need the algorithm to generalize across all three different data sources, since all three are mixed and matched for doing predictions in a production environment, and all three are continuously growing and changing as the business grows. The model needs to be able to adapt.</p><p>This is an unusual and nuanced scenario to deal with and it complicates the measurement of accuracy. No matter which way you do your 80/20 split, no single way fully captures the accuracy and behavior of the algorithm. Your algorithm may be generalizing well across the dimension that you measure, such as different buildings in your data set when predicting real estate valuations, but is not at generalizing across a different dimension, such as different geographies with their differing market conditions. You will invariably need multiple metrics in order to fully appreciate the behavior of your algorithm in these instances.</p><h3>Conclusion</h3><p>In this article, we have discussed many of the more challenging and nuanced problems that get in the way of measuring accuracy effectively. Many of these challenges are inherently derived from the power of machine learning — its flexibility to be applied with imperfect data and in novel environments and situations and still get a reasonable result. Machine learning is powerful.</p><p>If you have read all the way up to this point, and especially if you have been reading our previous articles in this series, then you might well conclude, as I have, that measuring accuracy is very hard. With so many ways that you can do it incorrectly, and so many issues that can prevent you from doing it well, it’s pretty easy to just accept error as an unchangeable fact of life. Yet measuring accuracy is foundational to our work as the builders of models. So instead of just rolling over and accepting defeat, what can we do about it?</p><p>In Part 4 of this series of articles, the last in the series, I will try to go over a framework for measuring accuracy better. This framework will try to give you a better way of thinking about choosing and designing metrics for your models. Our proposal will be simple. Instead of starting from your model and what it does, and going forward to a metric that can measure it and then the analysis of that metric, we will instead show you how to go in the reverse direction. Start from the question of what exactly you want your metric to tell you about your model and how you want to analyze it, and then move backwards to what kind of metrics might support telling you that information. Metrics are meant to serve a purpose, thus different metrics must be designed for different purposes — there is no one size fits all solution.</p><p><em>Originally published at </em><a href="https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-important-part-3"><em>www.electricbrain.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74c7249e7308" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/why-measuring-accuracy-is-hard-and-important-part-3-the-hard-problems-in-measuring-accuracy-74c7249e7308">Why Measuring Accuracy is Hard (and important!) Part 3. The hard problems in measuring accuracy.</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Measuring Accuracy Is Hard (and important!) Part 2 The Common Problems in Measuring Accuracy]]></title>
            <link>https://medium.com/data-science/why-measuring-accuracy-is-hard-and-important-part-2-the-common-problems-in-measuring-accuracy-cc26a977823e?source=rss-4cc13146bf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc26a977823e</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Bradley Arsenault]]></dc:creator>
            <pubDate>Wed, 20 Mar 2019 19:30:30 GMT</pubDate>
            <atom:updated>2019-03-26T13:48:40.091Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Measuring Accuracy Is Hard (and important!) Part 2</h3><h4>The Common Problems in Measuring Accuracy</h4><h3>Introduction</h3><p>This article is part 2 of a 4 part article series that I am creating on the challenges of measuring accuracy. If you haven’t read the first article, check it out here: <a href="https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-very-important-part-1">https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-very-important-part-1</a></p><p>In this article, we are going to discuss the major challenges that occur in measuring accuracy. We’ll try illustrate with examples and graphs where possible.</p><h3>Your training data is often different from the real world data</h3><p>The most common thing that makes measuring accuracy difficult is that sometimes the training set that we are using is different then the real world data the algorithm is expected to work on. There might be many different reasons this is the case:</p><ul><li>Your training on synthetic or augmented data</li><li>Your dataset is a small, biased sample not representative of the real world data the algorithm needs to operate on</li><li>Your dataset has been gathered using a different process then the real world data comes in, e.g. you gathered potential questions for a dataset of questions by searching google, but the actual questions are entered through your website and might be different</li><li>You might not have any access to real world data, e.g. this is a new product prior to launch, or the product is deployed in such a way that you don’t get any data sent back to hq</li><li>Your algorithm might have to run on the customers dataset and not your own controlled one</li><li>The real world data might be a continuously evolving moving target, e.g. the stock market</li></ul><p>This problem has come up for me recently on a few different projects, the most salient of which is a chatbot company. This is a bit of a constructed example, but is derived from my real experience when working with the company.</p><p>Imagine we’re developing a chat-bot product for call-centers. Before we can get our first sale, we need to demonstrate that the product works. To get the product to work, we need data. The data we need is just different ways of asking a question, e.g. different ways to say that you want to check on the status of an order, or different ways to order a pizza at a restaurant. We resort to gathering the data the only way we know — on mechanical turk. However, by just asking people directly to come up with different ways of ordering a pizza, we do get some variety, but we start getting a lot of repeats like:</p><ul><li>Can i get a pizza</li><li>Can I get a pizza sir</li><li>Can i get a pizza Mr. Sir</li><li>Can i get a pizza Mr. Lancelot</li><li>Can i get a pizza Mrs. Lancelot</li><li>Can i get a pizza Madame Lancelot</li><li>Can I get a pizza please</li><li>Can I get a pizza plz</li><li>Can I get a pizza pleeze</li></ul><p>They were indeed coming up with lots of different examples, hundreds of them. And indeed, these are all valid sentences that should trigger our chat-bot to order a pizza. But there was not a whole lot of variety here — not the type of variety we were looking for. This was not representative of the real world data.</p><p>Eventually we resort to putting rules in place like a minimum sentence length, a requirement that the sentence is unique within our entire dataset, a minimum difference from other samples they typed, etc.. and these things do help get us more variety. However, we fear that the dataset was still not really representative of real world data:</p><ul><li>Hello sir or madame, would you kindly grant me the permission to have a pizza at your fine venue</li><li>Hello fine sir, would you please allow me to eat a delicious, greasy pizza at this amazing restaurant here</li><li>Hey there, please allow me to give me a pizza from your beautiful restaurant</li></ul><p>We eventually cobble together a dataset that we like and we achieve a +90% accuracy against it. Seems like a great result.</p><p>We then bring this to clients and show them. But the bot only works 70% of the time in demonstrations at best, often falling down and misunderstanding seemingly straightforward orders. The dataset the algorithm was running on, the real world data, was just plain different from the dataset the algorithm was trained on. The dataset we had technically ticked all the boxes:</p><ol><li>It was large — we had thousands of examples for each intent</li><li>It contained variety — the examples were different in ways that were relevant to generalize</li><li>It was valid, e.g. the sentences were indeed sentences that we wanted to trigger the bot to order a pizza</li><li>It was had no incorrect or invalid entries</li></ol><p>The key problem though was in the nuance of the second point. Although the dataset contained variety, it didn’t contain the same kind of variety as the real world data did. Although we had many different ways of ordering a pizza, we didn’t have the specific ways that real people ordered a pizza to our bot.</p><p>You would be very surprised how often it comes up that we are expected to make models on one type of data, and execute them on a different type of data. It works because machine learning is awesome and incredibly powerful with today’s algorithms. They are able to find general patterns and then transfer those patterns to new environments. But it presents a new problem, which is measuring the accuracy of the system in those new environments.</p><h3>You care about certain failure cases more than others</h3><p>It is often the case that your machine learning algorithm can be wrong in different ways. As algorithms continue to get more complex and powerful and used for more things, the specific details of their behaviour become more important.</p><p>In some cases, there is a whole sequence of algorithms that work in concert to create a complete system — preprocessing, augmentation, multiple machine learning algorithms, post processing, filtering, thresholding, validating — there are many components to an AI system that make it work. The shape of failures and correct answers that is acceptable at each step is different, making measuring and improving the whole system a complex task.</p><p>In other cases, even the final outputs of the algorithm must take on specific shapes and forms that are hard to reduce down to a single number. In self driving cars, we care about the vehicles performance in edge case situations — bad weather, other drivers driving badly, etc.. It’s pretty clear from many YouTube videos that self driving cars can work just fine in typical situations.</p><p>I can identify various reasons you care about certain failure cases more than others:</p><ul><li>Certain types of false detections can be ruled out by a later part of your processing pipeline, but failed detections can’t be brought back. Therefore you care more capturing all true positives then reducing false positives.</li><li>Maybe you care more about the algorithms performance in edge-case situations, e.g. a self-driving car in bad weather conditions</li><li>Maybe there is potential for human intervention when the algorithm is not confident in its prediction</li><li>Maybe if the algorithm is used for a warning system, and it’s better to warn and have a few false positives then to not warn when there is real danger</li><li>Maybe your algorithm has extremely poor performance on certain important subsets of your data</li><li>Maybe certain types of failures would be very annoying to your users, while other types of failures can easily slip under the rug</li></ul><p>These types of problems are typically solved by coming up with alternative metrics. Sometimes we use confusion matrices, like this one, to help us understand what is happening:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*dLPEW29Jf5ifixPj.png" /></figure><p>Other times we might use alternative metrics, like Precision and Recall, <a href="https://en.wikipedia.org/wiki/Precision_and_recall">https://en.wikipedia.org/wiki/Precision_and_recall</a>, which omit false negatives and false positives respectively, versus raw accuracy which considers every type of mistake.</p><p>I think another interesting manifestation of this phenomenon is the problem of discriminatory bias in machine learning algorithms. This includes, for example, the problem of facial recognition algorithms working more effectively on white and asian people then people of other races. The problem here is that there can be unlabeled subsets of your dataset that your algorithm performs poorly on. When one is making a facial recognition algorithm, you might just receive a giant dataset of images without any data on who is which race and sex. This could happen if you are, say, a Facebook researcher who receives an anonymized dataset. If this dataset is pulled from Facebook’s USA dataset, it shouldn’t be a surprise to find that it mostly contains images of white caucasians. You train the algorithm, and claim its 95% accurate. But who are the 5% failures of the algorithm? With your anonymized dataset, you can’t really know — the only solution is hand inspection. Your simplistic measurement of accuracy has failed to capture important socio-political properties of the algorithm.</p><h3>The model, dataset or measurement is noisy</h3><p>Another big problem that gets in the way of measuring accuracy is that there is noise, both noise that is inherent to the model, noise in the dataset, and noise in our measurement of accuracy.</p><h3>Splitting the Data</h3><p>The basic difficulty can show up in any model. Consider the following. You have a dataset, and you wish to measure the accuracy of the algorithm you have trained to see how well it generalizes the properties of the dataset. You do a what a wise data scientist does and split your data 3 ways — training, testing and validation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*nUywufOjwt7pR6r5.png" /></figure><p>But now you’re faced with this question — which items to you put into which group? What if I use this split instead:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*iCsPGPxFAMtodM4w.png" /></figure><p>The naive way might be just to shuffle your dataset randomly and split it 3 ways. But when you train your model, you find that every time you do this, you get different results, even with no changes to your model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*3PwsH2Kwx92-6AIH.png" /></figure><p>Frustrated, you might believe its because the dataset is very unbalanced from one run to the next. Maybe you may decide to use the labels in your dataset to construct a training, testing, validation sets that have even numbers of each of your target labels. Effectively dividing your dataset into a bunch of sub-datasets by each label, splitting those datasets 3 ways each randomly, and then recombining them back together to get. Now your dataset is class balanced but still randomized. Now you have reduced the noise, but you still get problems:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*NeUIEEQa2QHHSX9J.png" /></figure><p>You’ve reduced the spread, but there is still noise in your measurement. You resolve that there are actually harder and easier samples in your dataset for each label, which are still getting shifted around. But what are you to do?</p><p>You might resolve to using a cross-folding method, where, say, you take the average of all 5 possible 80/20 splits within your dataset. This ensures every sample shows up in in the testing set at least once. But this method can be costly for many deep learning models, where GPU power is scarce and you are starving to run as many experiments as possible. Maybe you just lock in a fixed testing and training set and only measure against that. But this can be difficult in dynamic real-world environments where our datasets are continuously evolving and getting larger, effectively requiring us to maintain a database which tags entries as either training, testing or validation.</p><p>The extra infrastructure required to maintain a good, stable, consistent, noise-free measure of the accuracy of the model can grow quickly depending on how much you want to reduce the noise.</p><h3>Noise in the dataset</h3><p>Another big source of problems that I’ve seen is noisy datasets. Noisy and error-filled datasets are the bane of my existence. Having dealt with third-party data outsourcing firms, I’ve seen first hand how difficult it is to get high quality, clean labelled data.</p><p>The problem is inherent in the task — labelling data sucks. No matter how many fancy tools we develop to assist in labelling, it still remains a mundane task of data entry. Its error prone by nature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*FWt0KxGIwdD1VG56.png" /></figure><p>People take many steps to try and solve this problem:</p><ul><li>Maybe we gamify the process, trying to encourage users to “have fun” while providing labelled data.</li><li>We might be able to get our users to provide labelled data for us as part of their work, when an AI makes “suggestions” that they can then correct and modify. The user is already encouraged to be careful because of the value of the work to them</li><li>We might use techniques like double verification (sending the same item to multiple people to generate a consensus), or random sampling and verification by a manager</li><li>Some people even use AI analysis techniques which try to identify outliers in the dataset</li></ul><p>No matter how we do it though, the datasets we are working with are working with are often noisy.</p><p>On the machine learning side, as long as the dataset isn’t too noisy, we can often still teach the algorithm to learn the pattern. Deep learning is especially good at generalizing despite a lot noise. But on the measurement and validation side, noise in the dataset gives us a few inherent problems</p><ul><li>We can’t know if our accuracy metric improve because we are overfitting on some poorly labelled samples, or if the model successfully generalized. This means a larger increase is accuracy is needed to confirm an improvement</li><li>There is no way to achieve perfect accuracy, even if our model has perfectly generalized the data. The best possible accuracy is some unknowable, immeasurable number. If your dataset is really noisy (+10%), this can make you really spin your tires when your sitting at 89.7%, trying to figure out more ways to improve your model. Your model could actually be 100% accurate on real world data, and you would have no way to know it.</li></ul><h3>Consistent Errors in the dataset</h3><p>Probably even worse then having noise or random mistakes in your dataset, are the consistent errors that are made by your annotation team. If there are errors made in consistent ways, then the machine learning algorithm may attempt to learn those patterns of errors as part of its overall learning.</p><p>I have been burned by this on several real world projects. At a recent project we executed with a large Canadian bank, we had gotten the provided data annotated by a third party. We did not perform sufficient oversight and testing. The samples we received were good, but we failed to check the full dataset. We went ahead and trained our model, and eventually hit very high accuracies. But when presenting the algorithm to the client, they quickly pointed out that the final results appeared to be filled with errors. When diving deep, we realized that not only had much of the dataset been annotated incorrectly, it was consistently annotated incorrectly in the same ways.</p><p>Therefore, it was still possible for us to achieve a high degree of accuracy by every measurement we had available, and for the model to still be wrong. The model had indeed learned the patterns, it learned precisely the patterns of errors which the people annotating the dataset had made. It was clear that we could not just check the ‘provided samples’ that are emailed to us during the process, as these might have been prepared and scrutinized by managers who correctly understand the requirements. We needed to analyze and validate the final samples that were put together by all of the various low-paid data entry people by this company, who may or may not have received sufficient instruction to annotate the data correctly.</p><p>In my opinion, this is one of the hardest and most frustrating aspects of doing real world AI projects. You can have great accuracy using well validated techniques of measuring accuracy, and still ultimately be wrong.</p><h3>Multiple Metrics in your pipeline</h3><p>Another problem that sometimes comes up when measuring accuracy is that there becomes <em>too much</em> to measure. You might have a dozen different metrics representing different stages of your system.</p><p>This issue came up for me when building a text extraction engine recently. The model took as input a word and its surrounding context, and produced a classification for that word.</p><p>However, our pipeline consisted of two stages. The first machine learning algorithm just decided between null or extract, and the second stage made the final classification. In practice we landed on a four layered system, but the 2 layered system will suffice for explanation. The setup looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*GAVtbJqILgMBvgku.png" /></figure><p>So now we have two different machine learning algorithms with two independent measurements of accuracy. We also have several different failure cases:</p><ul><li>False Positives at #1 (extract when should be null)</li><li>False Negatives at #1 (null when it should be extract)</li><li>False Positives at #2 (a category when should be null)</li><li>False Negatives at #2 (a null when it should a category)</li></ul><p>Additionally, we have the additional complexity that our second stage algorithm is able to partially compensate for errors in the first stage. E.g. a False Positive at the first stage might still be correct predicted as a null in the second stage, and still result in the correct final output. Therefore, the accuracy measurements of these two stages can interact in complex, non-linear ways. Worse accuracy on False Positives in layer #1 does not necessarily result in lower accuracy in the final output.</p><p>In fact, worse accuracy on layer #1 could mean precisely the opposite. We had to tilt the layer #1 towards more false positives in order to get this approach to work and produce a better final accuracy. By default, it would create far more False Negatives, then False Positives, reducing the accuracy versus just a single layered system. But tilting the layer #1 towards more false positives (reducing its accuracy), meant it was only filtering out entries it was highly confident were actually nulls (True Negatives), and everything else could be passed to the layer #2 for a final classification. This resulted an improvement in the final accuracy of the model. Thus, hurting layer #1 in that specific way made the overall model more accurate. The filtering layer (layer #1) helped the model deal with the unbalanced classes and high degree of nulls in the output, but only when measured and used in the right way.</p><p>By itself, there is nothing wrong with having multiple stages of processing, and even multiple measurements of accuracy at these various stages of processing. However, too much of a good thing can create new problems:</p><ul><li>It’s creates confusion when some of your metrics improve, but other ones get worse. What has actually happened?</li><li>It’s harder to communicate to stakeholders what their expectations of the model should be</li><li>Its harder to understand what the final behavior of your model is</li></ul><p>In our experience, when you are in this situation, there is only one solution: <em>focus all R&amp;D on improving your end-to-end or final-result metric, that is, the accuracy exiting the final stage of processing from the system. </em>We don’t mean that you shouldn’t measure the intermediate accuracies — they can be incredibly useful to understand how the various processing stages are interacting and to come up with ideas on what might work. But when it comes to gauging whether an improvement is actually an improvement, only the final-result accuracy matters.</p><h3>You have multiple metrics with multiple levels of granularity</h3><p>This problem is similar to the problem of multiple metrics in your pipeline, but it manifests itself because of a different reason. Let’s consider the problem of extracting data from receipts, where I saw this issue most saliently. The basic problem is to take an image of a receipt and convert it into fully structured data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*Te4lhkKgiZf5xgB8.png" /></figure><p>The process involved was:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*LiAgZbuoZ4lcGz_J.png" /></figure><p>If you are paying attention, you’ll notice that this setup also has multiple metrics across the pipeline. The OCR engine, letter by letter classification, and post-processing could all be making mistakes and could yield differing measurements of accuracy at each stage. They also had different measurements depending on whether their prior input was assumed to be accurate, e.g. we can measure the letter by letter accuracy assuming OCR accuracy was perfect (by inputting ground-truth OCR data), and we can measure the letter-by-letter accuracy on the raw OCR output, including mistakes.</p><p>However, I want to concentrate on another wrench that was thrown in the measurement of accuracy here in the middle section of the system, the letter by letter classification.</p><p>The most obvious way of measuring the accuracy would seem to be to literally measure the number of letter classifications that are correct:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*0fSglajR7NarGJBN.png" /></figure><p>But the problem with this approach is that most of the characters are to be classified as “null”, or don’t extract. Under this metric, it was relatively easy for us to hit accuracies that were 97% and 98% accurate. But as we quickly learned, those supposed 2% or 3% of errors mattered a lot.</p><p>Many of the receipts we were analyzing weren’t short starbucks receipts, they were behemoths like these ones:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*Z1Rep8LLGQkwv11i.png" /></figure><p>In these receipts, almost 95% of the characters were to be categorized as null. However, the remaining 5% of characters were the ones we cared about. According to our traditional metric, these receipts would get a 95% accuracy even if our model did nothing but predict null. The measurement is naturally unstable from one receipt to the next, and didn’t give us adequate insight into what was actually happening.</p><p>So the problem spawns a variety of alternative measurements of accuracy, that are meant to give us more insight into the behavior of the system and the types of errors it was making:</p><ul><li>Word level accuracy — % of words with no mistakes</li><li>Line level accuracy — % of lines with no mistakes</li><li>Section level accuracy — % of sections (receipts were grouped into header, items, taxes, total, footer) with no mistakes</li><li>Receipt level accuracy — % of whole receipts with no mistakes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/281/0*74wmdeSeKa25buzu.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*EHrvLfctXk3guvLE.png" /></figure><p>It was pretty profound to find out that our model with a character level accuracy of 98% had a receipt-level accuracy of 67%. Receipts had on at a minimum 200 characters, so we would expect on average 4 errors per receipt at the character level. You might suppose then, that Receipt Level Accuracy should be 0%, since on average receipts should have had at least 4 character level errors, making them a mistake by the receipt level metric. But most of our receipts went off without a hitch, perfectly classifying every character. Other receipts were complete clusterfucks, with as much as 20% to 30% misclassified.</p><p>When its possible, having metrics with different levels of granularity is helpful to understand how your model is failing. But they can also add confusion and noise to your measurements, making you spin circles when some metrics improve but others become worse. More on what to do in this situation will come in article #4.</p><h3>You only have ground-truth data for an intermediate step in the system</h3><p>This issue shows up surprisingly often, in fact it showed up for us in the receipt example above as well. You have a machine learning system where you have annotated the most important and difficult part of the learning that needs to take place. But your algorithm has some sort of post-processing that needs to take place before it gets to the final result. And this post-processing is based on some simple heuristics and assumptions that are specific to the problem you are experiencing.</p><p>A salient and simple example of just such a heuristic was when I was doing data extraction on spreadsheets. Each cell in the spreadsheets had to be classified into one of a few categories. The cells would then be grouped together into a set of outputs. The setup was roughly as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*HQ0dS4_NObqbvtF0.png" /></figure><p>The system needed to be able to handle a variety of different formats of spreadsheets that have been hand prepared by different people, with arbitrary decisions for formatting and structure.</p><p>One reasonable way to construct this system is to get all of the cells classified, something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/0*M-ucRnM5Bq06XhLK.png" /></figure><p>Then you create some predictive features, and train an algorithm to predict the classification for each cell. But to get the final result, you must make one more important processing step — you must group together the cells. In our example here, the method would seem obvious: any cells on the same row should be grouped together into the same output. The nature of 99% of spreadsheets is that people have one entry per line.</p><p>You might then, consider it safe that you only have the classified cells as ground truth data, and you don’t actually have the ground truth data on the final output for your algorithm. You optimize your model, measure your accuracy and get 99%. Hooray! But wait, there’s a problem. Inside your dataset, there were some spreadsheets that looked like this (yes this actually happened to me):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*TDK2ylzoXqZS35WR.png" /></figure><p>Now it becomes clear that having ground-truth data only at the cell level is a liability. A key assumption in our post-processing, which is that there is only one output per line, has been violated. The accuracy we measured from our system was excellent. Our code worked flawlessly as designed, and all of our unit tests passed. But the system as a whole was still producing invalid results, and we didn’t know it initially because we only had ground-truth data on an intermediate step in the system, and not on the final result.</p><p>This problem can manifest itself in any situation where you have additional post-processing steps after your machine learning algorithm finishes, but don’t have any way to measure the accuracy of that final output. Although this example is simple and easy to understand, there are much more complicated and nuanced situations that can occur in the stage between your machine learning algorithms output and your final result. Always cough up the time and cash for real ground truth data to measure accuracy against, or you will get burned.</p><h3>Conclusion</h3><p>Measuring accuracy is hard. Many of the best aspects of machine learning systems, like their ability to generalize to new, never before seen examples, also present a massive headache for us to measure. Many of the problems with measuring accuracy arise from the beneficial properties of machine learning:</p><ul><li>The problem of training data being different from real world data, comes directly from how good machine learning models are capable of generalizing, so we keep pushing the boundaries of how much we want them to do so right to their limit</li><li>The problem of caring about different failure cases comes directly from the fact that our models are capable of operating in complex environments with intelligent behaviour, so our expectations on them keep getting more nuanced and specific</li><li>The problem of noise in the measurement comes directly from the fact that our models are imprecise and approximate, but this is also what allows them to generalize</li><li>The problem of multiple pipeline metrics comes from the predictably successful behaviour of machine learning algorithms, allowing us to join them together into increasingly complex sequences and pipelines</li><li>The problem of multiple metrics of granularity comes from the ability of our models to operate on complex, highly multidimensional problems</li><li>The problem of only having ground truth for an intermediate step, comes from the flexibility of machine learning to be applied to specific, isolated problems and then be pieced into larger, more traditional computing systems.</li></ul><p>Measuring accuracy is hard largely because machine learning algorithms are so good at what they do — being intelligent. We rarely talk about measuring the accuracy of people, because we acknowledge that it’s very hard to define in advance what correct behaviour is. Increasingly, machine learning models are going to be subject to the same constraint — accuracy will become even more muddied and more difficult to measure. Increasingly, we are applying machine learning in environments where accuracy is hard to even define, let alone measure — think about algorithms designed to create music. How do you measure accuracy on that? But yet, we have now created algorithms that are pretty good at generating enjoyable music.</p><p>In the Part 3 of this series of blog articles, I will be discussing some of these more interesting, more nuanced problems in measuring accuracy. What do you do if there is no off the shelf metric to measure accuracy for your problem? What do you do when you can’t measure the outcome you actually care about? What if you don’t have any ground truth data? What if you can’t even define what accuracy is in the context of your problem?</p><p>In Part 4 of this series of blog articles, I will try to present a framework for measuring accuracy better — how to measure, when to measure, and what to measure. Most importantly, I will show that how you measure accuracy will depend on what you want to do with that accuracy number. Whether its for early stopping or threshhold calibration, for bayesian optimization of a models parameters, for making iterative improvements to a model, for understanding the models failure cases, for communicating the performance to managers, or for communicating the performance to customers — there are different ways of measuring for different situations. There is no one-size-fits-all solution.</p><p><em>Originally published at </em><a href="https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-important-part-2"><em>www.electricbrain.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc26a977823e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/why-measuring-accuracy-is-hard-and-important-part-2-the-common-problems-in-measuring-accuracy-cc26a977823e">Why Measuring Accuracy Is Hard (and important!) Part 2 The Common Problems in Measuring Accuracy</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why measuring accuracy is hard (and very important)! Part 1. Why measuring right is important.]]></title>
            <link>https://medium.com/data-science/why-measuring-accuracy-is-hard-and-very-important-part-1-why-measuring-right-is-important-a279e8a6fcd?source=rss-4cc13146bf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/a279e8a6fcd</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Bradley Arsenault]]></dc:creator>
            <pubDate>Wed, 20 Mar 2019 19:29:23 GMT</pubDate>
            <atom:updated>2019-03-26T13:47:59.840Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why measuring accuracy is hard (and very important)!</h3><h4>Part 1. Why measuring right is important.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2IVXz6EZ3Z7HHkkx" /></figure><p>We are kicking off a new series of blog articles on measuring accuracy. There is a lot of content to cover — when I first started writing this article, it quickly turned into 12 hours of keyboard bashing and 20 pages of thoughts and notes. So we will be breaking it up into 4 separate articles:</p><ol><li>An overview of the problem of measuring accuracy, why it’s important, and why it’s hard</li><li>Detailed description of most of the major problems that come up in measuring accuracy</li><li>Detailed description of some of the more unusual and interesting situations that we have in measuring accuracy</li><li>What we can do about it — how to measure accuracy better</li></ol><h3>The problem of measuring accuracy</h3><p>Why is measuring accuracy of a machine learning model hard? So many machine learning models would appear to have a very simple definition of accuracy.</p><p>Lets go over a simple example — an algorithm that detects diabetes. The algorithm reports that an individual does in fact have diabetes. That prediction is either correct (the individual did in fact have the diabetes), or the prediction is wrong (the individual did not have diabetes). It would seem like accuracy is defined by a pretty simple question: how many of the predictions were actually correct. It would seem that measuring the accuracy of a model should be straightforward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*6kINpynhO27ixP5p.png" /></figure><p>A slightly closer look at the question, and how the algorithm is used in production, will give us a more nuanced answer. The typical disease prediction algorithm does not give the prediction of disease of TRUE vs FALSE, with no other information. Even the most basic implementations will at least provide a confidence score, varying between 0% and 100%. The algorithm could predict a 73% confidence of diabetes, and a 27% confidence of no diabetes. The doctor can then use the confidences, combined with their own knowledge and analysis, to make up their mind. But what is accuracy then? Is the algorithm expected to be 73% accurate when it reports a 73% confidence?</p><p>What does accuracy mean in this situation? Does accuracy mean the number of answers with more than 50% confidence that were correct? Is 50% the right threshold? How do we count the null answers? What if both yes and no have less than the required confidence? How is that counted? A slightly more nuanced and experienced data scientist will then arrive at the Receiver-Operating-Characteristic curve, or ROC curve. The ROC is no longer a single number, but a curve representing the trade-offs between false-positives and true positives that occurs when you set the threshold at different spots. It shows that, at a particular level of confidence, how many mistakes versus truth will there be. Here is an example of an ROC curve for a chat-bot. This one is pretty good:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*q1fmrEegMXfM3Pt1.png" /></figure><p>Here is another one taken from the Scikit-learn website, which is probably more realistic for a medical classifier:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*8cqWCDNc9DVSIWD5.png" /></figure><p>So now we don’t just have one number for accuracy. We have .. our choice of different accuracies. Now I should mention that the ROC curves come with an associated single number metric, AUC or Area-Under-Curve, which is literally the area underneath the ROC curve. AUC is a robust and very useful metric. But AUC is not an easy metric to explain to a stakeholder and doesn’t have any easy interpretation for us to understand. Maybe then we resort to using precision and recall? We find some acceptable point on the ROC curve, set the threshold to that point, and use these two new numbers to describe its outputs. But this quickly gets complicated when you have multiple classes in your outputs — we now have a whole series of precisions and recalls — and it quickly becomes bewildering to try to explain how a model behaves and performs.</p><p>The measurement of accuracy can even be affected by raw mathematics, which can make an improvement actually look worse. This example came to me when I was reading the Google AI blog article for a diabetes detection- algorithm: <a href="http://ai.googleblog.com/2018/12/improving-effectiveness-of-diabetic.html">http://ai.googleblog.com/2018/12/improving-effectiveness-of-diabetic.html</a></p><p>They mention that they had switched their algorithm from doing a binary classification (diabetic / not diabetic) to one on a 5 point severity scale. The data being analyzed was the same — only the outputs have changed. But now think about this: On a binary classification, the system can guess totally randomly and has a 50–50 chance of getting the correct answer. On a 5 point grading system, the system only has a 20% chance of getting the correct answer when it guesses randomly.</p><p>So now imagine you switch from a 2 point to 5 point grading system in order to give your model richer information to learn from. If you measure the raw-accuracy however, you might notice that your switch reduced the accuracy. In the 5 point grading system, the system has a much lower chance of getting the correct answer by chance alone. The authors of the article get around this by using Kappa score rather then just vanilla accuracy (which adjusts for the chance of a randomly correct answer). But the basic problem gets to the heart of my topic in this article.</p><p>Measuring your accuracy just isn’t as straightforward as it might seem. And how we measure accuracy will alter what changes we make to our model to improve it, how much we trust a model, and most importantly, how stakeholders like business people, engineers, government, healthcare, or social services organizations adopt, integrate and use these algorithms.</p><h3>Why measuring accuracy correctly is important</h3><p>Why measure accuracy? This might seem to be an easy to answer question. Without measuring accuracy, there is no way to know if your model is working or not. Unlike regular code, which can be tested with a prior assumption that it works perfectly, 100% of the time as designed, machine learning code is expected to fail on some number of samples. So measuring that exact number of failures is the key to testing a machine learning system.</p><p>But I want to take a moment to touch on some of the reasons that we measure accuracy and why it becomes important to do it right.</p><h4>Improving your Model</h4><p>The first and easiest to understand reason you measure the accuracy of a model is so that you can improve its accuracy. When you are trying to improve the accuracy, almost any metric of accuracy is possible to use. As long as that metric has a clearly defined better or worse, then the exact value of the metric doesn’t matter. What you care about is whether the metric is improving or getting worse. So what can go wrong?</p><p>Well, if you measure the accuracy of your model incorrectly, you could actually be modifying your model in ways that would hurt your real-world performance, while they appear to be improving your metric. Take, for example, the problem of generalization vs overfitting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*K-6JMKpCmeSYruhq.png" /></figure><p>If you are measuring your accuracy incorrectly, you could be making changes that appear to improve your metric, but instead they are just making your model overfit the data you’re metric is measuring against.</p><p>The standard way of solving this problem is to break your data 80/20 into training / testing. But this is also fraught with difficulty, since we sometimes use measurements of accuracy to do things like early-stopping or setting confidence thresholds, so that testing data itself then becomes part of you training process. You could be over-fitting your confidence thresholds. So then you decide to break your data three ways, 70/20/10, with an extra validation set you can measure your accuracy with at the end. But now what if your dataset size is relatively small, or its not perfectly representative of the real world data it has to operate on.</p><p>You now have to worry about another type of over-fitting I call architectural overfit, where the design and parameters of your model became too perfectly designed for the dataset, and does not generalize to new samples or learn them very well when they are added to the dataset. This can happen for example if you prepare a lot of custom made features based on your dataset, only to find they don’t apply when the dataset is grown over time, modified significantly, or merged with some other dataset. You got excellent training, testing, and validation accuracy. But your still overfitting the dataset.</p><p>Now what if your dataset has noise? What if there are consistent mistakes in the data? You might think your model is amazing — and indeed find that it is, it has perfectly learned the consistent patterns of mistakes in the dataset. You gleefully put the model into the next product, only to have your ass handed to you when the product is launched. It seems your model does not work so great in the real world. “It was perfectly accurate in testing” you might think. “What could have gone wrong?”</p><p>What if your accuracy measurement itself has noise? Let’s say you have a 1–3% spread in accuracy across multiple runs. Now this makes it harder to make incremental improvements. Every improvement needs to be larger than 2–3% in order for you to be able to reliably confirm it with a single run. Either you spend more CPU power to get clear answers using averages, or you risk spinning in circles looking only for big-wins and forgoing incremental improvement.</p><p>Measuring your accuracy better means that when you make changes changes to your model, you can be confident as to whether those changes are leading to a better model in the ways you care about. When you measure your accuracy wrong, you can end up tearing up changes or going back to the drawing board because that model you “thought” was 99.9% accurate doesn’t actually work anywhere close to that in production. Better measurement of accuracy means faster research, better products, and more accolades for you. It can even save lives.</p><h4>Communicating to Stakeholders that use our Models</h4><p>Another reason we measure the accuracy of the model is so that we can communicate to stakeholders and they can use our models. Models are never just pieces of math and code — they must sit and operate in the real world, having real effects on real peoples lives.</p><p>If a doctor is going to use an algorithm to make medical decisions, it’s important for them to know that the algorithm could be wrong, and how often that is the case. If a company is going to replace a team of data entry people with a computer, it’s important for them to know how often it can make mistakes because that can affect the company’s processes. If we claim a model will only make mistakes 3% of the time, but it actually makes 5%, we might brush that off as a small difference. But that could represent a 60% increase in calls being made to the support department by all the people affected by the algorithms mistakes. That massive increase in cost could completely nullify any benefits of implementing the algorithm in the first place.</p><p>Stakeholders need to understand the accuracy of an algorithm, and its typical failure cases, because accuracy has real world implications. The accuracy could affect budgets and balance sheets, the lives and health of real people, and even the outcome of our democracy (when it comes to fact checking algorithms now used by journalists). It could make or break new AI products, and create real disconnects between the engineers who create the technology and the consumers who use it. Making mistakes in the measurement of accuracy could very well mean that lives are lost and new products fail.</p><h3>Why Measuring Accuracy is Hard</h3><p>So what is it about measuring accuracy that makes it so difficult? Why has a seemingly easy question to answer become so difficult?</p><p>In part 2 of this series, we will go over some of the common problems that show up in measuring accuracy:</p><ul><li>The data your training the algorithm on is not the same as the data its expected to work on in production</li><li>You care about certain types of failures more than other types</li><li>Your model, dataset or measurement may be inherently noisy or stochastic</li><li>Your pipeline may have multiple different points at which accuracy can be measured</li><li>Your model may have several different metrics with different levels of granularity</li><li>You might only have ground-truth data for an intermediate step in the system, but not the final result</li><li>Your dataset might be broken down into different categories with wildly different performance between them</li></ul><p>In part 3 of this series, we will address some of the more difficult and interesting problems that we face when measuring accuracy:</p><ul><li>You may not have any ground-truth data for your model</li><li>There may be no off-the-shelf metric which measures accuracy for your model</li><li>There may not be a clear way to define accuracy for your model</li><li>The outcome you actually care about can’t be measured easily</li><li>Measuring accuracy effectively is too computationally expensive</li><li>Your algorithm might be working in tandem with humans</li><li>Your dataset might be changing and evolving, for example if its being actively grown by a data annotation team</li><li>Your problem space might be continuously evolving over time</li></ul><p>In light all of these potential problems in measuring accuracy, I’ve come to appreciate a basic piece of wisdom: <strong><em>no matter how you measure it or what you metric you use, we can usually agree on what perfectly correct and completely wrong looks like. It’s everything in between that matters.</em></strong></p><p>Look for Part 2 of this series coming out soon!</p><p><em>Originally published at </em><a href="https://www.electricbrain.io/blog/why-measuring-accuracy-is-hard-and-very-important-part-1"><em>www.electricbrain.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a279e8a6fcd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/why-measuring-accuracy-is-hard-and-very-important-part-1-why-measuring-right-is-important-a279e8a6fcd">Why measuring accuracy is hard (and very important)! Part 1. Why measuring right is important.</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why AI is a more important trend then blockchain]]></title>
            <link>https://medium.com/@brad.arsenault/why-ai-is-a-more-important-trend-then-blockchain-d051b9554dc8?source=rss-4cc13146bf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/d051b9554dc8</guid>
            <category><![CDATA[emerging-technology]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Bradley Arsenault]]></dc:creator>
            <pubDate>Wed, 20 Mar 2019 18:48:12 GMT</pubDate>
            <atom:updated>2019-03-20T18:48:12.747Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*HkhM65Vu7qPjJDIf.jpg" /><figcaption>Trend: AI vs Blockchain</figcaption></figure><p>I have to admit — I hear a lot about what is happening within the blockchain space these days. The crypto-bubble and the easier accessibility of blockchain technology has lead to, in my opinion, an unprecedented hype-cycle. People regularly contact me in order to discuss various ways to combine AI and blockchain technology.</p><p>In my opinion, the two technologies are almost diametrically opposed:</p><ul><li>Blockchain technology is all about maintaining an absolute, exact, precise shared state in the face of extraordinary circumstances:</li><li>AI technology is all about dealing with the rough and fuzzy, the unpredictable, and the unexpected</li></ul><p>Nevertheless, there are some use-cases where the two technologies meet:</p><ul><li>Blockchain has been getting used to help AI companies disseminate and get access to data</li><li>AI has been getting used to analyze the transactions on blockchains, and of course predicting the price movements of cryptocurrencies</li></ul><p>And there are some outright similarities:</p><ul><li>As technologies they are both fueled by enormous amounts of computing power</li><li>As trends, they both have similar hype cycles that have been ramping up around the same time</li></ul><p>However, ultimately, I believe AI is just a way more important topic and trend then blockchain is, both over the short and long term. There seems to be more popular hype around blockchain (Easily 3x the investor capital, at least in 2017), but AI is just a more transformative trend. There are three main reasons I believe this is the case:</p><ul><li>AI is transformative for every labor market and profession, where as blockchain is really only transformative in parts of finance and back-office-processing.</li><li>AI technology is backed by continuous, rapid paced innovation and research (cracking human level accuracy in a new domain every couple of months), where as blockchain technology has really only seen a few big leaps over 10 years (crypto itself, generalized blockchains, smart contracts, and the ‘tangle’ of Iota).</li><li>AI hype is being fueled by massive productivity gains, whereas blockchain hype is being fueled by rampant cryptocurrency speculation and an unprecedented 10 year economy and stock-market boom.</li></ul><p>In conclusion, while both AI and Blockchain are important trends in the rapidly changing technology universe, AI technology just represents a way more important long term trend, and should represent a proportionally larger amount of attention and budget.</p><p>Do you agree or disagree? Reach out to us by LinkedIn or <a href="https://www.electricbrain.io/contact-us">email to let us know</a>. This article was originally published at <a href="https://www.electricbrain.io/blog/why-ai-is-a-more-important-trend-then-blockchain">www.electricbrain.io</a></p><p><a href="https://www.electricbrain.io/blog/search/.hash.trend">#trend</a> <a href="https://www.electricbrain.io/blog/search/.hash.artificialintelligence">#artificialintelligence</a> <a href="https://www.electricbrain.io/blog/search/.hash.blockchain">#blockchain</a> <a href="https://www.electricbrain.io/blog/search/.hash.aivsblockchain">#aivsblockchain</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d051b9554dc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How do I know if my AI idea is possible?]]></title>
            <link>https://medium.com/data-science/how-do-i-know-if-my-ai-idea-is-possible-ee6208511e84?source=rss-4cc13146bf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee6208511e84</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[entrepeneurship]]></category>
            <dc:creator><![CDATA[Bradley Arsenault]]></dc:creator>
            <pubDate>Fri, 15 Mar 2019 13:28:16 GMT</pubDate>
            <atom:updated>2019-03-16T12:38:19.950Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*2iEPilKrM7E6KX4L.jpg" /></figure><p>One of the questions that I get asked often as an AI consultant is, in some ways, the most simple: Is this possible?</p><p>People will come to me with some very vague notion of something they want automated or some sort of AI product they want to create. They usually don’t come from a technology background, but they are smart, intelligent, informed people. They have read about AI technology being applied in other, similar domains and they see a similar opportunity in their own domain.</p><p>Answering this question is usually pretty straightforward. There are only a few questions that you need to ask yourself:</p><ol><li>How good do humans do it? Could humans do what you want to do, with the data you want to do it with (even if it would be very time consuming)</li><li>How easily would you be able to capture 10,000 to 100,000 examples of a human doing it? How much would it cost? Do you have access to historical data, or are you gathering everything from scratch?</li><li>Is what I’m doing something thats known to be hard (reading minds from EEG, human-level intelligence, predicting when the economy will turn)</li></ol><p>We will go through some examples for you:</p><h3>Self Operating Crane</h3><p>I want to create a self-operating crane, for use on construction sites as swap in replacement for existing cranes. Must be able to talk to the crane over the radio.</p><ol><li>How good do humans do it?</li></ol><p><em>Extremely accurately with moderate training.</em></p><ol><li>How easily would you be able to capture 10,000 to 100,000 examples of a human doing it?</li></ol><p><em>If I’m a crane manufacturer, a big crane rental company, or a big construction company, I should be able to get 10,000 to 100,000 hours of crane operation.</em></p><ol><li>Is what I’m doing something thats known to be hard (reading minds from EEG, human-level intelligence, predicting when the economy will turn)</li></ol><p><em>Nope.</em></p><p>In conclusion, a self operating crane is very possible.</p><h3>AI based startup investing</h3><p>I want to create an AI system to help me pick which startups to invest in.</p><ol><li>How good do humans do it?</li></ol><p><em>Very poorly ( rule of thumbs are 1-in-10 succeed)</em></p><ol><li>How easily would you be able to capture 10,000 to 100,000 examples of a human doing it?</li></ol><p><em>Very hard — there aren’t that many startup investments in a year in the entire venture capital industry.</em></p><ol><li>Is what I’m doing something thats known to be hard (reading minds from EEG, human-level intelligence, predicting when the economy will turn)</li></ol><p><em>Nope.</em></p><p>In conclusion, an AI based startup investment system will be very difficult to create.</p><h3>AI powered project management</h3><p>I want to create a feature in my project planning software to use AI to predict when projects are likely to fall behind schedule. Additionally, I want the AI to provide recommendations on how to get those projects back on schedule.</p><ol><li>How good do humans do it?</li></ol><p><em>Poorly over long time periods, very good over short time horizons</em></p><ol><li>How easily would you be able to capture 10,000 to 100,000 examples of a human doing it?</li></ol><p><em>Fairly easily if I already have project-management software in the market. It just needs to be modified so people start capturing data on when their projects fall behind schedule</em></p><ol><li>Is what I’m doing something thats known to be hard (reading minds from EEG, human-level intelligence, predicting when the economy will turn)</li></ol><p><em>Nope.</em></p><p>In conclusion, an AI based project management is very possible.</p><h3>AI powered mentoring / coaching</h3><p>I want to create an AI robot that can mentor young kids. It should be able to teach them general life skills, help them with their homework, and generally have fun with them.</p><ol><li>How good do humans do it?</li></ol><p><em>Pretty good, if the human in question has people skills (not always the case)</em></p><ol><li>How easily would you be able to capture 10,000 to 100,000 examples of a human doing it?</li></ol><p><em>With moderate difficulty — each mentor might have 50 to 100 sessions with mentees per year, so you can accomplish this if your a medium to large mentoring organization</em></p><ol><li>Is what I’m doing something thats known to be hard (reading minds from EEG, human-level intelligence, predicting when the economy will turn)</li></ol><p><em>Yes, as making AI’s have common sense and general human-like life skills is pretty difficult (additionally as of 2018 robots are still pretty hard too)</em></p><p>In conclusion, an AI powered mentor is probably not possible today.</p><h3>Conclusion</h3><p>Sometimes when you are a non-technical entrepreneur and you want to create cool new technology, it can be difficult to know how to get started. If you are not a technology person, trying to separate what is possible from what is not is very challenging. However, if you focus on these three simple questions: how good are humans at it, how much data can I get, and whether this is a known hard problem discussed as such in the media, then you will be able to narrow down significantly what your feasible AI ideas are from the ones which aren’t.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee6208511e84" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/how-do-i-know-if-my-ai-idea-is-possible-ee6208511e84">How do I know if my AI idea is possible?</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Future of Chatbots — Bots talking to Bots]]></title>
            <link>https://medium.com/data-science/future-of-chatbots-bots-talking-to-bots-388112a204f5?source=rss-4cc13146bf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/388112a204f5</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Bradley Arsenault]]></dc:creator>
            <pubDate>Thu, 30 Aug 2018 12:52:56 GMT</pubDate>
            <atom:updated>2018-08-30T12:57:30.678Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o_L-Vv_wp--clUVUwzp_kw.jpeg" /><figcaption>The future of integration with conversation</figcaption></figure><p>I was recently thinking about a project. We were building an app, and part of it involved booking reservations at a restaurant. Most restaurants don’t have automated reservation systems — there are few API’s you can plug into that will support many restaurants.</p><p>The only reliable way to support every restaurant is to actually call those restaurants and book the reservation the good old-fashioned way — by talking to a person. However, to save money, we were exploring the idea of having a bot make this phone call instead using modern voice technology. In theory, this is very possible, albeit it will take quite a bit of data collection to accomplish.</p><p>Now by shear coincidence, I also happen to be a technical advisor to Vesta.ai, a company making <a href="https://www.electricbrain.io/blog/what-do-you-need-to-put-into-your-next-chatbot-request-for-proposal">chatbot technology</a> for restaurants. Their goal is to make a chatbot that can replace the waiter. You would come in, sit down and start talking to a small smart speaker to make your order. However, the company plans to extend this technology to taking calls over the phone as well.</p><p>So naturally thinking about these two projects, I began to wonder. Whats going to happen if both technologies become prevalent and mainstream? Are we going to have bots talking to bots? The almost undeniable answer is — Yes. But the question is, will this be an edge-case, a humorous example of a vestigial technologies we will see as society transition from human powered to AI powered systems. Or might conversation eventually become a deliberate engineering choice for integrating two pieces of software?</p><p>In considering the answer, I ask you to compare and contrast the two ways of integrating systems:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*vreJvHZ0Ehh_91FacwFpLw.png" /></figure><p>Given all of this, it might seem crazy to believe that natural language integrations might ever be a real engineering choice. But I will call attention to the fact that many of the down-sides of the hypothetical natural language integration are mitigated with long-term trends:</p><ul><li>CPU power and network capacity continue to increase exponentially, diminishing the significance of the extra CPU and network costs</li><li>The tools for general purpose NLP get better every day, reducing the need for specialty expertise and custom datasets</li><li>AI expertise is becoming much more widespread, encouraged by its trendy status in the tech industry</li><li>Companies are increasingly creating conversational interfaces anyhow for humans, making it easy to reuse the effort for machine-to-machine integration</li></ul><p>And the upsides are equally getting more tantalizing with long-term trends:</p><ul><li>Maintaining API based integrations is getting more and more expensive as the pace of changes accelerates, which demand we continuously update our code just to keep up</li><li>As more and more people move into the technology industry, designs that allow semi-technical or non-technical people to understand the system become more valuable</li><li>There are more and more systems to integrate with, each integration needing to be created and maintained separately even when their behaviour is very similar</li></ul><p>The combination of all these trends would seem to imply that a natural-language integration between two systems is going to get more and more valuable relative to a traditional integration as time goes on.</p><p>In the beginning, it will start small. It will spin-off from the increasing prevalence of bots intended for humans. A few enterprising programmers will create natural language integrations just to show that it can be done. Some bot-to-bot conversations may result accidentally from the increasing automation on both sides of a transaction.</p><p>Then, when projects are running late and engineers are under pressure to deliver, natural language integrations might be justified as temporary hack fixes or one-off schemes, curious for their convenience, but never intended to be permanent. But when these integrations go live and the sky does not fall out, this crazy way of thinking about API’s will increasingly become an acceptable engineering choice, although relegated to certain edge cases.</p><p>I predict though, that as the AI industry continues to move forward and we try to automate more and more processes and jobs, we will need to create integrations between different organisations at an exponentially growing rate. These integrations will need to interact in increasingly complex ways that demand ever growing oversight on behalf of humans. With it, the natural language integration will go from an esoteric concept, a hackers toy, to a dominant mainstream technique.</p><p>The advantage of sharing the effort between different integrations will be too great to ignore. So, instead of the humans increasingly adapting to the world of technology — the world of technology will increasingly look like us. Even at the deepest levels, our machines may start speaking human to each other. Bots will be talking to bots.</p><p><em>FYI: This post was originally published at </em><a href="https://www.electricbrain.io/blog/bots-talking-to-bots"><em>www.electricbrain.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=388112a204f5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/future-of-chatbots-bots-talking-to-bots-388112a204f5">Future of Chatbots — Bots talking to Bots</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What does an AI RFP need to contain?]]></title>
            <link>https://medium.com/data-science/what-does-an-ai-rfp-need-to-contain-13c747b316ed?source=rss-4cc13146bf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/13c747b316ed</guid>
            <category><![CDATA[request-for-proposal]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Bradley Arsenault]]></dc:creator>
            <pubDate>Tue, 14 Aug 2018 13:43:01 GMT</pubDate>
            <atom:updated>2018-08-14T15:00:49.522Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*qD6kmCEe51coXb4-OR99EA.jpeg" /><figcaption>AI RFP</figcaption></figure><p>We are kicking off a series of posts directed at partners to help them commercialize AI technology. In this post, we cover one of the most important points for partners at the Sales and Implementation level: What does an AI RFP need to contain?</p><p>For those of you who aren’t familiar with the term, RFP means a “Request for Proposal”. In the AI sales process, <a href="https://www.electricbrain.io/">Electric Brain</a> uses the RFP in order to quickly assess projects. A well constructed RFP ensures that the Electric Brain team is able to provide a fast-turn around, so you can provide fast service to your client. There are really only a handful of questions that we need to answer in order to be able to quote the price and time-line of the AI project.</p><p><strong>What is the business problem that the AI technology is trying to solve?</strong></p><p>You must tell us in clear terms what the high level problem that the AI is trying to solve. As much as possible, try to tie this back to how the AI solution affects the bottom line of the business. Is it some flashy technology intended to bring in more customers? Or are we trying to automate an existing process and reduce costs? Here are some potential questions that we will need the answers to:</p><ul><li>What is the business problem being solved?</li><li>How much additional revenue is expected from the AI solution?</li><li>How much savings is expected from the AI solution?</li><li>What type of data is being processed? Video? Images? Text? Dates? Numbers? Time-series data?</li></ul><p><strong>Where are we getting the data for the AI?</strong></p><p>One of the most important questions to be answered is whether the client has the appropriate data in order to create the solution. All artificial intelligence solutions require data in order to work. However, the most innovative solutions are not built using the data that you happen to have lying around. They frequently require a period of manually collecting the dataset. Sometimes this presents a chicken and egg problem. How do we launch if the AI doesn’t work? We need to launch to get the data. We need the data in order for the AI to work.</p><p>When discussing the project with your client, try to think of clever ways around this problem. Frequently, AI systems will keep humans in the loop in order to ‘train’ the AI. If the system does not know how to handle a particular input, it can route that input to a ‘human’ and let the human take care of it. These humans can then serve a secondary purpose which is to monitor the AI and make sure its working at the appropriate quality level.</p><p>Frequently, a client will ask you <a href="https://www.electricbrain.io/blog/how-much-data-do-i-need-for-my-ai-solution">how much data is required to get the system working</a>. This is an extremely difficult question to answer with any certainty. However, in a pinch, go with the following rule of thumb: You will need 1,000 entries for each underlying ‘pattern’ that you think exists within the data that you need it to understand. For example, lets say you were creating a system which can predict the Make, Model, and Year of a car from a photo. The rule of thumb here would require you to have 1,000 images for each Make, Model, and Year of car. However, lets say you were only trying to predict the Make. Well this is a somewhat simpler problem, and you could probably get away with significantly fewer images.</p><ul><li>Does the client have the data already?</li><li>How much data do they have access to already?</li><li>Does the data need to be ‘enhanced’ in some way manually?</li><li>Is the data missing anything required for the AI solution?</li><li>How ‘noisy’ is the data?</li><li>Can we launch the product without a dataset, and gather the data as we go?</li></ul><p><strong>What level of quality / accuracy is expected from the solution?</strong></p><p>Depending on what it is that the AI system is doing, there may be different expectations of its quality. For example, in a voice recognition solution, we expect 100% accuracy — we want the system to be able to recognize every single word that we say. However, in a system which does medium-frequency stock trading, we might be satisfied if the system is 75% accurate as long as its significantly better then random chance. The requirements for quality can get even more complex. Say you have a system which does finds terrorists. You may have only 50 people out of 1,000,000 who are terrorists. A system which is 99% accurate here means that it correctly identifies 49 terrorists, but another 10,000 completely average people will get erroneously declared terrorists. Here, you will need to make a distinction between false-positive and false negative rate.</p><ul><li>What level of quality would be expected from the system?</li><li>Is there any way to measure the level of quality? Or is it purely subjective?</li><li>Does the system need to be ‘biased’ in one way or another?</li></ul><p><strong>Where is the technology being implemented?</strong></p><p>The design of the AI technology will vary depending on what the context of where the system will be deployed is. For most use-cases, the technology is installed on a server and integrated into a SaaS type product. However, for some cases, the AI technology may need to run directly on a mobile device. This is more challenging but not impossible.</p><ul><li>Is the technology being deployed on a server or a mobile device?</li><li>Does it need to be integrated into a larger product?</li><li>What stack is the larger product built on? Linux? Windows? iOS? Android?</li><li>Which programming languages and frameworks is the surrounding system built in?</li><li>What database is the relevant data for the AI being kept in?</li></ul><p><strong>Is there any surrounding non-AI technology that needs to be developed as well?</strong></p><p>If the technology being created is a prototype for a new product, there may be additional work required in just creating the product itself, on top of the AI technology.</p><ul><li>Is there a user-interface that needs to be developed?</li><li>Is that user interface web-based or mobile? Both?</li><li>Is there an integration with a large, complex system that needs to be built as part of the solution?</li></ul><p><strong>Conclusion</strong></p><p>I hope this has helped you to get a better grasp of what you need to put into an AI request for proposal. By thoroughly investigating and documenting the needs of your clients, we can provide very fast turn-around times for you. This ensures a smooth and speedy sale.</p><p><em>This post was originally published at </em><a href="https://www.electricbrain.io/blog/what-does-an-ai-rfp-need-to-contain"><em>www.electricbrain.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13c747b316ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/what-does-an-ai-rfp-need-to-contain-13c747b316ed">What does an AI RFP need to contain?</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why small data is the future of AI]]></title>
            <link>https://medium.com/data-science/why-small-data-is-the-future-of-ai-cb7d705b7f0a?source=rss-4cc13146bf71------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb7d705b7f0a</guid>
            <category><![CDATA[small-data]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Bradley Arsenault]]></dc:creator>
            <pubDate>Tue, 07 Aug 2018 12:55:57 GMT</pubDate>
            <atom:updated>2019-03-28T18:52:50.204Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jwFy2ljL28FokCfuQz9JxQ.jpeg" /></figure><p>I’ve spent the last 8 months going out and pitching big ideas for artificial intelligence solutions. I’m very frequently faced with business people who have been schooled for the last decade on the importance of data. However, this means my services often get conflated with data analytics and big-data consulting. From the business person’s perspective, their ask is simple: “We have all this big-data. Can you come in and make us more money from it?”</p><p>I find this frustrating for two reasons. The first is that artificial intelligence technology has so much more potential than just analyzing big data sets. There are plenty of well established technologies for analyzing big data sets, and plenty of well established consultants. The second is that, for most of the artificial intelligence problems that exist, <em>there are no big datasets available for use</em>.</p><p>Many artificial intelligence companies that are working on truly novel solutions have to gather the data sets for those solutions manually. A huge portion of the capital investment into an artificial intelligence startup is put into gathering the dataset necessary to make their product work.</p><h4>Example</h4><p>Let’s take one of the growing AI use-cases as an example: AI based contract review for lawyers (e.g. Blue Jay Legal, eBrevia, Kira Systems, Law Geex, etc..). In order to accomplish this, all you need is a large dataset of contracts which have been annotated with the lawyers feedback. This may include specifying clauses that appear to be screwing over one party or the other, clauses which are highly unusual for this type of contract, language which is out of the ordinary or unclear, etc…</p><p>Lawyers however are notoriously old fashioned in the way that they work. If you’re lucky, you might find some law firms have kept draft contracts with red-lines in them, and this would be useful if all your product needed to do was reproduce the red-lines. However, if you want more qualitative feedback on a contract, you’re out of luck. And even if you do manage to amass this dataset from a law-firms past work, that’s still not going to be big-data. At most, you might be able to get 10k or 20k of reviewed contracts — nothing anywhere close to the size of “big-data” that people talk about today, which are often on the scale of millions, billions, and trillions of entries.</p><p>To make this work, the AI contract review startup has to make their technology work with the size of the datasets that they can get access to. They have to be able to work with small data.</p><h4>Why is small data hard?</h4><p>Humans are able to learn from small datasets — why aren’t machines able to? The answer is simple — humans haven’t actually learned from a small dataset. We have, since we were born, been learning from a continuous feed of data coming in through our 5 senses.</p><p>The current largest image-processing dataset, <a href="http://www.image-net.org/">Image-Net</a>, contains about 14 million images. If we take a conservative estimate, let’s assume a person sees a distinct image once every 30 seconds. By the time a person enters their professional career around 25 years old, they have thus seen:</p><p>= 25 years * 365.24 days/year *16 hours/day * 60 minutes/hour * 2 images / minute</p><p>= 17, 531, 520 distinct images</p><p>Every single one of us, by the time we are entering our professional careers, have been exposed to a larger visual dataset then the largest dataset available for AI researchers. On top of this, we have sound, smell, touch, and taste data all coming in from our external senses. In summary, humans have a lot of context on the human world. We have a general common-sense understanding of human situations. When analyzing a dataset, we combine the data itself with our past knowledge in order to come up with an analysis.</p><p>The typical machine learning algorithm has none of that — it has only the data you show to it, and that data must be in a standardized format. If a pattern isn’t present in the data, there is no way for the algorithm to learn it. The signal must be greater than the noise.</p><h4>Where all the action will be</h4><p>This might be a distressing fact for the artificial intelligence community. For many, if not most, professional jobs there are no available big data sets in the community. Gathering a big dataset to represent that task may be prohibitively expensive. Let say you’re trying to collect a dataset to automate doing an accounting audit on a small business. Using current best-practice techniques, there are likely several required datasets (this is purely speculative):</p><ul><li>50, 000 instances of accounting statements where “red-flags” and “areas of interest” have been annotated</li><li>250, 000 conversations with company staff to request supporting documentation on a transaction</li><li>100, 000 cases where a piece of supporting documentation has been analyzed for validity with respect to a given transaction</li><li>50, 000 final reports written on the audit</li></ul><p>Even though this dataset doesn’t top a million entries, you can already see just how pricey its getting. If we assume an auditor charges $150 / hour, and that auditing a small business requires 20 hours of time, then this dataset is going to cost a whopping $150 million dollars. It’s no surprise that we haven’t seen any <a href="https://www.electricbrain.io/blog/what-ai-startups-are-active-in-western-canada-in-2018">AI startups</a> tackling the time consuming accounting audit process. The only way to build the AI auditor is to somehow make technology that can work with a smaller dataset. And in fact, that vast majority of tedious jobs we will try to automate have this same basic problem. Once the low-hanging AI fruit are used up, how do we move up to the middle fruit? How do we move up to the fruit at the top of the tree? How do we crack small datasets?</p><h4>Enter transfer learning</h4><p>Somehow, we need to be able to give our AI systems general purpose knowledge on the human world — the same way that humans have. Transfer learning is an up-and-coming technique that allows us to transfer the knowledge learned in one dataset and apply it to another dataset.</p><p>Transfer learning has largely taken a back-seat in the machine learning community up until recently with the rise of <a href="https://www.techopedia.com/definition/32902/deep-neural-network">deep neural networks</a>. Deep neural networks are extremely flexible compared to most other machine learning techniques. They can be trained, chopped up, modified, retrained, and generally just abused in all sorts of ways. This has lead to all sorts of novel situations where we can apply transfer learning.</p><ul><li>In text processing, we can use a shallow neural net called word2vec in order to try and encode the <em>meaning </em>of a word in a vector by reading tens of billions of lines of text from the internet. These vectors can then be applied to more specific tasks</li><li>In image classification, we can train a neural network on the very large Image-Net dataset, and then retrain it on a smaller dataset for which we may only have a few thousand images.</li></ul><p>More recently however, more ambitious instances of transfer learning have been shown to be successful. Just a few months ago, <a href="https://research.googleblog.com/2017/06/multimodel-multi-task-machine-learning.html">Google Brain released research on their MultiModel</a>. In this research, they trained the same deep-neural-network on 8 different tasks simultaneously. In their research, they discovered that the systems performance improved on tasks with small-datasets. Although it’s early days, the research provides a tantalizing glimpse of how we might be able to give our AI systems context about the world that will allow them to understand small datasets.</p><h3>So whats next?</h3><p>I believe that big-data is nearing the peak of its hype. As more and more companies reach maturity in their collection and usage of big datasets, they will begin to ask, “What’s Next?” I believe more and more companies will be looking towards automation using small datasets as the next phase of their data strategy.</p><p>For every dataset with one billion entries, there are 1,000 datasets with one million entries, and 1,000,000 datasets with only one thousand entries. So once the low-hanging fruit has been exhausted, the only possible way to move forward will be to climb the tree and build systems which can work with less and less data.</p><p><em>This article was originally published at </em><a href="https://www.electricbrain.io/blog/why-small-data-is-the-future-of-ai"><em>www.electricbrain.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb7d705b7f0a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/why-small-data-is-the-future-of-ai-cb7d705b7f0a">Why small data is the future of AI</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>