{"id":2167,"date":"2018-07-28T13:13:10","date_gmt":"2018-07-28T13:13:10","guid":{"rendered":"http:\/\/intelligentonlinetools.com\/blog\/?p=2167"},"modified":"2018-07-28T19:17:05","modified_gmt":"2018-07-28T19:17:05","slug":"inferring-causes-effects-daily-data","status":"publish","type":"post","link":"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/","title":{"rendered":"Inferring Causes and Effects from Daily Data"},"content":{"rendered":"<p>Doing different activities we often are interesting how they impact each other.  For example, if we visit different links on Internet, we might want to know how this action impacts our motivation for doing some specific things. In other words we are interesting in inferring importance of causes for effects from our daily activities data.<\/p>\n<p>In this post we will look at few ways to detect relationships between actions and results using machine learning algorithms and python.<\/p>\n<p>Our data example will be artificial dataset consisting of  2 columns:   URL and Y.<br \/>\nURL is our action and we want to know how it impacts on Y.  URL can be link0, link1, link2 wich means links visited, and Y can be 0 or 1, 0 means we did not got motivated, and 1 means we got motivated.<\/p>\n<p>The first thing we do hot-encoding link0, link1, link3 in 0,1 and we will get 3 columns as below.<br \/>\n<figure id=\"attachment_2174\" aria-describedby=\"caption-attachment-2174\" style=\"width: 288px\" class=\"wp-caption alignnone\"><img data-attachment-id=\"2174\" data-permalink=\"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/fe1_data_after_hot_encoding\/#main\" data-orig-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/07\/fe1_data_after_hot_encoding.png\" data-orig-size=\"298,125\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"fe1_data_after_hot_encoding\" data-image-description=\"&lt;p&gt;Sample of data after one hot encoding&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Sample of data after one hot encoding&lt;\/p&gt;\n\" data-medium-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/07\/fe1_data_after_hot_encoding.png\" data-large-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/07\/fe1_data_after_hot_encoding.png\" decoding=\"async\" loading=\"lazy\" src=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/07\/fe1_data_after_hot_encoding.png\" alt=\"Sample of data after one hot encoding\" width=\"298\" height=\"125\" class=\"size-full wp-image-2174\" \/><figcaption id=\"caption-attachment-2174\" class=\"wp-caption-text\">Sample of data after one hot encoding<\/figcaption><\/figure><\/p>\n<p>So we have now 3 features, each for each URL. Here is the code how to do <strong>hot-encoding<\/strong> to prepare our data for cause and effect analysis.<\/p>\n<p><!--INFOLINKS_OFF--> <\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nfilename = &quot;C:\\\\Users\\\\drm\\\\data.csv&quot;\r\ndataframe = pandas.read_csv(filename)\r\n\r\ndataframe=pandas.get_dummies(dataframe)\r\ncols = dataframe.columns.tolist()\r\ncols.insert(len(dataframe.columns)-1, cols.pop(cols.index('Y')))\r\ndataframe = dataframe.reindex(columns= cols)\r\n\r\nprint (len(dataframe.columns))\r\n\r\n#output\r\n#4 \r\n\r\n<\/pre>\n<p>Now we can apply <strong>feature extraction<\/strong> algorithm. It allows us select features according to the k highest scores. <\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n# feature extraction\r\ntest = SelectKBest(score_func=chi2, k=&quot;all&quot;)\r\nfit = test.fit(X, Y)\r\n# summarize scores\r\nnumpy.set_printoptions(precision=3)\r\nprint (&quot;scores:&quot;)\r\nprint(fit.scores_)\r\n\r\nfor i in range (len(fit.scores_)):\r\n    print ( str(dataframe.columns.values[i]) + &quot;    &quot; + str(fit.scores_[i]))\r\nfeatures = fit.transform(X)\r\n\r\nprint (list(dataframe))\r\n\r\nnumpy.set_printoptions(threshold=numpy.inf)\r\n\r\n\r\nscores:\r\n[11.475  0.142 15.527]\r\nURL_link0    11.475409836065575\r\nURL_link1    0.14227166276346598\r\nURL_link2    15.526957539965377\r\n['URL_link0', 'URL_link1', 'URL_link2', 'Y']\r\n\r\n\r\nAnother algorithm that we can use is &lt;strong&gt;ExtraTreesClassifier&lt;\/strong&gt; from python machine learning library sklearn.\r\n\r\n\r\nfrom sklearn.ensemble import ExtraTreesClassifier\r\nfrom sklearn.feature_selection import SelectFromModel\r\n\r\nclf = ExtraTreesClassifier()\r\nclf = clf.fit(X, Y)\r\nprint (clf.feature_importances_)  \r\nmodel = SelectFromModel(clf, prefit=True)\r\nX_new = model.transform(X)\r\nprint (X_new.shape)      \r\n\r\n#output\r\n#[0.424 0.041 0.536]\r\n#(150, 2)\r\n\r\n<\/pre>\n<p><!--INFOLINKS_ON--><br \/>\nThe above two machine learning algorithms helped us to estimate the importance of our features (or actions) for our Y variable. In both cases URL_link2 got highest score. <\/p>\n<p>There exist other methods. I would love to hear what methods do you use and for what datasets and\/or problems. Also feel free to provide feedback or comments or any questions. <\/p>\n<p><strong>References<\/strong><br \/>\n1. <a href=\"https:\/\/machinelearningmastery.com\/feature-selection-machine-learning-python\/\" target=\"_blank\">Feature Selection For Machine Learning in Python<\/a><br \/>\n2. <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.ExtraTreesClassifier.html\" \n target=\"_blank\">sklearn.ensemble.ExtraTreesClassifier<\/a><\/p>\n<p>Below is python full source code<\/p>\n<p><!--INFOLINKS_OFF--> <\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n# -*- coding: utf-8 -*-\r\nimport pandas\r\nimport numpy\r\nfrom sklearn.feature_selection import SelectKBest\r\nfrom sklearn.feature_selection import chi2\r\n\r\n\r\nfilename = &quot;C:\\\\Users\\\\drm\\\\data.csv&quot;\r\ndataframe = pandas.read_csv(filename)\r\n\r\ndataframe=pandas.get_dummies(dataframe)\r\ncols = dataframe.columns.tolist()\r\ncols.insert(len(dataframe.columns)-1, cols.pop(cols.index('Y')))\r\ndataframe = dataframe.reindex(columns= cols)\r\n\r\nprint (dataframe)\r\nprint (len(dataframe.columns))\r\n\r\n\r\narray = dataframe.values\r\nX = array[:,0:len(dataframe.columns)-1]  \r\nY = array[:,len(dataframe.columns)-1]   \r\nprint (&quot;--X----&quot;)\r\nprint (X)\r\nprint (&quot;--Y----&quot;)\r\nprint (Y)\r\n\r\n\r\n\r\n# feature extraction\r\ntest = SelectKBest(score_func=chi2, k=&quot;all&quot;)\r\nfit = test.fit(X, Y)\r\n# summarize scores\r\nnumpy.set_printoptions(precision=3)\r\nprint (&quot;scores:&quot;)\r\nprint(fit.scores_)\r\n\r\nfor i in range (len(fit.scores_)):\r\n    print ( str(dataframe.columns.values[i]) + &quot;    &quot; + str(fit.scores_[i]))\r\nfeatures = fit.transform(X)\r\n\r\nprint (list(dataframe))\r\n\r\nnumpy.set_printoptions(threshold=numpy.inf)\r\nprint (&quot;features&quot;)\r\nprint(features)\r\n\r\n\r\nfrom sklearn.ensemble import ExtraTreesClassifier\r\nfrom sklearn.feature_selection import SelectFromModel\r\n\r\nclf = ExtraTreesClassifier()\r\nclf = clf.fit(X, Y)\r\nprint (&quot;feature_importances&quot;)\r\nprint (clf.feature_importances_)  \r\nmodel = SelectFromModel(clf, prefit=True)\r\nX_new = model.transform(X)\r\nprint (X_new.shape) \r\n<\/pre>\n<p><!--INFOLINKS_ON--> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Doing different activities we often are interesting how they impact each other. For example, if we visit different links on Internet, we might want to know how this action impacts our motivation for doing some specific things. In other words we are interesting in inferring importance of causes for effects from our daily activities data. &#8230; <a title=\"Inferring Causes and Effects from Daily Data\" class=\"read-more\" href=\"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/\">Read more<\/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_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[2,9,10],"tags":[82,31,18],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Inferring Causes and Effects from Daily Data - Machine Learning Applications<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Inferring Causes and Effects from Daily Data - Machine Learning Applications\" \/>\n<meta property=\"og:description\" content=\"Doing different activities we often are interesting how they impact each other. For example, if we visit different links on Internet, we might want to know how this action impacts our motivation for doing some specific things. In other words we are interesting in inferring importance of causes for effects from our daily activities data. ... Read more\" \/>\n<meta property=\"og:url\" content=\"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/\" \/>\n<meta property=\"og:site_name\" content=\"Machine Learning Applications\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-28T13:13:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-07-28T19:17:05+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/07\/fe1_data_after_hot_encoding.png\" \/>\n<meta name=\"author\" content=\"owygs156\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"owygs156\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/\",\"url\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/\",\"name\":\"Inferring Causes and Effects from Daily Data - Machine Learning Applications\",\"isPartOf\":{\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#website\"},\"datePublished\":\"2018-07-28T13:13:10+00:00\",\"dateModified\":\"2018-07-28T19:17:05+00:00\",\"author\":{\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478\"},\"breadcrumb\":{\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/intelligentonlinetools.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Inferring Causes and Effects from Daily Data\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#website\",\"url\":\"http:\/\/intelligentonlinetools.com\/blog\/\",\"name\":\"Machine Learning Applications\",\"description\":\"Artificial intelligence, data mining and machine learning for building web based tools and services.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/intelligentonlinetools.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478\",\"name\":\"owygs156\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g\",\"caption\":\"owygs156\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Inferring Causes and Effects from Daily Data - Machine Learning Applications","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/","og_locale":"en_US","og_type":"article","og_title":"Inferring Causes and Effects from Daily Data - Machine Learning Applications","og_description":"Doing different activities we often are interesting how they impact each other. For example, if we visit different links on Internet, we might want to know how this action impacts our motivation for doing some specific things. In other words we are interesting in inferring importance of causes for effects from our daily activities data. ... Read more","og_url":"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/","og_site_name":"Machine Learning Applications","article_published_time":"2018-07-28T13:13:10+00:00","article_modified_time":"2018-07-28T19:17:05+00:00","og_image":[{"url":"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/07\/fe1_data_after_hot_encoding.png"}],"author":"owygs156","twitter_card":"summary_large_image","twitter_misc":{"Written by":"owygs156","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/","url":"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/","name":"Inferring Causes and Effects from Daily Data - Machine Learning Applications","isPartOf":{"@id":"http:\/\/intelligentonlinetools.com\/blog\/#website"},"datePublished":"2018-07-28T13:13:10+00:00","dateModified":"2018-07-28T19:17:05+00:00","author":{"@id":"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478"},"breadcrumb":{"@id":"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/intelligentonlinetools.com\/blog\/2018\/07\/28\/inferring-causes-effects-daily-data\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/intelligentonlinetools.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Inferring Causes and Effects from Daily Data"}]},{"@type":"WebSite","@id":"http:\/\/intelligentonlinetools.com\/blog\/#website","url":"http:\/\/intelligentonlinetools.com\/blog\/","name":"Machine Learning Applications","description":"Artificial intelligence, data mining and machine learning for building web based tools and services.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/intelligentonlinetools.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478","name":"owygs156","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/image\/","url":"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g","contentUrl":"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g","caption":"owygs156"}}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7h1IJ-yX","jetpack-related-posts":[{"id":2253,"url":"http:\/\/intelligentonlinetools.com\/blog\/2018\/09\/06\/ml-applications\/","url_meta":{"origin":2167,"position":0},"title":"Everyday Examples of Machine Learning Applications","date":"September 6, 2018","format":false,"excerpt":"Artificial Intelligence and Machine Learning applications is one of the most hottest topics in the industry today. Robots, self driving cars, intelligent chatbots and many other innovations are coming to our work and life. In this post we will look at few machine learning less known applications that were covered\u2026","rel":"","context":"In &quot;Machine learning applications&quot;","img":{"alt_text":"Topic modeling with textacy","src":"https:\/\/i0.wp.com\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/09\/Topic-modeling-with-textacy-e1536508581929.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2064,"url":"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/","url_meta":{"origin":2167,"position":1},"title":"Machine Learning for Correlation Data Analysis Between Food and Mood","date":"June 10, 2018","format":false,"excerpt":"Can sweet food affect our mood? A friend of mine was interesting if some of his minor mood changes are caused by sugar intake from sweets like cookies. He collected and provided records and in this post we will use correlation data analysis with python pandas dataframes to check the\u2026","rel":"","context":"In &quot;Machine Learning&quot;","img":{"alt_text":"Correlation data between sweet food (taken in N days) and mood in the following averaged M days,","src":"https:\/\/i0.wp.com\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-heatmap-e1528641942369.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1446,"url":"http:\/\/intelligentonlinetools.com\/blog\/2017\/11\/06\/10-new-top-resources-on-machine-learning-from-around-the-web\/","url_meta":{"origin":2167,"position":2},"title":"10 New Top Resources on Machine Learning from Around the Web","date":"November 6, 2017","format":false,"excerpt":"For this post I put new and most interesting machine learning resources that I recently found on the web. This is the list of useful resources in such areas like stock market forecasting, text mining, deep learning, neural networks and getting data from Twitter. Hope you enjoy the reading. 1.\u2026","rel":"","context":"In &quot;Machine Learning&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1356,"url":"http:\/\/intelligentonlinetools.com\/blog\/2017\/07\/21\/application-for-machine-learning-for-analyzing-blog-text-and-google-analytics-data\/","url_meta":{"origin":2167,"position":3},"title":"Application for Machine Learning for Analyzing Blog Text and Google Analytics Data","date":"July 21, 2017","format":false,"excerpt":"In the previous post we looked how to download data from WordPress blog. [1] So now we can have blog data. We can get also web metrics data from Google Analytics such us the number of views, time on the page. How do we connect post text data with metrics\u2026","rel":"","context":"In &quot;Artificial Intelligence&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2017\/07\/blog-post-analytics-300x99.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":966,"url":"http:\/\/intelligentonlinetools.com\/blog\/2017\/02\/18\/building-decision-trees-in-python\/","url_meta":{"origin":2167,"position":4},"title":"Building Decision Trees in Python","date":"February 18, 2017","format":false,"excerpt":"A decision tree is a decision support tool that uses a tree-like graph or model of decisions and their possible consequences, including chance event outcomes, resource costs, and utility. It is one way to display an algorithm. Decision trees are commonly used in operations research, specifically in decision analysis, to\u2026","rel":"","context":"In &quot;Artificial Intelligence&quot;","img":{"alt_text":"Decision Tree","src":"https:\/\/i0.wp.com\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2017\/02\/dt_post1_N_CTQ_Cost_regr1-2-use-this-300x103.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1516,"url":"http:\/\/intelligentonlinetools.com\/blog\/2017\/11\/23\/regression-and-classification-decision-trees-building-with-python-and-running-online\/","url_meta":{"origin":2167,"position":5},"title":"Regression and Classification Decision Trees &#8211; Building with Python and Running Online","date":"November 23, 2017","format":false,"excerpt":"According to survey [1] Decision Trees constitute one of the 10 most popular data mining algorithms. Decision trees used in data mining are of two main types: Classification tree analysis is when the predicted outcome is the class to which the data belongs. Regression tree analysis is when the predicted\u2026","rel":"","context":"In &quot;Data Mining&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2017\/11\/decision_tree_11_2017-300x283.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/2167"}],"collection":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/comments?post=2167"}],"version-history":[{"count":19,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/2167\/revisions"}],"predecessor-version":[{"id":2192,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/2167\/revisions\/2192"}],"wp:attachment":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/media?parent=2167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/categories?post=2167"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/tags?post=2167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}