<?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 Rama Akkiraju on Medium]]></title>
        <description><![CDATA[Stories by Rama Akkiraju on Medium]]></description>
        <link>https://medium.com/@rama.akkiraju?source=rss-8e2e1c53d1bc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*L4rqTRLjld2-VAsH.</url>
            <title>Stories by Rama Akkiraju on Medium</title>
            <link>https://medium.com/@rama.akkiraju?source=rss-8e2e1c53d1bc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 19 May 2026 12:22:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rama.akkiraju/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[Harvesting insights from logs in IT Operations Management in an economically viable manner]]></title>
            <link>https://medium.com/ibm-cloud/harvesting-insights-from-logs-in-it-operations-management-in-an-economically-viable-manner-44a4debe3746?source=rss-8e2e1c53d1bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/44a4debe3746</guid>
            <category><![CDATA[aiops]]></category>
            <category><![CDATA[log-processing]]></category>
            <category><![CDATA[log-parsing]]></category>
            <category><![CDATA[log-anomaly-detection]]></category>
            <category><![CDATA[watson-aiops]]></category>
            <dc:creator><![CDATA[Rama Akkiraju]]></dc:creator>
            <pubDate>Tue, 24 May 2022 08:15:13 GMT</pubDate>
            <atom:updated>2022-05-27T20:36:57.914Z</atom:updated>
            <content:encoded><![CDATA[<p>By<strong> Rama Akkiraju, IBM Fellow, CTO AIOps, and Xiaotong Liu, Senior Data Scientist, Manager, AIOps</strong></p><p><strong>Collaborators</strong>: Mudhakar Srivatsa, Amitkumar Paradkar, Prateeti Mohapatra, Jae-Wook Ahn, Sarasi Lalithsena, Meenakshi Madugula, Neil Boyette, Jiayun Zhao, Anbang Xu, Lu An, Gargi Dasgupta, Karan Karuppiah, and Rakesh Ranjan.</p><p>Following our recent posts on <a href="https://community.ibm.com/community/user/aiops/blogs/raghu-kiran-ganti1/2021/11/30/why-logs-are-important?CommunityKey=6e6a9ff2-b532-4fde-8011-92c922b61214">Why logs are important</a> [1], and <a href="https://medium.com/ibm-cloud/why-is-log-parsing-and-processing-hard-1e72bac55712">Why Log Parsing and Processing are hard</a> [2], in this article we offer strategies for parsing logs to effectively detect anomalies during IT operations management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iJ7rY88TUaUnkEe-0dSjqQ.png" /></figure><p><strong>Introduction</strong></p><p>Information Technology (IT) logs are events generated by software systems during the execution of a program in production environments for problem detection and diagnosis in IT operations management. Logs contain information about errors, exceptions, warnings, informational events, and other diagnostic information. Logs are semi-structured machine-generated data. They can come in many formats, structures, languages, and large volumes. These multi-dimensional attributes of logs pose many challenges in parsing and processing logs. However, since they contain valuable diagnostic information, it is important to mine them for insights.</p><p>Until recently, IT operations administrators and Site Reliability Engineers (SREs) have been looking manually in logs for diagnostic information via text search strings. While Log Analysis tools and products help by aggregating logs and enabling search via proprietary query languages, and allow users to write custom rules to trigger events when specific thresholds exceed, they tend to be static and require maintenance of those rules.</p><p>Log anomaly detection (LAD) aims to detect anomalous behavior in IT logs automatically using Machine Learning (ML) techniques. Increasingly, more and more tool vendors are starting to incorporate ML-based anomaly detection in their Log Analysis and AIOps products. However, log anomaly detection is a hard problem. It requires parsing of arbitrary formats of logs, extracting meaningful information/entities from those logs, training ML models to learn normal log patterns so that they can detect anomalies, and explanation of detected anomalies. While techniques such as DRAIN [3] have been widely used for log parsing and feature generation for downstream log anomaly detection, they don’t take the variables in logs into account (more details about constants and variables in logs are described later in this article). Not considering variables in logs misses important diagnostic information and thereby impacts the quality of downstream anomaly detection. For complete log comprehension, both constants and variables in logs must be harvested.</p><p>In this article, we present some state-of-the-art approaches to derive insights from logs. We are actively exploring some of these techniques in our labs for potential inclusion in the future releases of <a href="https://www.ibm.com/cloud/cloud-pak-for-watson-aiops">Cloud Pak for Watson AIOps</a>. However, please note that this is not a product roadmap article. Our primary goal in this article is to suggest future directions for log analysis for better anomaly detection in IT operations environments.</p><p><strong><em>Log format recognition and parsing</em></strong>: Logs can be written in plain text, XML, JSON, plain old java object (POJO), or any other format. Sometimes logs can have embedded JSONs within XMLs and vice versa. This complicates the processing of logs significantly, especially when XML and JSON structures are embedded inside each other. Extracting the needed entities to prepare features becomes more difficult as they get buried inside arbitrary levels and layers. To address this problem, one must build parsers to identify and parse standard formats such as XML, JSON, plain text, POJOs, etc., in logs so that the key entities can be extracted from them properly.</p><p><strong><em>Format recognition of well-known logs</em></strong>: Standard middleware products, operating systems, and infrastructure have well-defined and published schemas for logs. For example, apache, Syslog — Linux and network vendor variants, mongo, Websphere, Redis, Elastic, db2, etc. have well-defined log formats. Therefore, when these formats are recognized, known schema definitions can be followed to extract specific entities of interest. In <a href="https://www.ibm.com/cloud/cloud-pak-for-watson-aiops">Cloud Pak for Watson AIOps</a>, as of the 3.2 version, Websphere logs are processed out-of-the-box. More is on the way.</p><p><strong><em>Tokenization</em></strong>: Logs can be written in many natural languages depending on who wrote the software program (e.g. English, German, Italian, Spanish, Japanese, etc). This means that the Natural Language Processing (NLP) software used for processing log messages must be able to detect the language and parse it accordingly with suitable tokenizers and dependency parsers to extract features from them.</p><p><strong><em>Entity Recognition</em></strong>: One aspect of log parsing includes identifying entities such as IP addresses, port numbers, date-time stamps, UUIDs, etc., that occur frequently in logs. These can pose significant parsing challenges. Regular expressions, shallow semantic parsing, and dictionaries come in handy in identifying entities accurately. Depending on the format of logs, applying a suitable entity recognition technique is critical to extracting entities correctly. Separate entity recognizers might have to be built for each kind of entity extraction once an entity is identified of a certain kind. This requires both entity type identification/classification and then entity extraction by applying a suitable extractor. For example, in our prior article ‘<a href="https://medium.com/ibm-cloud/why-is-log-parsing-and-processing-hard-1e72bac55712">Why Log Parsing and Processing are hard</a>’ [2], we presented several examples of date-time stamp format variations. One needs a date-time stamp entity recognizer to specifically deal with different types of variations. Similarly, one needs an IP address, port number, and other message code recognizers as each is an entity of its own. While some entities come in multiple formats, others tend to be more standardized. In either case, specialized entity recognizers will come in handy for accurate entity extraction for downstream processing.</p><p><strong><em>Log Enrichment</em></strong><em>:</em> Each log can be enriched with metadata that is useful for downstream tasks such as anomaly detection. An example of enrichment is classifying a logline as an error, exception, informational, latency-related, saturation-related, traffic-related, etc. Supervised machine learning algorithms are often employed to classify a logline into these categories. One way to do this would be by collecting enough labeled data on logs. This requires a Site Reliability Engineer (SRE) subject matter expert (SME) to label the data. We consider such activities human-in-the-ai-loop activities. Rule-based approaches are an alternative to these enrichments. Rule-based approaches don’t need data labeling. However, SMEs must specify rules for what entities to look for and under what conditions a logline can be classified as an error, exception, informational, etc. Each approach comes with its own pros and cons. Depending on the domain and availability of labeled data, or SME time, specific techniques can be chosen.</p><p><strong><em>Log Templatization</em></strong><em>: </em>Log templatization is about clustering logs of a similar kind together and assigning them a template/group Id. One popular algorithm for log parsing and templatization is the Drain algorithm [2], which employs a fixed depth tree parsing approach. In Drain, when forming a log template, constants are retained, and variables are ignored. For example, in the logline “received block blk_ID_2345987 of size 89456873 from 10.432.34.12” block Id, blk_ID_2345987 and block size 89456873 are variables, and the phrases ‘received block’, ‘of size’, and ‘from’ are constants. When this logline gets templatized it would look like “received block &lt;*&gt; of size &lt;*&gt; from &lt;*&gt;”. A more sophisticated version of templatization would recognize the entities of the variables and would templatize as follows “received block &lt;ID&gt; of size &lt;NUM&gt; from &lt;IP Address&gt;”, thereby paving the way for a better explanation. The counts of these templates, known as <em>count vectors</em>, become features for downstream anomaly detection. When loglines of similar kinds arrive, they are grouped together, and the count of such log templates can be used as vectors in time-series algorithms for anomaly detection. While the Drain algorithm works well overall, it fails to consider critical information that may be contained in the variables of logs. The variability in the variables contains useful diagnostic information. For example, in the above logline example, if the size of the variable ‘block’ varies beyond the normal range, that could be an indication of an anomaly. Ignoring that misses that useful information. Therefore, other techniques have to be developed to derive structured features out of the unstructured loglines wherein, the pattern variations of variables are also considered, in addition to the <em>count vector</em> features that consider constants alone, in the downstream task of anomaly detection. In a full log parsing approach that considers both constants and variables, key-value pairs are extracted from the variables in log lines. For example, ‘block-ID’ would be a key and ‘blk_ID_2345987’ would be its value. Similarly, ‘block size’ is the key and ‘89456873’ would be the value. These key-value pairs can then be efficiently stored in databases for efficient downstream tasks of anomaly detection. The constant part of the log templates can be stored separately for full reconstruction of logs when needed for audit or explanations.</p><p><strong><em>Feature Extraction</em></strong><em>: </em>Feature extraction is the process of deriving structured features from unstructured logs. Different kinds of features can be extracted from logs. Some of them are noted below.</p><ul><li><em>Word embeddings:</em> Extract word embeddings for the natural language words in a logline. The sequences of these word embeddings form time-series data.</li><li><em>Count vectors of log templates:</em> The counts of the templates of each kind form the feature vectors. The process for templatization is briefly discussed in the previous item.</li><li><em>The variables in loglines: </em>Variables that are captured as the values of the key-value pairs extracted using natural language processing techniques as mentioned in the ‘Log Templatization’ section of this article.</li></ul><p><strong><em>Human inputs for data type identification in log parsing</em></strong><em>: </em>How does the system know the correct data type of a variable to apply the right algorithm to detect anomalies? Is the variable an IP address, a queue length, a date-time stamp, an HTTP status code, a byte count, or something else? Knowing the data type helps in applying appropriate algorithms for detecting the variations in that variable. For example, one can apply a metric-based anomaly detection using z-score variance for variables such as queue length, and <em>byte count</em> type of variables. For a <em>counter</em> type of a variable, taking the first derivative followed z-score might be more appropriate. For HTTP status codes and IP addresses, pre-canned regular expressions can be used to do exact matches. Therefore, to apply the right kind of algorithm, one must know the data type of the variable correctly. This can be achieved either automatically or with human input. The point to note here is that this needs to be done only once for each log template. Once the data type is properly identified either automatically or with human guidance, this information can be stored and appropriate algorithms can be selected for anomaly detection. In our experience, trying to automatically detect the data type of each variable might be hard and might require too much log and system context. This is a case where asking a human for input is much more time-efficient and expeditious to accomplish the task rather than trying to guess every data type automatically. Therefore, it is critical to incorporate appropriate user interfaces to take user inputs during log parsing.</p><p>Once the log features are identified, these features can now be used for anomaly detection.</p><p><strong>Detecting anomalies from log features</strong></p><p>Any variations of these identified features from the learned normal ranges are considered anomalies. Since log data is real-time streaming data, typically, time-series algorithms are used for anomaly detection. Anomaly detection can be applied to a single variable/feature (univariate) or multiple variables/features at once (multi-variate). We list several algorithms that can be applied for anomaly detection on the time-series features.</p><p>1. <strong><em>Univariate Time-series Algorithms</em></strong>: Apply different algorithms such as Robust-bounds, Flat-line, variant/invariant, Granger, Finite Domain, Predominant Range, and Discrete Values. Several of these algorithms are implemented in IBM’s <a href="https://www.ibm.com/cloud/cloud-pak-for-watson-aiops">Cloud Pak for Watson AIOps</a> already. These algorithms are detailed further in [3].</p><p>2. <strong><em>Multi-variate Algorithms</em></strong>: Principal Component Analysis (PCA), Real-time Statistical algorithm [4], or other deep learning algorithms such as LSTM can be applied to the derived features to detect anomalies. More details on how these algorithms are implemented in <a href="https://www.ibm.com/cloud/cloud-pak-for-watson-aiops">Cloud Pak for Watson AIOps</a> are available in [6].</p><p><strong>Strategies for dealing with log volumes</strong></p><p>IT logs are expensive to process and can pose significant infrastructure requirements if the volume of logs to be processed is large (e.g., TBs of data/day). We suggest that companies be judicious about which and how many application stacks they should monitor and how to start and expand to derive insights from logs, given that log processing is infrastructure intensive. Below, we list some best practices for IT operations managers for leveraging logs in IT operations management that make economic and business sense.</p><p>1. <strong><em>Monitor IT logs of your critical customer-facing applications (tier-1) in real-time for proactive incident detection</em></strong>: Typically, tier-1 applications are the most critical applications and therefore it is recommended to use real-time log monitoring for those applications. This means that the required amount of infrastructure needs to be allocated to process logs in real-time.</p><p>2. <strong><em>Monitor IT logs of your non-critical applications (tier-2) for asynchronous near real-time proactive incident detection</em></strong><em>: </em>For tier-2 applications, near real-time detection of anomalies might be good enough. That is, if an issue were to occur, it might be acceptable to notify that issue within a few minutes rather than within seconds.</p><p>3. <strong><em>Leverage logs for incident diagnosis and explanation for non-critical internal applications (tier-3)</em></strong><em>:</em> For Tier 3 applications, instead of trying to proactively detect anomalies from terabytes of logs continuously, it might be advisable to use logs in a diagnosis use case. In the diagnosis use case, the log anomalies detector is invoked for only a subset of resources in the application stack that is identified as a probable cause for an already detected incident. The incident may have been detected using metric monitoring systems or application performance monitoring (APM) systems. In this setup, a select set of logs that correspond to a specific time window associated with the time of the incident are analyzed to detect anomalous patterns. In this approach, the log anomaly detector doesn’t take up the burden to detect anomalies and incidents in real-time on all the resources in each application context. Logs are primarily analyzed to diagnose the source of the problem for an already detected incident. This would reduce significant infrastructure investments required to process logs of all applications and infrastructure stacks and still allow SREs and CIOs to derive insights from logs for better issue diagnosis and resolution.</p><p><strong>Conclusions</strong></p><p>IT logs are an important source of information in IT operations management. However, deriving insights from logs is a hard problem because logs are not often standardized, come in many formats, and are voluminous. As a follow-up to our prior article in which we discussed <a href="https://medium.com/ibm-cloud/why-is-log-parsing-and-processing-hard-1e72bac55712">what makes log parsing hard</a> [2], in this article we presented some approaches to parsing logs effectively and preparing structured features from logs to derive useful insights from them. These features then form the basis for downstream tasks such as anomaly detection, prediction, diagnosis, and incident explanation. We also discussed some best practices for IT operations managers for dealing with large volumes of logs so that they can harvest insights from logs in an economically viable manner.</p><p><strong>References</strong></p><p>1. [Ganti R. et al 2021] Why Logs are Important? <a href="https://community.ibm.com/community/user/aiops/blogs/raghu-kiran-ganti1/2021/11/30/why-logs-are-important?CommunityKey=6e6a9ff2-b532-4fde-8011-92c922b61214">https://community.ibm.com/community/user/aiops/blogs/raghu-kiran-ganti1/2021/11/30/why-logs-are-important?CommunityKey=6e6a9ff2-b532-4fde-8011-92c922b61214</a></p><p>2. [Akkiraju et al 2022] Why is log parsing and processing hard? <a href="https://medium.com/ibm-cloud/why-is-log-parsing-and-processing-hard-1e72bac55712">https://medium.com/ibm-cloud/why-is-log-parsing-and-processing-hard-1e72bac55712</a></p><p>3. [He P et al 2017] He P., Zhe J., Zheng Z., Lyu M. Drain: <em>An online Log Parsing Approach with Fixed Depth Tree</em>. 2017 IEEE 24th International Conference on Web Services. <a href="https://jiemingzhu.github.io/pub/pjhe_icws2017.pdf">https://jiemingzhu.github.io/pub/pjhe_icws2017.pdf</a></p><p>4. [IBM Operational Analytics Predictive Insights Documentation] Time-series algorithms in IBM’s Metric Anomaly Detection Component: <a href="https://www.ibm.com/docs/en/oapi/1.3.6?topic=concepts-algorithms">https://www.ibm.com/docs/en/oapi/1.3.6?topic=concepts-algorithms</a></p><p>5. [Lu A et al 2022] Lu An, An-Jie Tu, Xiaotong Liu, Rama Akkiraju. <em>Real-time statistical log anomaly detection with continuous AIOps learning</em>. In the proceedings of the ACM International Conference on Cloud Computing and Services Science (CLOSER) 2022.</p><p>6. [Xiaotong et al 2022] AIOps Explained — Log Anomaly Detection: <a href="https://www.youtube.com/watch?v=DWkFMWi3GHY">https://www.youtube.com/watch?v=DWkFMWi3GHY</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44a4debe3746" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-cloud/harvesting-insights-from-logs-in-it-operations-management-in-an-economically-viable-manner-44a4debe3746">Harvesting insights from logs in IT Operations Management in an economically viable manner</a> was originally published in <a href="https://medium.com/ibm-cloud">IBM Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why is Log Parsing and Processing hard?]]></title>
            <link>https://medium.com/ibm-cloud/why-is-log-parsing-and-processing-hard-1e72bac55712?source=rss-8e2e1c53d1bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e72bac55712</guid>
            <category><![CDATA[log-anomaly-detection]]></category>
            <category><![CDATA[log-comprehension]]></category>
            <category><![CDATA[aiops]]></category>
            <category><![CDATA[log-parsing]]></category>
            <category><![CDATA[log-processing]]></category>
            <dc:creator><![CDATA[Rama Akkiraju]]></dc:creator>
            <pubDate>Mon, 23 May 2022 18:27:11 GMT</pubDate>
            <atom:updated>2022-05-24T07:31:36.871Z</atom:updated>
            <content:encoded><![CDATA[<p>By <strong>Rama Akkiraju, IBM Fellow, CTO AIOps and Xiaotong Liu, Manager, Senior Data Scientist, AIOps</strong></p><p><em>Following our recent post on </em><a href="https://community.ibm.com/community/user/aiops/blogs/raghu-kiran-ganti1/2021/11/30/why-logs-are-important?CommunityKey=6e6a9ff2-b532-4fde-8011-92c922b61214"><em>Why are logs important</em></a><em> [1 ], this blog explores why logs are hard to parse and process.</em></p><p>Information Technology (IT) Logs are events written by software systems during the execution of a program. Logs contain information about errors, exceptions, warnings, informational events, and other diagnostic information such as database query statements and the time an event has occurred. Logs are useful in detecting and diagnosing problems with IT systems in IT operations environments.</p><p>Log anomaly detection (LAD) aims to detect anomalous behavior in the logs produced by IT systems. Log parsing helps in extracting features from logs, which typically serve as the first step toward downstream log analysis tasks such as log templatization, log clustering, and anomaly detection. However, log parsing and processing are not easy.</p><p>In this article, we illustrate various aspects of logs that make parsing hard. In the follow-on article, we present approaches for parsing and processing them for useful insights in an economically viable manner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a11yKzQoUWiFzliWNDIBBg.jpeg" /></figure><p><strong>Log parsing — why so hard?</strong></p><p>IT application and system logs are semi-structured machine-generated data. They can come in many formats, structures, languages, and large volumes. These multi-dimensional attributes of logs pose many challenges in parsing and processing logs. In addition, if many business applications and systems are to be monitored in real-time for anomalies and application performance, then IT logs can be expensive to process. In large volumes, they can pose significant infrastructure requirements.</p><p>To better understand the complexities of log parsing, let us look at some of the challenges in parsing because of structural and format variations in logs:</p><p><strong><em>Semi-structured</em></strong>: Logs typically have structured and unstructured portions. Structured portions may include timestamps, the name of the resource that is writing the logs, hostnames, IP addresses, errors, warning codes, etc. Unstructured portions may include the log message and query statements<em>. </em><strong><em>Often, the formats of logs are not well-documented, thereby making it necessary to apply natural language processing (NLP) techniques to detect key entities.</em></strong> Deriving specific entity mentions such as hostnames, IP addresses, names of resources, time stamps, and error &amp; exception codes, which might contain useful diagnostic information, requires a reasonable semantic understanding of log messages to extract features for downstream tasks such as anomaly detection and incident explanation. Here are some examples of logs containing structured and unstructured portions.</p><p><strong><em>Varied formats</em></strong>: Logs can be written in plain text, XML, JSON, plain old java object (POJO), or any other format. Sometimes logs can have embedded JSONs within XMLs and vice versa. <strong><em>This complicates the processing of logs significantly, especially when XML and JSON structures are embedded inside each other</em></strong>. Getting to the entities needed to prepare features becomes more difficult as they get buried inside arbitrary levels and layers.</p><ul><li><em>Example 1: Log as an XML</em>: &lt;XML&gt;&lt;DATA&gt;Connecting to outbound queueSOLQXYZ.beo11.LIVE2&lt;/Data&gt;&lt;/XML&gt;</li><li><em>Example 2: Log as a JSON</em>: _line=“{\“date\”=\“20210805T1503\”, \“message\”=\“Processed the order in 23ms.\”}”</li></ul><p><strong><em>Date-time stamp variations</em></strong>: Logs don’t often follow standardized formats for Date-time stamp printing<strong><em>. Unfortunately, Some programmers might choose to write dates and times in custom formats.</em></strong> Also, for software that is part of custom-written or proprietary legacy systems, date-time stamp formats could be significantly different from the standard formats that packaged software (e.g., software middleware products such as Db2, Oracle DB, SAP software, etc.) might use. Some date-time stamp format variations are listed below. These variations pose interesting challenges for natural language processing (NLP) software that detects entities such as date and time.</p><ul><li><em>Example 1: </em>“127.0.0.6 — — [15/Sep/2021:10:48:30 +0000]”</li><li><em>Example 2: </em>“start_time=’2021–09–18T22:35:16.576677Z’,” “date”:”2021–09–18T22:48:43.982+0000&quot;</li></ul><p><strong><em>Languages (e.g. English, German, Japanese,..)</em></strong><em>:</em> Logs can be written in many natural languages depending on who wrote the software program. They can be in as many languages as the business is conducted. <strong><em>This means that the NLP software used for extracting log messages must be able to detect the language and parse it accordingly with suitable tokenizers and dependency parsers to extract features from them.</em></strong> Complicating the language support problem further, some logs are written in a mix of languages. For example, the second example below shows a log message that is a combination of German and English. Tokenization gets trickier when non-space delimited based languages are mixed space-delimited languages. For example, when English and Japanese or English and Chinese are mixed, parsing those logs gets even more complex than parsing logs written in space-delimited languages such as English and Spanish or English and German.</p><ul><li><em>Example 1: </em><strong>Double byte languages (Japanese)</strong>: ランタイム・プロビジョニング・フィーチャーが使用不可になっています。 すべてのコンポーネントが開始されます</li><li><em>Example 2: </em><strong>Mixed languages (e.g., German and English)</strong>: Das gemeldete problem ist: error serializing java object.</li></ul><p><strong><em>Poorly written logs</em></strong>: <strong><em>Sometimes logs are written poorly and in a cryptic manner.</em></strong> For example, consider the log phrase ‘POST/orders 500’. According to the subject matter expert, the number 500 in the below log implicitly meant ‘HTTP error code 500’, which is a critical error that needs to be immediately brought to the attention of an administrator. However, in the absence of the phrase ‘HTTP error’, it is virtually impossible to distinguish it from a general number 500. We would like to refer to some of them as ‘read my mind’ logs.</p><ul><li><em>Example: </em>‘POST /orders 500’ Vs.‘POST /orders HTTP error 500’</li></ul><p><strong><em>Confusing and Conflicting logs</em></strong>: Human programmers who design log messages are susceptible to making mistakes. <strong><em>When log formats are not standardized, they can design confusing and conflicting log messages.</em></strong> For example, in the below log message from one of the kernel applications, we noted all three log levels at once — info, exception, and error. This makes it difficult to discern if this is an information-oriented, error-oriented, or exception-oriented log message.</p><ul><li><em>Example</em>: “php.INFO: User Deprecated: Since symfony/http-kernel 5.3: \”Symfony\\Component\\HttpKernel\\Event\\KernelEvent::isMasterRequest()\” is deprecated, use \”isMainRequest()\” instead. {\”exception\”:\”[object] (ErrorException(code: 0): User Deprecated: Since symfony/http-kernel 5.3:”</li></ul><p><strong><em>Log volumes</em></strong>: Apart from the structure and format variations, log volumes can pose challenges in parsing as well<em>. </em><strong><em>As the number of business applications and systems that need to be monitored in real-time for anomalies increases, the volume of IT logs that need to be processed also increases, thereby posing increased infrastructure requirements.</em></strong> Sometimes, log volumes can run up to several terabytes of data per day. This increases the cost of infrastructure needed to process these logs thereby making the total cost of ownership of having a solution for log-based anomaly detection economically unattractive.</p><p><strong>Conclusion</strong></p><p>IT logs are an important source of information in IT operations management. However, deriving insights from logs is a hard problem because logs are not often standardized, come in many formats, and are voluminous. In this article, we discussed what makes log parsing hard. In the next article, we present techniques for harvesting insights from logs in an economically viable manner.</p><p><strong>Acknowledgments</strong></p><p>Thanks to our collaborators Mudhakar Srivatsa, Amitkumar Paradkar, Prateeti Mohapatra, Jae-Wook Ahn, Pooja Aggarwal, Sarasi Lalithsena, Meenakshi Madugula, Neil Boyette, Raghu Ganti, Hau-wen Chang, Jiayun Zhao, An-Jie Tu, Pujitha Kara, Ritu Singh, Keving Ng, Xiaocun Cue, Charles Wiecha, Suranjana Samantha, Amy Cu, Isaiah Kim, Wei Cheng Liu, Ragu Kattinakare, Gargi Dasgupta, Karan Karuppiah, and Rakesh Mohan.</p><p><strong>References</strong></p><ol><li>[Ganti R. et al 2021] Why Logs are Important? <a href="https://community.ibm.com/community/user/aiops/blogs/raghu-kiran-ganti1/2021/11/30/why-logs-are-important?CommunityKey=6e6a9ff2-b532-4fde-8011-92c922b61214">https://community.ibm.com/community/user/aiops/blogs/raghu-kiran-ganti1/2021/11/30/why-logs-are-important?CommunityKey=6e6a9ff2-b532-4fde-8011-92c922b61214</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e72bac55712" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-cloud/why-is-log-parsing-and-processing-hard-1e72bac55712">Why is Log Parsing and Processing hard?</a> was originally published in <a href="https://medium.com/ibm-cloud">IBM Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are we there yet? The First-Mile and Last-Mile problem with Machine Learning Models]]></title>
            <link>https://medium.com/ibm-cloud/are-we-there-yet-the-first-mile-and-last-mile-problem-with-machine-learning-models-7025ce365d73?source=rss-8e2e1c53d1bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/7025ce365d73</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[machine-learning-tools]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Rama Akkiraju]]></dc:creator>
            <pubDate>Wed, 01 Dec 2021 18:53:38 GMT</pubDate>
            <atom:updated>2021-12-01T18:53:38.480Z</atom:updated>
            <content:encoded><![CDATA[<p>by <strong>Rama Akkiraju</strong>,<em> </em>IBM Fellow, CTO AIOps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xqSwXIHmWgy-TMri4hfQVQ.jpeg" /></figure><p>In this article, I describe the first-mile and last-mile problems of machine learning models, give examples of their occurrence in a few domains, and suggest practical strategies for dealing with these problems from my experience.</p><p><strong>The first-mile and last-mile problem — an everyday example</strong></p><p>“Head north-east on Kirwin Lane and then turn left on to De Anza Blvd” suggested the mapping software on my smartphone, but I had no idea which direction was north-east. I had to guess by the direction of the sun. Thank goodness it wasn’t a cloudy day!</p><p>Finally, after 20 minutes of driving, the map lady announced that I had arrived at my destination — right in the middle of a busy three-lane road near an intersection!</p><p><em>Huh?</em></p><p>Where had I arrived? Where was that antique store I was looking for? To my right was a large shopping complex. I guessed the store I was looking for was in there somewhere. But I was not in the correct lane to make a turn. I had to miss the turn, go further, make some roundabouts to come back. Once in the complex, the map lady announced, “go north” and then immediately suggested, “go south”. <em>Ugh!</em> That was frustrating!</p><p>At this point, I turned the mapping software on my smartphone off. It was time to park the car somewhere in the parking lot and walk around or ask the nearby storekeeper for directions.</p><p>My experience that day was classic first-mile and last-mile problems. Delivery companies lose billions of dollars annually due to last-mile delivery problems because the mapping software can’t finish the task of taking drivers all the way to their destinations.</p><p><a href="https://www.ibm.com/docs/en/cloud-paks/cloud-pak-watson-aiops/3.2.0?topic=asblad-workflow">Statistical Machine Learning algorithms</a> suffer from the same first-mile and last-mile problems.</p><p><strong>The first-mile and the last-mile problems with machine learning models</strong></p><p>It is well-known that most machine learning algorithms need a lot of representative data to learn patterns in that data to make predictions. Until such representative data is made available to the machine learning algorithms, their prediction accuracy may not be accurate enough for many use cases. I call this phenomenon the <em>first-mile</em> <em>problem</em> because the system is not able to get off the ground with the desired accuracy in its prediction — in the same way, mapping software doesn’t quite know how to guide a driver to get out of an unmapped neighborhood to the nearest well-known street that is mapped by the mapping software.</p><p>Suppose we get past the first-mile problem by providing enough representative data to train a machine learning model and that it is making predictions well-enough to put it to action in specific use cases in production, soon enough, you will realize that while the model performs well for 80–85% of the cases, it starts to falter in the remaining 15–20% of the cases. These are typically corner cases where it is not practically feasible to get enough representative samples during training as by definition they occur rarely. Yet these corner cases do occur, and the model needs to be able to deal with them. This is the <em>last mile problem</em>. This is akin to the mapping software declaring that you have arrived at the destination — even though, as in my case, I was still in the middle of a three-lane road.</p><p><strong>Log Anomaly Detection: An illustrative example</strong></p><p>Let’s examine these first-mile and last-mile problems in the context of log anomaly detection, a machine learning model used to detect anomalies from IT applications and system logs as part of IT operations management.</p><p>An anomaly is something that deviates from normal, standard, or expected behavior. The goal of log anomaly detection is to detect anomalies from IT applications and system logs in real-time. These may include logs written by an application, infrastructure, network device, operating system, middleware, and everything in between. Typically, organizations set either static thresholds or manual rules to define and manage deviations from normal behavior. The problem with static thresholds is that it takes a long time for subject matter experts (SME) to distill them from their experience and to create them. Moreover, these static thresholds don’t easily adapt to changes and, therefore, tend to get outdated and become irrelevant quickly. Therefore, it is better to use machine learning models to detect anomalies from logs.</p><p>Machine learning models are good at learning patterns. When faced with an anomalous pattern of log messages that do not conform to the normal pattern that has been learned, a machine learning model can raise an anomaly. This relieves organizations of the need to create and manage static thresholds or to rely on SMEs to write rules for every possible anomalous condition, which might be hard to do.</p><p><strong>First-mile problems</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/0*Z_mbLj0R0dfXNFyM" /></figure><p>Many techniques have been implemented for log anomaly detection (after converting the unstructured logs into structured features via log parsing) such as ARIMA, Seasonal ARIMA, XGBoost, Exponential Smoothing, Principal Component Analysis (PCA), and other deep-learning algorithms like LSTM. Many of these techniques still require ‘normal’ data to learn the patterns from. The challenge is in collecting representative normal data without human intervention in a reasonable amount of time. Not all IT environments are guaranteed to produce representative data in the first few minutes of turning an algorithm on. Till the model sees enough variations, seasonality, and other patterns, the model’s baseline is not stable. Predictions made during that time tend to be not quite accurate — like how the mapping software keeps saying ‘go north … go south’ almost at the same time. Essentially, the model is still adjusting and getting its bearings, and establishing a baseline during this time. This is the first-mile problem. When faced with this type of first-mile problem, it is best to enable continuous learning mechanisms so that the model can learn fast with customer data, in a customer environment. Below I share a few other strategies to better deal with the first-mile problem with machine learning models.</p><p><strong>Strategies for dealing with the first-mile problem</strong></p><ol><li><em>Build a broad-based base model</em>: Whenever possible, try to build a good base model with as much representative data as can be obtained. These can be considered as ‘base models’. Accuracy of these services usually ranges from, say, 75%-85% accuracy (+/- 5%-10%). Enriching these base models is a continuous activity involving collecting, cleansing, training, and fine-tuning the model. For example, in the case of log anomaly detection, a base model can be built with a week’s or month’s worth of historic log data. This model can get you 75–85% of the way. Often, even this historic data fails to capture the variations triggered by user loads, seasonality, and other factors well-enough to learn the patterns reliably. That’s why the ability to customize these base models and continuously improve them becomes critical to achieving the desired levels of accuracy.</li><li><em>Enable Model Customization: </em>Model customization is needed either when good-enough base models cannot be built ahead due to the special nature of the data (e.g. anomaly prediction in IT system logs for proprietary applications) or when the base model that is built using general-purpose data does not scale well for company-specific environments (e.g. general purpose Chatbots may not scale well for special drive-in menu order taking chatbot). By exposing the APIs for the machine learning model to be customized, you make it easy for the model to take-in external data beyond the data with which it has been trained initially for on-the-field training. Model customization is the mechanism by which continuous learning happens.</li><li><em>Enable Continuous Learning</em>: Enabling hooks for continuous learning is a must for any machine learning model for multiple reasons, either because the initial training data is insufficient and must be augmented or customized or because the model needs to stay fresh to reflect the changing input data patterns or for other reasons. Necessary mechanisms for automatically retraining the models with new data is a critical aspect of deploying machine learning models, especially to address the first-mile problem.</li><li><em>Human AI-authoring &amp; Feedback</em>: Enable subject matter experts (SMEs) to guide various aspects of prediction tasks including data selection, data preparation, annotations of unknown patterns/templates/samples to expedite learning. This is, in essence, the human authoring of AI. There is no shame in doing this and in fact, is the best way to bootstrap the models and get them going in the right direction. It’s like asking a local person for directions to get on the nearest known main street when you get lost. It works! After all, you want the job to get done rather than sitting on a high tower of full automation. SMEs can further accelerate learning by giving regular feedback to the models using which the models can learn continuously.</li><li><em>Have realistic expectations:</em> Machine learning models can’t do magic. Having realistic expectations goes a long way in avoiding early and premature disappointments with technology that can improve over time with the right feedback and more representative data. After all, often, you know the way to the nearest street that is mapped on the map software. So, if the map software gets it wrong, you use your in-built sense of orientation to get going till you can have the map software guide you better. That is, treat the initial model to be an intern-in-training until enough representative data can be collected to improve the accuracy of the model.</li></ol><p><strong>Last-mile problems</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*jiSg1es73pvTWTGW" /></figure><p>Continuing the log anomaly prediction problem as an example to illustrate first-mile and last-mile problems with machine learning models, let’s examine how the last-mile problem manifests. Say that you have built a good anomaly prediction model, did all the right things to get past the first-mile problem, achieved desired prediction accuracy, and deployed the model in production. Even so, the model might make mistakes every so often because of the infrequently occurring long-tail type of scenarios. For example, seasonality that occurs once in a year, or maintenance periods that trigger different behaviors of IT systems may confuse the model and may lead to inaccurate predictions. These are examples of the last-mile problem. In such cases, the best course of action might be to write a rule to deal with seasonality and maintenance windows. It takes too long, too much data, and too many repetitions of data for the model to learn these types of patterns. It is much easier to deal with these types of patterns via rules. Here are a few other strategies to better deal with the last-mile problem with machine learning models.</p><p><strong>Strategies for dealing with the last-mile problem</strong></p><ol><li><em>Develop good test datasets with accurate ground truth:</em> How does one know that there is a last-mile problem or model accuracy prediction problem? Well, one must develop good test datasets with accurate ground truth to first identify that there is a prediction problem. In some domains, there could be a lot of gray areas in the ground truth. What might be an anomaly for one may not be one for the other. For example, in the sentiment prediction problem domain, what might be a negative sentiment statement could be a neutral statement for another. So, establishing accurate ground truth is critical to identifying the model’s weakness.</li><li><em>Perform Error Analysis: </em>Once the areas of the model’s weaknesses are identified, it is important to perform systematic error analysis. If possible, classify the errors manually or automatically, understand the source of errors, and have different strategies for fixing each error as needed<em>.</em></li><li><em>Augment training data, if possible</em>: If you know the exact patterns of mistakes, see if it is possible to collect more samples in those specific areas to augment the training data. Sometimes, this may not be possible if the errors are caused by corner cases that don’t occur that frequently.</li><li><em>Log payload &amp; continuously learn</em>: Whenever possible and privacy policies allow for it, log the input data of the machine learning model. Correlate the input data with the timing and error analysis to identify the input samples upon which the model is making prediction errors. This data needs to be annotated by the SMEs to correct the machine learning model’s weaknesses in the next iteration of learning.</li><li><em>Short-circuit learning with rules or micro-models</em>: Often, the best way to deal with corner cases is by adding rules or by building targeted micro-models. Gathering enough samples of rarely occurring cases to teach the system might take too long and is not guaranteed to happen in a reasonable amount of time. Moreover, if you know the specific corner cases where the model is making mistakes, you already know the patterns. So, it’s much simpler to write a rule for these patterns than to collect many examples of that pattern to let the model learn the same rule that you already know. For example, in the anomaly prediction domain, what might be a high severity anomaly might not be as distinguishable from a low severity anomaly without further context. Whether an anomaly should be treated as an incident may depend on external factors such as how many times the problem occurs (i.e., error rate), how many other incidents have occurred this month, whether these incidents violate service level objectives or not, etc. These are best dealt with via post-processing rules. Also, sometimes, micro-models can be developed for targeted long-tail cases.</li></ol><p><strong>Conclusion</strong></p><p>Machine learning models are susceptible to first-mile and last-mile problems similar to what happens with mapping software. Effectively dealing with the first-mile and the last-mile problem needs purposeful data collection, preparation, planning, diligent error analysis, and subject matter expert input and guidance. By working together humans and machines can co-create effective machine learning models.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7025ce365d73" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-cloud/are-we-there-yet-the-first-mile-and-last-mile-problem-with-machine-learning-models-7025ce365d73">Are we there yet? The First-Mile and Last-Mile problem with Machine Learning Models</a> was originally published in <a href="https://medium.com/ibm-cloud">IBM Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Watson AIOps: AI for IT Operations Management]]></title>
            <link>https://medium.com/ibm-watson/watson-aiops-ai-for-it-operations-management-c6565906c3e8?source=rss-8e2e1c53d1bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6565906c3e8</guid>
            <category><![CDATA[ai-for-it]]></category>
            <category><![CDATA[it-operations-management]]></category>
            <category><![CDATA[aiops]]></category>
            <category><![CDATA[watson-aiops]]></category>
            <category><![CDATA[ai-for-it-operations]]></category>
            <dc:creator><![CDATA[Rama Akkiraju]]></dc:creator>
            <pubDate>Wed, 05 Aug 2020 20:19:01 GMT</pubDate>
            <atom:updated>2020-08-06T00:41:59.712Z</atom:updated>
            <content:encoded><![CDATA[<p>At first, there were distributed computing systems, next, there were fault-tolerant systems, then, autonomic computing, and now, AI Operations. Someone once said that there is nothing new in Computer Science and that the same concepts keep coming back every few years. It’s like old wine being served in a new bottle!</p><p>Is it really? While the concepts and the vision for all these topics are the same, which is to have computer systems that are capable of self-management, the mechanisms, the means, and the standardization needed to achieve that vision fully are only coming in place now. Technologies such as Cloud computing, micro-service architectures, containerized software development such as docker and open-source container orchestration systems (e.g. Kubernetes) for automating computer application deployment, scaling, and management are all making it possible to have the necessary levels of abstractions needed to scale the self-management implementations. Even if the applications that are being managed themselves have not yet made their way to Cloud, the fact that the operations management solution can scale by building as containerized software managed by Kubernetes makes the solution more readily scalable to multiple environments. Also, the rise of Artificial Intelligence (AI) powered by the advancements in hardware architectures, Cloud computing, natural language processing (NLP) via language models such as BERT, and advancements in machine learning (ML) via deep learning (DL) algorithms and frameworks such as (Tensorflow, Pytorch) and deep neural network architecture optimization frameworks (such as Katib), has opened up new opportunities for optimizing business processes in various industries. Operations management of IT systems is one such an area that is prime for optimization. By leveraging the advancements in AI and Cloud computing we can now set out to achieve the vision of self-managing computer systems. That’s where AI for IT Operations management aka AIOps comes into the picture.</p><p>Information Technology (IT) Operations management is a vexing problem for most companies that rely on IT systems for mission-critical business applications. Despite the best intentions of engineers, good designs, and solid development practices, software and hardware systems deployed in companies in service of critical business applications are susceptible to outages, resulting in millions of dollars in labor, revenue loss, and customer satisfaction issues, each year. The best of the analytical tools fall short. This can be attributed to the complexity of the problem at hand. IT applications, the infrastructure that they run on, and the networking systems that support that infrastructure — all produce large amounts of structured and unstructured data in the form of logs and metrics. The volume and the variety of data generated in real-time poses significant challenges for analytical tools in processing them for detecting genuine anomalies, correlating disparate signals from multiple sources, and raising only those alerts that need IT operations management teams’ attention. To add to this, data volumes continue to grow rapidly as companies move to modular micro-services-based architectures, further compounding the problem.</p><p>AI can help solve these problems. AI can help IT operations management personnel/Site Reliability Engineers (SREs) in detecting issues early, predicting them before they occur, reduce event &amp; alert noise by grouping events/alerts related to same incidents, locating the specific application or infrastructure component that is the source of the issue, determining the scope of incident impact, and recommending relevant and timely actions based on mining prior incident records. All these analytics help reduce the meantime to detect an incident (MTTD) and mean time to identify/isolate the cause of an incident (MTTI) and therefore, mean time to resolve (MTTR) an incident. This, in turn, saves millions of dollars by preventing direct costs (lost revenue, penalties, opportunity costs, etc.) and indirect costs (customer dissatisfaction, lost customers, and lost references, etc.). Below, we describe the AI in our Watson AIOps solution.</p><p>The IT operations environment generates many kinds of data. These include metrics, alerts, events, logs, tickets, application and infrastructure topology, deployment configurations, and chat conversations. Of these, metrics tend to be structured in nature while logs, alerts, and events are semi-structured, and the content in tickets and chat conversations tends to be unstructured. Also, among all the data types, logs and metrics sometimes can be leading indicators of problems, while alerts, tickets and chat conversations tend to be lagging indicators. An advanced IT operations management system can take all of this data as inputs, detect incidents early, predict when incidents may occur, offer timely and relevant guidance on how to resolve incidents quickly and efficiently, automatically apply resolutions when applicable, and proactively avoid them from recurring by enforcing the required feedback loops into the various software development lifecycles. This can increase the productivity of IT operations personnel or Site Reliability Engineers (SREs) and thereby improve the mean times to detect, identify, and resolve incidents.</p><p>Enter Watson AIOps into the picture. It does exactly that!</p><p>IBM already has strong products in the market for event management, topology management, and metric-based anomaly prediction via Netcool Operations Manager product. These capabilities draw insights from alerts, events, and metrics. Building on these strong foundations, we have introduced Watson AIOps 1.0 in June 2020 that brings together insights from both structured and unstructured data types. Watson AIOps included anomaly prediction from logs, potential problem identification feature via fault localization analysis on topology, evidence and explanations to understand the problem, incident impact radius analysis to determine the scope of impact, and problem resolution suggestion via prior similar incident analysis. In Watson AIOps, insights such as anomaly prediction, the grouping of events, the probable cause of the incident, and next-best-action recommendations are all delivered in a ChatOps environment, such as Slack, a place where IT operations management personnel or Site Reliability Engineers (SREs) work.</p><p>With Watson AIOps for Cloud Pak for Data 2.0, we are bringing these capabilities even closer together as shown in Figure 1. Broadly speaking, Watson AIOps solution capabilities can be organized into event management, incident diagnosis, incident resolution, and insights delivery categories. These capabilities are supported by an ecosystem of connectors and platform capabilities to manage the AI model training, their lifecycle for improvements, etc. Below, we give a brief view of each of these capabilities whose overall flow is highlighted in Figure 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*Z60tPc06tBYrM1mgXSSQHw.jpeg" /><figcaption>Figure 1: Watson AIOps for Cloud Pak for Data 2.0 Components.</figcaption></figure><p><strong>Event Management</strong></p><p>An event indicates that something that is noteworthy has happened in an IT operations environment. For example, an application has become unavailable or disk is full or disk reaching capacity, etc. Event management is the process that monitors and manages all events that occur through a business application or IT infrastructure. Event management involves event collection, event classification, event normalization, deduplication, event enrichment for analytics, event correlation, and event grouping either via manual rules or via automated means. The main goal of event management is not only to keep a record and manage the events but also to provide insights on those events that need operator attention either because they are likely to turn into major incidents or are already major incidents and action must be taken. The goal of event grouping, classification, and deduplication is to reduce the noise for IT operations managers and to help them focus on a few important events that need their immediate attention. Event Manager in Watson AIOps 2.0 offers all of the event management capabilities noted above. The AI Manager complements to this event grouping via entity-based correlation of events. The entity-based event grouping extracts entities, i.e., mentions of application and infrastructure component names that are referenceable via topology and correlates them to further inform the event grouping. These entity-mentions also help in isolating the faulty components, and in determining the incident impact scope as well.</p><p>In Watson AIOps 2.0 we bring together the capability to group events generated from structured, semi-structured, and unstructured data types. These include anomalies detected from metrics, logs, and tickets themselves respectively. We use multiple algorithms such as Temporal, Spatial, and Association Rule mining algorithms in Watson AIOps for event grouping.</p><p><strong>Static and Dynamic Topology Management</strong></p><p>Application and network topology refers to a map or a diagram that lays out the connections between different mission-critical applications in an enterprise. Static topology refers to a map that is constructed based on the build and deploys information on applications and infrastructure components. Dynamic topology, on the other hand, refers to a dynamic map that captures the resources and their relationships as the environment changes at run-time and provides near-real-time visibility of the same. Another important aspect of a dynamic topology is the ability to compare the current topology with a historical one. Real-time and historical views of the environment give answers to “What happened” &amp; “What’s happening”, and to know the details that led up to an incident and see the topology (and status) changes over time. Watson AIOps’ Topology functionality is offered via Agile Service Manager. It supports observation and discovery of the application and infrastructure dependencies, regardless of type, vendor, or source. Topology Manager also supports cross-layer application and infrastructure dependency mapping where the information originates from distinct, disjoint sources of truth so that the solution provides a comprehensive application and infrastructure dependency mapping up and down the stack. This topology functionality is intimately integrated with AI Manager and is leveraged in entity-correlation based event grouping, and in faulty component visualization and fault impact radius estimation.</p><p><strong>Incident diagnosis: </strong>Incident diagnosis involves identifying incidents early via anomaly prediction, isolating the faulty component, and determining the impact scope. Watson AIOps offers all of these capabilities. We examine them below briefly.</p><p><strong>Anomaly prediction:</strong></p><p>The goal of anomaly detection and prediction is to detect anomalies from logs and metrics. An anomaly is something that deviates from normal, standard, or expected behavior. Typically, organizations set either static thresholds or manual rules to define and manage deviations from normal behavior. These rules are usually set on log aggregation systems (such as LogDNA, Splunk, etc.) and metric monitoring systems (such as SysDig, Prometheus, etc.). The problem with status thresholds is that first, it takes a long time for subject matter experts (SME) to distill them from their experience and to create them and second, they don’t adapt to changes and therefore, tend to get outdated and irrelevant quickly. If not, updated or deleted, these manual rule-based anomalies can start to flood SREs with irrelevant alerts. In our experience, approximately, 30% of these threshold events are never actioned! Operations teams waste time and effort in managing these thresholds and end up missing important clues. Therefore, learning what is normal, baselining it, and using it to automatically detect anomalies can free up SME time from having to manually manage these rules. Watson AIOps offers anomaly detection from both metrics and logs.</p><p>· <em>Log Anomaly prediction</em>: IBM’s Watson AIOps’ state-of-the-art and multi patent-pending log anomaly detection technology, available in AI Manager, is capable of automatically parsing IT application and infrastructure logs from log aggregation tools such as LogDNA, automatically learning normal log patterns from training data, understanding their semantic meaning, and detecting anomalies in real-time much sooner than traditional thresholding-based or error-string-matching type of alerting techniques can, thereby significantly reducing the meant time to diagnose an incident. We use deep-learning algorithms to both prepare features from logs during log parsing and to make anomaly predictions. Users don’t have to set static thresholds or manual rules to detect anomalies. The system will automatically detect these anomalies. The obtained anomalous results are then explained with back pointers to specific log messages in which anomalies were noted. We have applied this log anomaly detection system to an IBM’s own CIO office run internal field management application for sellers to track their incentives. In a specific test we did, by analyzing the Apache server logs, we were able to detect anomalies up to 20 hours on an average across five different major incidents, before a human opened incident tickets. In this experiment, training was done on one week&#39;s worth of aggregated access and error logs to represent normal or no major impact on business. Major incidents corresponding to these anomalies were not detected by any rules or existing thresholds and hence were missed till a major incident actually occurred and an IT operations management person created a ticket for these.</p><p>· <em>Metric Anomaly prediction</em>: Watson AIOps metric-based anomaly detection, available in Metric Manager, analyzes metrics data from various systems such as New Relic, AppDynamics, and SolarWinds, etc., to automatically learn the normal behavior of metrics in your company and automatically detects anomalies from metrics. It employs a set of time-tested time-series algorithms such as Granger Causality, Robust Bounds, Variant/Invariant, Finite Domain and Predominant Range, etc. to capture seasonality, significant trends and do perform forecasting. Many metrics are seasonal. For example, what is normal for the metric pattern at 2 pm in a time zone may not be the same normal for metrics at 10 pm in that same time zone. Therefore, taking seasonality of a particular environment is critical to accurately predicting anomalies. The Metric Manager in Watson AIOps is equipped to do this. In a specific evaluation scenario, our metric anomaly predictor caught the problem two days before a server stopped collecting data and was rebooted as a result. In another evaluation scenario, our solution was able to detect memory leaks five days before the memory maxed out on the server and prevented an outage.</p><p><strong>Fault Localization &amp; Blast Radius</strong></p><p>Entity mentions are the names of the resources (e.g. service or application component names, server names, server IP addresses, pod ids, node ids, etc.) that are referenced in anomalous logs, alerts, tickets, and events. Once events are grouped and the entity mentions in anomalies, alerts and events are extracted, we perform entity resolution with topological resources to isolate the problem and to place the identified entities on the corresponding dynamic topology instances that match the time at which the mentions were noted. This enables us to map identified faults on topology. Traversing the topological graph in the application, infrastructure, and network layers enables us to map out the impacted components.</p><p><strong>Incident resolution</strong></p><p>Watson AIOps ingests and mines prior ticket data to provide timely and relevant action recommendations for the currently diagnosed problem at hand. Current incident symptoms are framed as a query to the indexed ticket data to not only search and retrieve top <em>k</em> relevant prior incident records but also important entity-action (aka noun-verb) phrases are extracted from each relevant record to make it easy for SREs to get a quick glimpse of the suggested action. For example, from a long chat conversation that is pasted inside the ‘closing comments’ section of an incident record, we extract phrases such as ‘Scaled Compose data node’, ‘Restarted Analytics pods’. In the first phrase, ‘Compose data node’ is the entity and ‘scaled’ is the action. In the second phrase, ‘Analytics pods’ is the entity, and ‘restarted’ is the action. We apply various natural language processing techniques to extract entity and action phrases including rule-based systems.</p><p><strong>Insights Delivery and Action Implementation</strong></p><p>In Watson AIOps, all of the insights described above are delivered both via ChatOps and dashboards. Real-time, in the moment insights, are delivered via ChatOps to SREs directly in the place where they work. Within ChatOps, there is functionality to interact and share selected incident resolution suggestions with other collaborators, in addition to exploring the evidence of the insights. From ChatOps, SREs can launch log, metric, and ticket monitoring tools to explore further details. Similarly, SREs can launch interactive dashboards powered by Event Manager, Metric Manager, and Topology features for detailed exploration of events, event groups, metric anomalies, and topology. Applicable actions/runbooks can then be automatically run via Runbook execution.</p><p><strong>Quality Evaluations</strong></p><p>Capabilities such as Event Manager, Metrics Manager, and Topology are already fielded in many clients’ environments. Therefore, we focused our performance evaluations on the new AI-infuse capabilities offered through AI Manager. We applied Watson AIOps analytical pipelines to various internal IBM applications and services to test-drive some of the latest feature functions in AI Manager. We also tested some of the newer AI capabilities such as log anomaly predictor, entity-linking based event grouping, and incident similarity capabilities on some of our clients as part of the beta testing the product. Our results indicate that we achieve significant reductions in the meantime to diagnose and mean time to resolve incidents. In some instances, we detected anomalies 20 hours ahead of a human creating a ticket, in other cases, we have reduced mean time to resolve incidents from 6 hours to less than 15 minutes. We are excited about the time and cost savings we are set to deliver to our clients.</p><p><strong>A note on AI model life-cycle management</strong></p><p>The AI models in Watson AIOps are unsupervised machine learning models. They don’t need labeled data but they do need data to learn the normal behavior of metrics and logs and to index and analyze prior incident ticket records. Therefore, Watson AIOps takes a representative set of metrics, logs, and ticket data for training and building models. Watson AIOps models are set up to learn continuously using up-to-date data from your environment and to improve based on user feedback. Watson AIOps is not a black box AI-infuse solution. We believe in full transparency of the inner workings of our AI models. While Watson AIOps is set up to automatically retrain the models at regular intervals, IT operations administrators have access to our model (re)train scripts and can execute model retrain on demand at any time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*V_QncaA7Y23YFPAZYZtLNA.jpeg" /><figcaption>Figure 2: Watson AIOps at a glance</figcaption></figure><p><strong>What’s next for Watson AIOps?</strong></p><p>While we plan to continue to enrich the various AI pipelines mentioned in this article continuously in Watson AIOps, we are excited to bring together the enterprise-grade event management, predictive insights, and dynamic application topology management capabilities that you are already familiar with from Netcool Operations Insights portfolio with the latest AI-infuse machine learning and natural language processing capabilities to mine the unstructured data sources such as tickets, logs, and chats to offer an unparalleled IT operations management solution for our customers. We are looking forward to expanding our ecosystem of input connectors by integrating with various log, metric, and ticketing vendor products in the remainder of 2020 in an effort to bring out-of-the-box value to our customers. Netcool Operations Insights already offers more than 150+ connectors to various open-source and vendor tools. We look forward to bringing them all together in Watson AIOps onto a single stack and to further expanding this set in 2020. Similarly, on the output front, we are expanding ChatOps platforms from Slack to Microsoft Teams and other platforms. We believe in delivering insights where SREs work, which increasingly is noted as ChatOps environments. So, we will continue to invest in improving our user experience and explanations within ChatOps. However, we do realize the value of rich dashboards that offer interactive what-if analysis exploration, decision support, and off-line analysis of what has happened. Therefore, throughout the rest of 2020 and beyond we will continue to bring these user interfaces together to allow for users to seamlessly traverse both to derive the insights they need and to perform the actions they need to perform.</p><p>Furthermore, in the next generations of our Watson AIOps solution, we envision, self-aware and autonomic IT operations environments that not only shift-left in development-security-operations (DevSecOps) life cycles to influence <em>deployment</em>, <em>test</em>, <em>build</em>, <em>code</em> and <em>design</em> processes but also close the loops with <em>operations</em> phase with feedforward and feedback mechanisms. By doing so, we intend to fully equip each stage in the DevSecOps life cycle with full foresight, hindsight which enables intelligent, and consequence-aware decision-making at each stage. Our vision for shifting-left in DevSecOps life cycle, while closing the loops virtuous feedback and feedforward cycles for efficient operations management is shown in Figure 3. We envision various stages of IT application development processes to be equipped with the smarts to proactively avoid issues from happening at run-time by not advancing IT application artifacts that do not meet the preset quality criteria to the next stage. For example, smart checks and gates prevent risky deployments from getting pushed to production, stop under-tested code modules from getting into deployment phases, and block code with risky security vulnerabilities from getting to the deployment phase and so on. We envision Watson AIOps solution to correlate past incidents with root causes that could be traced to under-tested deployment changes, security vulnerabilities, poor code test coverage, and such. This information, when fed back, serves as a critical input to reinforcing the checks and gates in the earlier stages of DevSecOps life cycle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*SM6bPMYThbOaiGzH1VY9tQ.jpeg" /><figcaption>Figure 3: Shifting-left in DevSecOps life cycle while closing the loops virtuous feedback and feedforward cycles for efficient operations management</figcaption></figure><p>So, after all, we do a comeback full circle to fault-tolerant, autonomic distributed systems with Watson AIOps. It’s just that this time around, we have the compute powered by Cloud Computing, the state-of-the-art AI algorithms, thanks to the advances in Machine Learning and Natural Language Processing, standardized platforms for building scalable management systems via Docker, Kubernetes, and standardized data and AI management platform to build solutions powered by IBM’s Cloud Paks. To add to this, we have a wealth of IT operations management experience at IBM from having managed IT systems and infrastructure for our customers via various strategic outsourcing engagements and have the depth of product experience with our Netcool suite of products that have been in the market for over twenty years. We are bringing them all together with a vision toward optimizing IT operations management, not just in a reactive mode but to avoid issues from happening in the first place by designing the DevSecOps lifecycle activities for efficient operations right from the get-go. We can’t wait to shape the future and take you all with us, on this journey!</p><p><strong>Acknowledgments</strong></p><p>A big shout out to all the global cross-organizational leaders and team members of IBM’s Watson AIOps team for all their wonderful contributions! You know who you are! There are too many to list here. Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6565906c3e8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-watson/watson-aiops-ai-for-it-operations-management-c6565906c3e8">Watson AIOps: AI for IT Operations Management</a> was originally published in <a href="https://medium.com/ibm-watson">IBM watsonx Assistant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Artificial Intelligence (AI) Service and Solution Development Methodology for Enterprises — Part 3]]></title>
            <link>https://medium.com/@rama.akkiraju/artificial-intelligence-ai-service-and-solution-development-methodology-for-enterprises-part-2-2d48a97e8855?source=rss-8e2e1c53d1bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d48a97e8855</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-methodology]]></category>
            <category><![CDATA[editorials]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ibm-watson]]></category>
            <dc:creator><![CDATA[Rama Akkiraju]]></dc:creator>
            <pubDate>Sun, 17 Jun 2018 22:48:26 GMT</pubDate>
            <atom:updated>2018-06-17T23:12:56.550Z</atom:updated>
            <content:encoded><![CDATA[<p>In the previous articles, I discussed:</p><p>1) <a href="https://www.linkedin.com/pulse/what-does-mean-build-manage-machine-learning-services-rama-akkiraju/">What it means to build machine learning services</a>, and</p><p>2) <a href="https://medium.com/@rama.akkiraju/declare-your-biases-e60647f9ed08">How to deal with biases in AI models</a></p><p>In this article, I will discuss an approach to building machine learning/ AI services and solutions for the enterprises.</p><p>Software and Services development has gone through various phases of maturity in the past decades and the community has come up with lifecycle management theories and practices to disseminate best practices to developers, companies and consultants alike. For example, in software field, Capability Maturity Model (CMM), Software Development Life Cycle (SDLC) Management, Application Life Cycle Management (ALM), Product Life Cycle Management (PLM) models prescribe theories and practical guidance for developing software products. Information Technology Infrastructure Library (ITIL) organization presents a set of detailed practices for IT Services management (ITSM) by aligning IT services with business objectives. All these practices provide useful guidance to developers for building software and services assets systematically. Are these models going to be helpful when building AI services as well in this new cognitive era? In this article, I’d argue that there is a need for developing AI Services lifecycle management methodology (AISLM).</p><p>Now that we are well into Cognitive-era or AI-era, where developers are actively building cognitive/AI applications (e.g.: chat bots, personal digital assistants, doctors assistants, radiology assistants, legal assistants, health and wellness coaches etc.) using AI building block services such as Conversation service, Speech-to-Text Service, Text-to-Speech service, Image Recognition Service, and Natural Language Understanding services (such as Sentiment, Emotion and Tone Analysis services, Concepts and Entity Recognition services etc.), I am convinced that we need to develop best practices around building AI applications and AI services as well. In this blog series, I will present my thoughts on the areas where we must evolve best practices for building AI services and AI applications. Along the way, I will share some of the practices that are working well for us. Hopefully, we can have a good debate over these topics and evolve good practices for AI Service Life Cycle Management (AISLM) and AI Application Life Cycle management (AIALM) overtime! Well, there they are! That’s two more acronyms for us to remember!</p><p>In the last article, I have already discussed <a href="https://www.linkedin.com/pulse/what-does-mean-build-manage-machine-learning-services-rama-akkiraju/">the similarities and differences between building traditional software-as-a-service application development and Machine learnt services</a>. Building on those ideas, in this article, I present a point-of-view on AI Service Life Cycle Management and best practices for scaling AI Operations.</p><p>First, let me introduce what we mean by AI Service Lifecycle management, AI Operations and why one cares to scale AI Operations.</p><p><strong>Four Stages of AI Service Development for Enterprises</strong></p><p>We argue that a typical AI service development should go through four stages of development before becoming useful and viable for a particular customer and a user:</p><p><em>1) Base model development and enrichment</em></p><p><em>2) Industry/Domain adaptation and</em></p><p><em>3) Customer adaptation</em></p><p><em>4) User adaptation</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*oFQz460_IUJvbLAh70fZhA.png" /><figcaption>Four-layered AI development model for Enterprises</figcaption></figure><p>While the base model provides the foundations for an AI service, industry/domain adaptation and customer adaptation pave the way for achieving market viability of AI models. Why so? If we don’t partition the problem space, it is too huge! It is everything under the sun! Imagine trying to build an English Speech-to-text AI service that can understand all types of English accents (American, UK, Australian, African, Russian, Indian, Chinese etc.), can understand all industries’ vocabularies and all use cases in those industries! In addition, when you take that model to a particular company, it has to work right off without any fine tuning! That is not possible today without unlimited budgets and data access! The problem space is too huge! The amount of data needed to train such a large system is too much, takes too long to acquire it, takes too much budgets that AI Service development companies can’t afford! In essence, trying to be the best in everything and best for everyone is too costly! Narrow the problem and you may have a better chance! Let’s take a look at what we mean.</p><p>1) <em>Base model development and enrichment</em>: A base model is what an AI service vendor typically prepares and makes available as a service in the general domain. For example, general purpose AI services like sentiment analyzer, speech-to-text, and image recognition services are typically trained using domain independent data. These base models are built to have broad coverage and are trained with data from multiple and diverse publicly available or licensed data sources to ensure broad coverage. The advantages offered by these base models is that they can get developers/companies started on any dataset and they provide average-to-good accuracy depending on the type of data. These can be considered as ‘base models’ Accuracy of these services usually ranges from, say, 75%-85% accuracy give or take +/- 5%-10%. Enriching these base models is a continuous activity involving collecting, cleansing and preparing more diverse training data, including payload data from the service invocations and fine tuning the model parameters to put out better models. We call this base model development and enrichment process.</p><p>2) <em>Domain adaptation</em>: While the base models are necessary, often, they are insufficient to get the job done when tested on specific domains. For example, Speech-Text service that is trained on broadcast news may not work well on speech samples from banking and insurance domains as there aren’t just enough occurrences of specialized words and their pronunciations in the base training data. Similarly, a Tone Analyzer service trained on general purpose data like Twitter Tweets, blogs, and news articles may not perform well when applied to customer support domain. As a specific example, take a look at the sentence, ‘I got a ticket’. It could be perceived as a<em> sad</em> statement by the base model because getting a ticket is usually associated with a ticket that one gets when one violates rules of the road. Since a ticket often comes with a fine one has to pay for driving violation, it considered a sad event in one’s life. Whereas in Customer care domain ‘getting a ticket’ is a common first step to opening a problem report. It should be a neutral statement in Customer care domain. As you can see, the same sentence ‘I got a ticket’ should be classified as a <em>neutral</em> tone statement in Customer support domain while it should be classified as a <em>sad</em> tone in general purpose domains. So, essentially, the models need to be adapted to the domains that they are expected to work on. In order to make this happen, one must train a domain-specific model. This can be done by mixing a good chunk of the base model data with domain specific data and rebuilding a new model by adjusting the model parameters. This is how AI vendors can make available domain specific services. For instance, a Speech-to-Text service trained to recognize Australian accent and able to decode banking terms to meet the needs of banking clients in Australia or a Tone Analyzer service trained to better understand the sensibilities in customer care domain are examples of domain adapted versions of Speech-to-Text and Tone Analyzer services respectively.</p><p>3) <em>Customer adaptation</em>: Often, even the domain adapted models aren’t sufficient enough to perform at the levels of accuracy needed in Enterprises. Each company has its own vocabulary, policies, business processes, products, offers and terminology. When building cognitive applications companies would like the AI services that they use to build their applications to understand their own specific company’s domain better. For instance, an insurance company may want the Speech-To-Text service to recognize the specific plans that their company offers such as ‘ABC Inc’s insurance plan’. Similarly, a company may like Tone Analyzer to be further adapted to their domain. For example, if a customer is asking for a quote on ABC Inc’s insurance plan, ABC company may consider it as an excited/joyful tone as the customer is showing interest about their plan. Under normal circumstances, a general purpose/base model would have treated such sentences as <em>neutral</em> in tone whereas a customer may want to override that by teaching the model to classify such statements as <em>excited</em> to suit their domain better.</p><p>4) <em>User modeling and adaptation</em>: Last but not least, in some domains and companies, further personalization of models might be needed. For example, in retail industry, user clicks, interests, preferences are gathered through various means and user models are built to further personalize and customize interactions specifically for individual users. This will make the interactions further personalized and more relevant for individuals. User models can be constructed with user consent, from social media data, Web click data, and other transactional data sources. A more detailed view on user modeling for personalizing interactions is available in this talk I gave in 2017 <a href="https://www.youtube.com/watch?v=MlDcMyPZfIU&amp;t=3s.">https://www.youtube.com/watch?v=MlDcMyPZfIU&amp;t=3s.</a></p><p>The key takeaway from understanding this four layered AI service development model is to have clarity on the purpose of the AI Service. Which market is the AI Service supposed to do well in? Base/Industry/Customer/User? Trying to be the best in everything and for everyone might be too costly and too hard! The key insight is to narrow the problem to achieve desired results. For example, Google recently announced very special purpose chat bots for making restaurant appointments. They chose such a narrow domain to show success because that is the only way to perform at the levels of accuracy that is needed, presently with the state-of-the-art.</p><p><strong>Learning accelerates when you narrow the domains</strong></p><p>You might ask, how does narrowing the domains help achieve better accuracy of the models? Well, let’s take a look at the learning curves below. A learning curve plots the performance of an AI model as the training data size increases. Typically, the more the training data, the higher the accuracy! (there are exceptions but for now, go with me on this one please!). Depending on the type of service involved, achieving higher levels of accuracy might need large amounts of training data. However, by narrowing the domains, we can ride different learning curves that helps us get to the desired levels of accuracy faster with smaller amounts of data. We can scale from building credible base models, to market viable industry/domain models to useful, to usable customer models, to relevant and personalized user models quicker and faster by narrowing the scope of the problem and domains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e6BqC-h2ibHSut8SvlNnLg.jpeg" /><figcaption>Learning Curves: As the domain narrows, learning accelerates</figcaption></figure><p>In the next blog article, I will discuss the AI life cycle management topic. Watch out for it!</p><p>Acknowledgements: The ideas in this blog article were shaped by various discussions I have had with many colleagues at IBM. Many thanks to all of them. Specifically, I’d like to thank Beth Smith, John Schumacher, Worknesh Belay, Vibha Sinha, Ruchir Puri and Donna Romer for lively discussions that helped refine and solidify these ideas and points of view.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d48a97e8855" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Declare your biases]]></title>
            <link>https://medium.com/@rama.akkiraju/declare-your-biases-e60647f9ed08?source=rss-8e2e1c53d1bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/e60647f9ed08</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ibm-watson]]></category>
            <category><![CDATA[ai-bias]]></category>
            <category><![CDATA[cognitive-bias]]></category>
            <dc:creator><![CDATA[Rama Akkiraju]]></dc:creator>
            <pubDate>Tue, 20 Feb 2018 23:26:38 GMT</pubDate>
            <atom:updated>2018-02-20T23:26:38.984Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4xhZAAIA1VW5sDi9PVb9dQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/cGwfkwHmt98?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Joshua Earle</a> on <a href="https://unsplash.com/search/photos/announce?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>This month there has been a lot of discussion on biases in Machine Learning models in AI world spurred by this <a href="https://www.nytimes.com/2018/02/09/technology/facial-recognition-race-artificial-intelligence.html">New York Times article on bias in AI systems</a>. Every time the topic of machine learning models and biases comes up, invariably everyone points out the importance of training data and how important it is to ensure that the training data is representative and unbiased. While that is an important point to note, I’m afraid, it is not very actionable for practitioners who are building machine learning models, if we don’t provide any prescriptive guidance on how to ensure that the training data is ‘representative’ and ‘unbiased’. How can a data scientist building a machine learning model ensure that the training data she is working with is unbiased? What does it mean to be ‘unbiased’ anyway? ‘unbiased’ in what ‘scope’? representative of what ‘scope’? Who defined that ‘scope’ for her? How to measure that ‘scope’? She needs some guidance and tools to answer these questions.</p><p>I’d like to make two points on this topic in this article:</p><p>First, I’d argue that there is no such a thing as an ‘unbiased’ Machine Learning model. So, instead of striving for unbiased machine learning models, a machine learning model must state its biases openly.</p><p>Second, minimizing biases has to start with creating test datasets rather than with training datasets.</p><p>Let me elaborate.</p><p><em>State your biases</em>: If one were to attempt collecting unbiased training datasets in any particular domain to build out a robust machine learning model, ideally, one has to collect enough representative samples of data from that domain that the model is trying to learn. How does one go about modeling that domain and mapping out its contours so that you can sample enough data from the space that the domain represents? Physicists, Mathematicians and Statisticians like to explain the phenomena in our world from the point of view of models. Models are good tools to explain what’s happening around us in general terms, if not at every specific occurrence of a phenomenon. Distributions such as Gaussian, lognormal, exponential, Laplace, and Gamma etc. are used often to represent the occurrences in real-world. They are approximations but serve a good purpose to help reason things. So, we have tools at our disposal to figure out which distribution might be a good approximation to the domain that we are trying to model. Once the distribution is identified, we can use tools again to see whether we have enough samples to represent that model of the world reasonably or not. However, here lies the problem. More often than not, the domains are not evenly distributed, meaning not all phenomenon occur at the same frequency. So, it is hard to observe certain phenomenon than certain other phenomenon because they occur less frequently. Therefore, a corollary to this is that it is much difficult to collect certain types of data than certain others because there aren’t simply enough of them to around. During data acquisition process, organizations have to deal with budget, and time constraints. Rarely do organization have unlimited budgets and time to collect representative samples to collect most comprehensive datasets that can avoid biases completely. One can, at best, mitigate biases with careful planning (I will discuss this in the next point). Therefore, I’d argue that it is more practical for a machine learning model to declare its biases than to pretend that it is unbiased or that it can ever be fully unbiased. How can we do this? Well, one way to do this is to be open about the scope, coverage, type of data and the sources of data that a model is trained on. I know this gets into revealing too much about ones’ secret sauce to the whole world. Organizations don’t like to do this, usually for good reasons. However, here is an analogy that might help us rationalize this. When a new drug is released to the market, Federal Drug Administration (FDA) (or whatever the analogous body in a different country) mandates that the ingredients used in making that medicine be declared on the drug label. Drug companies would rather not do it if they can help it but it helps the patients understand what they are getting. May be machine learning models ought to be treated like these new medicines released to market. If we tell the users what the models are trained on, and the innate biases, they know what to expect and won’t hold it accountable for something that it is not trained on!</p><p><em>Start with test datasets</em>: In software engineering, after many years of trial and error and iterations, best practices evolved on how to build robust software with minimal defects. One such best practice states that one must start with building test cases for the software first before writing any code. Once the expected behavior of the software is defined by means of detailed requirements, business analysts must write the test cases. Developers, then, are supposed to write corresponding unit and system test cases first. Software is then designed and developed to meet those requirements and to pass the test cases. Passing the test cases is how one measures whether the written software meets the requirements or not. Test case coverage is a very important software development metric in building good quality software systems. When building large commercial software, teams of software testers are employed to write test cases and to test the software from all angles. It seems that when building machine learning models, somehow we have forgotten the basic principles of software development. The onus is often on data scientists building the machine learning models to ensure that they train the model with ‘unbiased’ data. Whatever happened to writing test cases first in the world of building machine learning models? Whatever happened to creating a test team? A test dataset in machine learning world can be thought of as a test case in traditional software development. Just as test teams are an integral part of a software development organization, test teams that create test datasets should be an integral part of AI systems development organizations. Similar to ‘test coverage’ metrics in software engineering, we need to define, measure and monitor ‘test coverage’ for machine learning models. Leaving this to data scientists who build machine learning models is not enough. A good software project never relies on developer test cases alone to release commercial software. It must be tested by independent testers.</p><p>Once the test datasets are created in machine learning world, it is the job of data managers (please refer to my previous article on new roles in machine learning systems for a definition on who a data manager is) to collect training data that has the desired ‘coverage’ to train a machine learning model. At this point, we need good metrics, algorithms and tools to measure various aspects of training data sets and test data sets to note how close they are to each other, what the gaps are and in what areas the gaps are. Unsupervised machine learning algorithms themselves (such as topic modeling and clustering) can be put to use here to measure the distance between train and test datasets on various dimensions and to understand where gaps need to be bridged in training datasets. Based on the noted gaps, data managers can iterate till they reach a threshold of desired coverage or a threshold of distance between test and train datasets in terms of coverage. Clearly, these are ideas and concepts at this time. We need to drive more research work on these topics to build the methods, processes, and tools to institutionalize this type of disciplined process to building train and test datasets.</p><p>But wait a minute! I haven’t still addressed the original problem of creating test datasets that cover the scope of the machine learning model. I simply argued for distributing the problem of creating test datasets to multiple people (which is a good start anyway! Diversity ensures good coverage often). We still need a good ‘coverage’ measurement metric to measure the distance between the scope covered in the test datasets collected and that of ‘requirements’. Okay, so now we are on to a different point. How to represent requirements for a machine learning model? Well, these are all the critical questions we must ask and answer for ourselves. I don’t have answers to all these yet but I’m certainly thinking about these and I know several of you are as well.</p><p>One thing is clear to me though! We need to be more methodical about building machine learning models than we currently are. There is a lot to learn from software engineering practices, and quality management in manufacturing. We don’t need to reinvent those wheels. We need to find suitable interpretations here so we can build on those best practices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e60647f9ed08" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>