{"id":2008,"date":"2016-11-11T18:39:55","date_gmt":"2016-11-11T18:39:55","guid":{"rendered":"http:\/\/www.trivedigaurav.com\/blog\/?p=2008"},"modified":"2020-08-25T11:44:12","modified_gmt":"2020-08-25T11:44:12","slug":"on-interactive-machine-learning","status":"publish","type":"post","link":"https:\/\/www.trivedigaurav.com\/blog\/on-interactive-machine-learning\/","title":{"rendered":"On Interactive Machine Learning"},"content":{"rendered":"<div class=\"page\" title=\"Page 16\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<div class=\"page\" title=\"Page 16\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<blockquote>\n<p><em>When talking about machine learning, you may encounter many terminologies such as such as &#8220;online learning,&#8221; &#8220;active learning,&#8221; and \u201chuman in the loop&#8221; methods. Here are some of my thoughts on the relationship between interactive machine learning and machine learning in general. This is an extract from my answers to my <a href=\"http:\/\/www.trivedigaurav.com\/blog\/hey-i-passed-another-exam\/\">comprehensive exam<\/a>.<br \/><\/em><\/p>\n<\/blockquote>\n<p>Traditionally machine-learning has been classified into <em>supervised<\/em> and <em>unsupervised<\/em> learning families. In supervised learning the training data, <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cmathcal%7BD%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\mathcal{D}' title='\\mathcal{D}' class='latex' \/>, consists of N sets of feature vectors each with a desired label provided by a teacher:<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>Training Set\u00a0 <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Chspace%7B10pt%7D+%5Cmathcal%7BD%7D+%3D+%5C%7B%28%5Ctextbf%7Bx%7D_i%2C+y_i%29%5C%7D_%7Bi%3D1%7D%5E%7BN%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\hspace{10pt} \\mathcal{D} = \\{(\\textbf{x}_i, y_i)\\}_{i=1}^{N}' title='\\hspace{10pt} \\mathcal{D} = \\{(\\textbf{x}_i, y_i)\\}_{i=1}^{N}' class='latex' \/><\/p>\n<p>where, <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7Bx%7D_i+%5Cin+%5Cmathcal%7BX%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\textbf{x}_i \\in \\mathcal{X}' title='\\textbf{x}_i \\in \\mathcal{X}' class='latex' \/> is a d-dimensional feature vector<\/p>\n<p>and <img src='https:\/\/s0.wp.com\/latex.php?latex=y_i+%5Cin+%5Cmathcal%7BY%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='y_i \\in \\mathcal{Y}' title='y_i \\in \\mathcal{Y}' class='latex' \/> is the known label for it<\/p>\n<p>The task is to learn a function, <img src='https:\/\/s0.wp.com\/latex.php?latex=f+%3A+%5Cmathcal%7BX%7D+%5Cto+%5Cmathcal%7BY%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='f : \\mathcal{X} \\to \\mathcal{Y}' title='f : \\mathcal{X} \\to \\mathcal{Y}' class='latex' \/>, which can be used on unseen data.<\/p>\n<p>In unsupervised learning, our data consists of vectors <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7Bx%7D_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\textbf{x}_i' title='\\textbf{x}_i' class='latex' \/>, but no target label <img src='https:\/\/s0.wp.com\/latex.php?latex=y_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='y_i' title='y_i' class='latex' \/>. Common tasks under this category include clustering, density estimation and discovering patterns. A combination of these two is called <em>semi-supervised<\/em> learning, which has a mixture of labeled and unlabeled data in the training set. The algorithm assigns labels for missing data points using certain similarity measures.<\/p>\n<p>While researchers are actively looking at improving the unsupervised learning techniques, supervised machine learning has been the dominant form of learning till date. However, traditional supervised algorithms assume that we have training data along with the labels readily available. They are not concerned with the process of obtaining the target values <img src='https:\/\/s0.wp.com\/latex.php?latex=y_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='y_i' title='y_i' class='latex' \/>s for the training dataset. Often, obtaining labelled data is one of the main bottlenecks in applying these techniques in domain specific applications. Further, current approaches do not provide easy mechanisms for the end-users to correct problems when models deviate from the desired learning concept. NLP models are often built by experts in linguistics and\/or machine learning, with limited or no scope for the end-users to provide input. Here the domain experts, or the end-users, provide input to models as annotations for a large batch of training data. This approach can be expensive, inefficient and even infeasible in many situations. This includes many problems in the clinical domain such as building models for analyzing EMR data.<\/p>\n<div class=\"page\" title=\"Page 9\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>\u201cHuman-in-the-loop\u201d algorithms may be able to leverage the capabilities of a domain expert during the learning process. These algorithms can optimize their learning behavior through interaction with humans. Interactive Machine Learning (IML) is a subset of this class of algorithms. It is defined as the process of building machine learning models iteratively through end-user input. It allows the users to review model outputs and make corrections by giving feedback for building revised models. The users are then able to see model changes and verify them. This feedback loop allows end-users to refine the models further with every iteration. Some early examples for this definition include applications in <a href=\"http:\/\/dl.acm.org\/citation.cfm?id=604056\">image segmentation<\/a>, <a href=\"http:\/\/dl.acm.org\/citation.cfm?doid=1978942.1978967\">interactive document clustering<\/a>, <a href=\"https:\/\/www.ncbi.nlm.nih.gov\/pubmed\/26357193\">document retrieval<\/a>, <a href=\"http:\/\/dl.acm.org\/citation.cfm?doid=1978942.1978966\">bug triaging<\/a> and <a href=\"http:\/\/dl.acm.org\/citation.cfm?doid=1978942.1978965\">even music composition<\/a>. You can read more about this in the article titled <em>\"Power to the People: The Role of Humans in Interactive Machine Learning\"<\/em> (Amershi et.al., 2014).<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>Interactive machine learning builds on a variety of styles of learning algorithms:<\/p>\n<ul>\n<li><em>Reinforcement Learning:<\/em> In this class of learning we still want to learn <img src='https:\/\/s0.wp.com\/latex.php?latex=f+%3A+%5Cmathcal%7BX%7D+%5Cto+%5Cmathcal%7BY%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='f : \\mathcal{X} \\to \\mathcal{Y}' title='f : \\mathcal{X} \\to \\mathcal{Y}' class='latex' \/> but we see samples of <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7Bx%7D_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\textbf{x}_i' title='\\textbf{x}_i' class='latex' \/> but no target output <img src='https:\/\/s0.wp.com\/latex.php?latex=y_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='y_i' title='y_i' class='latex' \/>. Instead of <img src='https:\/\/s0.wp.com\/latex.php?latex=y_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='y_i' title='y_i' class='latex' \/>, we get a feedback from a critic about the goodness of the predicted output. The goal of the learner is to optimize for the reward function by selecting outputs that get best scores from the critics. The critic can be a human or any other agent. There need not be a human-in-the-loop for the algorithm to be classified under reinforcement learning. Several recent examples of this type include building systems that learn to play games such as <a href=\"https:\/\/github.com\/yenchenlin\/DeepLearningFlappyBird\">Flappy Bird<\/a>, <a href=\"https:\/\/github.com\/aleju\/mario-ai\">Mario<\/a> etc.<\/li>\n<li><em>Active Learning:<\/em>\u00a0 Active learning algorithms try to optimize for the number of training examples. Such an algorithm would ask an oracle to give labels such that it can achieve higher accuracy with smallest number of queries. These queries contain a batch of examples to be labelled. For example, in SVMs, one could <a href=\"http:\/\/dl.acm.org\/citation.cfm?id=944793\">select training sets for labeling<\/a> that are closest to the margin hyperplanes to reduce the number of queries.<\/li>\n<li><em>Online Algorithms:<\/em> Online learning algorithms are used when training data is available in sequential order, say due to the nature of the problem or memory constraints, as opposed to a batch learning technique where all the training data is available at once. The algorithm must adapt to the continuous stream of data made available to it. Formulating the learning problem to handle this situation forms the core of designing algorithms under this class.<br \/>A commonly used example would be the online gradient descent method for linear regression: Suppose we are trying to learn the parameters <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cmathbf%7Bw%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\mathbf{w}' title='\\mathbf{w}' class='latex' \/> for <img src='https:\/\/s0.wp.com\/latex.php?latex=f%28%5Cmathbf%7Bx%7D%29+%3D+w_0+%2B+w_1x_1+%2B+%5Cldots+w_d+x_d+&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='f(\\mathbf{x}) = w_0 + w_1x_1 + \\ldots w_d x_d ' title='f(\\mathbf{x}) = w_0 + w_1x_1 + \\ldots w_d x_d ' class='latex' \/>. We update the weights when we receive the <img src='https:\/\/s0.wp.com\/latex.php?latex=i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='i' title='i' class='latex' \/>th training example by taking the gradient of the defined error function:<br \/><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cmathbf%7Bw%7D_%7Bnew%7D+%5Cleftarrow+%5Cmathbf%7Bw%7D+-+%5Calpha+%5Ctimes+%5CDelta_%7B%5Cmathbf%7Bw%7D%7D+Error_i+%28%5Cmathbf%7Bw%7D%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\mathbf{w}_{new} \\leftarrow \\mathbf{w} - \\alpha \\times \\Delta_{\\mathbf{w}} Error_i (\\mathbf{w})' title='\\mathbf{w}_{new} \\leftarrow \\mathbf{w} - \\alpha \\times \\Delta_{\\mathbf{w}} Error_i (\\mathbf{w})' class='latex' \/>. Where, <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Calpha&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\alpha' title='\\alpha' class='latex' \/> is defined as the learning rate.<\/li>\n<\/ul>\n<\/div>\n<figure id=\"attachment_2449\" aria-describedby=\"caption-attachment-2449\" style=\"width: 416px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"wp-image-2449 size-full\" src=\"https:\/\/i0.wp.com\/www.trivedigaurav.com\/blog\/wp-content\/uploads\/2016\/11\/iml-venn.png?resize=416%2C234\" alt=\"\" width=\"416\" height=\"234\" \/><figcaption id=\"caption-attachment-2449\" class=\"wp-caption-text\">This is how the relationship between supervised, interactive machine learning, and human-in-the-loop algorithms may be represented in a Venn diagram.<\/figcaption><\/figure>\n<div class=\"column\">\n<p>Interactive machine learning methods can include all or some of these learning techniques. The common property between all the interactive machine learning methods is the tight interaction loop between the human and the learning algorithm. Most of the effort in interactive machine learning has been about designing interactions for each step of this loop. My work on <a href=\"http:\/\/www.trivedigaurav.com\/blog\/clinical-text-analysis-using-interactive-natural-language-processing\/\">interactive clinical<\/a> and <a href=\"http:\/\/www.trivedigaurav.com\/blog\/interactive-natural-language-processing-for-legal-text\/\">legal text analysis<\/a> also follows this pattern. You are welcome to check out those posts as well!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><h2>References<\/h2><ol><li>Amershi et.al. (2014), <em>Power to the People: The Role of Humans in Interactive Machine Learning<\/em>. Available: <a href=\"https:\/\/www.microsoft.com\/en-us\/research\/publication\/power-to-the-people-the-role-of-humans-in-interactive-machine-learning\/\">https:\/\/www.microsoft.com\/en-us\/research\/publication\/power-to-the-people-the-role-of-humans-in-interactive-machine-learning\/<\/a>.<\/li><\/ol><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When talking about machine learning, you may encounter many terminologies such as such as &#8220;online learning,&#8221; &#8220;active learning,&#8221; and \u201chuman in the loop&#8221; methods. Here are some of my thoughts on the relationship between interactive machine learning and machine learning in general. This is an extract from my answers to my comprehensive exam. Traditionally machine-learning &hellip; <a href=\"https:\/\/www.trivedigaurav.com\/blog\/on-interactive-machine-learning\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">On Interactive Machine Learning<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8,12,13],"tags":[],"class_list":["post-2008","post","type-post","status-publish","format-standard","hentry","category-hci","category-isp","category-machine-learning"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p46eol-wo","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/posts\/2008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/comments?post=2008"}],"version-history":[{"count":47,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/posts\/2008\/revisions"}],"predecessor-version":[{"id":2917,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/posts\/2008\/revisions\/2917"}],"wp:attachment":[{"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/media?parent=2008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/categories?post=2008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/tags?post=2008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}