{"id":13,"date":"2018-11-22T22:58:00","date_gmt":"2018-11-22T22:58:00","guid":{"rendered":""},"modified":"2020-07-25T21:38:52","modified_gmt":"2020-07-25T19:38:52","slug":"difference-between-prediction-and-inference-in-machine-learning","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/blog\/difference-between-prediction-and-inference-in-machine-learning\/","title":{"rendered":"Difference Between Prediction and Inference in Machine Learning"},"content":{"rendered":"<p>Hello friend, I&#8217;ll like to share with you this brief explanation of the difference between Prediction and Inference. They appear similar, to us researchers and data scientists, the difference should be well-drawn out.<br \/>\nLets begin with Prediction<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/3.bp.blogspot.com\/-Do1z3-dP4xc\/W_czggxSG6I\/AAAAAAAACec\/7IvonDsCN_QGsnLr6a_kU0s9IIENYQs6ACLcBGAs\/s1600\/Difference%2BBetween%2BPrediction%2Band%2BInference%2Bin%2BMachine%2BLearning.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/3.bp.blogspot.com\/-Do1z3-dP4xc\/W_czggxSG6I\/AAAAAAAACec\/7IvonDsCN_QGsnLr6a_kU0s9IIENYQs6ACLcBGAs\/s320\/Difference%2BBetween%2BPrediction%2Band%2BInference%2Bin%2BMachine%2BLearning.jpg\" width=\"320\" height=\"134\" border=\"0\" data-original-height=\"525\" data-original-width=\"1253\" \/><\/a><\/div>\n<p><b>Content<\/b><br \/>\n<a href=\"https:\/\/kindsonthegenius.com\/blog\/difference-between-prediction-and-inference-in-machine-learning#t1\">1. What it Prediction?<\/a><br \/>\n<a href=\"#t2\">2. What is Inference<\/a><br \/>\n<a href=\"#t3\">3. The Mathematical Modelling<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"t1\">1. What is Prediction?<\/h3>\n<p>Let&#8217;s illustrate with an example.<br \/>\nAssuming an organization wants to conduct a marketing survey. The objective of the survey is to determine the response of people in a given area to an advertising campaign being carried out.<br \/>\nThe company gathers the demographic features of the particular area the campaign is to be conducted. This features make up a feature set of the predictors (variables). These variables may include:<\/p>\n<ul>\n<li>population density<\/li>\n<li>average education level<\/li>\n<li>class of people<\/li>\n<li>area type(rural, sub-urban, urban)<\/li>\n<li>media type to be used etc<\/li>\n<\/ul>\n<p>The company would like to know if the campaign would either succeed or fail, where success is measured by the response of the people to the campaign based on certain threshold.<br \/>\nThe situation like this where the objective is to predict either success or failure (classification) given a set of input variables is an example of prediction modelling.<br \/>\nIn this case the focus is not to understand the relationships between individual predictor variable and the output.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"t2\">2. What is Inference?<\/h3>\n<p>Still using the advertising campaign example. If the objective of the survey is to determine the relationship between each individual prediction and the output this would be inference. In this case the following questions would be answered:<\/p>\n<ul>\n<li>Which media type have most effect on the response<\/li>\n<li>How does the population density affect the\u00a0 outcome<\/li>\n<li>What class of people respond most to the campaign<\/li>\n<\/ul>\n<p>In this case, the goes is not just to get a classification of success or failure but to infer relationships between predictors.<br \/>\nLet&#8217;s look at the\u00a0 mathematical model<br \/>\n<ins style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-7041870931346451\" data-ad-slot=\"4209786523\"><\/ins><\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"t3\">3. The Mathematical Model<\/h3>\n<p>Let the input predictor variables be X1, \u2026 Xp. and the target variable Y.\u00a0 The we would be interested in estimating how the output Y is affected by variation in X.<br \/>\nThe goal is the create a relationship between X and Y such that<br \/>\nf(X) = Y<br \/>\nFirst we assume a simple approach and the would be that the model is linear. Then we use a parametric method.<br \/>\nAssuming the function f(X) is linear, then we have:<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/4.bp.blogspot.com\/-rxLVOsRT2dU\/W_cy3Tn3xoI\/AAAAAAAACeQ\/KIgXVo0KCXgSYurtX-Ruxk9OK_4mN8tjgCEwYBhgL\/s1600\/Prediction%2Bvs%2BInference.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/4.bp.blogspot.com\/-rxLVOsRT2dU\/W_cy3Tn3xoI\/AAAAAAAACeQ\/KIgXVo0KCXgSYurtX-Ruxk9OK_4mN8tjgCEwYBhgL\/s320\/Prediction%2Bvs%2BInference.jpg\" width=\"320\" height=\"37\" border=\"0\" data-original-height=\"71\" data-original-width=\"598\" \/><\/a><\/div>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<p>Next we then train the model by using a procedure that finds the values of the <span style=\"-webkit-text-stroke-width: 0px; background-color: white; color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: x-small; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;\">\u03b2s <\/span>such that:<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/4.bp.blogspot.com\/-CVkjFwpsrcM\/W_cy_UbRVmI\/AAAAAAAACeU\/-rDpF7G4CGcKTuzmSF1F5Gg_75H09qv-gCLcBGAs\/s1600\/Prediction%2Bvs%2BInference%2B2.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/4.bp.blogspot.com\/-CVkjFwpsrcM\/W_cy_UbRVmI\/AAAAAAAACeU\/-rDpF7G4CGcKTuzmSF1F5Gg_75H09qv-gCLcBGAs\/s320\/Prediction%2Bvs%2BInference%2B2.jpg\" width=\"320\" height=\"41\" border=\"0\" data-original-height=\"71\" data-original-width=\"548\" \/><\/a><\/div>\n<p>Here you can see that the equivalent sign is used which means that the predicted that there exist some error value incurred in the process which we would like to minimize.<br \/>\nMore details on this is discussed in <a href=\"https:\/\/www.youtube.com\/watch?v=K_48DJEv0-o\" target=\"_blank\" rel=\"noopener\">Linear Models of\u00a0 Regression<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello friend, I&#8217;ll like to share with you this brief explanation of the difference between Prediction and Inference. They appear similar, to us researchers and &hellip; <\/p>\n","protected":false},"author":1,"featured_media":297,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[11,16],"tags":[],"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/13"}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":6,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":1067,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/13\/revisions\/1067"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media\/297"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media?parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/categories?post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/tags?post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}