{"id":2064,"date":"2018-06-10T02:29:14","date_gmt":"2018-06-10T02:29:14","guid":{"rendered":"http:\/\/intelligentonlinetools.com\/blog\/?p=2064"},"modified":"2020-03-07T03:26:41","modified_gmt":"2020-03-07T03:26:41","slug":"machine-learning-correlation-analysis-food-mood","status":"publish","type":"post","link":"https:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/","title":{"rendered":"Machine Learning for Correlation Data Analysis Between Food and Mood"},"content":{"rendered":"<p>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 <b>correlation data analysis<\/b> with python pandas dataframes to check the connection between food and mood. We will create python script for this task. <\/p>\n<p><center><br \/>\n<img data-attachment-id=\"2128\" data-permalink=\"https:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/f-vs-m\/#main\" data-orig-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/f-vs-m.png\" data-orig-size=\"401,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=\"\" data-image-description=\"&lt;p&gt;link between food and mood&lt;\/p&gt;\n\" data-image-caption=\"\" data-medium-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/f-vs-m-300x94.png\" data-large-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/f-vs-m.png\" decoding=\"async\" loading=\"lazy\" src=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/f-vs-m.png\" alt=\"food and mood\" width=\"401\" height=\"125\" class=\"alignnone size-full wp-image-2128\" srcset=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/f-vs-m.png 401w, https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/f-vs-m-300x94.png 300w\" sizes=\"(max-width: 401px) 100vw, 401px\" \/><br \/>\n<\/center><\/p>\n<p><!--\nAlso <b>online<\/b> free service available at <a href=\"http:\/\/intelligentonlinetools.com\/cgi-bin\/analytics\/ml.cgi?model_name_selection=Time Series Correlation\" target=\"_blank\">Online Machine Learning Algorithms<\/a> where you can plug your data or play with this example data. (Select Time Series Correlation). The links to the code and data are provided below and in the references:\n--><\/p>\n<p><a href=http:\/\/intelligentonlinetools.com\/blog\/dataset-correlation-analysis-food-mood\/  target=_blank>Dataset from Correlation Data Analysis Between Food and Mood<\/a><br \/>\n<a href=\"http:\/\/intelligentonlinetools.com\/blog\/source-code-for-machine-learning-correlation-data-analysis-between-food-and-mood\/\" target=\"_blank\">Source Code for Machine Learning Correlation Data Analysis Between Food and Mood<\/a><\/p>\n<h2>Connection Between Eating and Mental Health<\/h2>\n<p>From internet resources we can confirm that relationship between how we feel and what we eat exists.[1]  Sweet food  is not recommended to eat as fluctuations in blood sugar cause mood swings, lack of energy [2]. The information about chocolate is however contradictory. Chocolate affects us both negatively and positively.[3] But chocolate has also sugar.<br \/>\nWhat if we eat only small amount of sweets and not each day &#8211; is there still any connection and how strong is it? The machine learning data analysis can help us to investigate this.<\/p>\n<h2>The Problem<\/h2>\n<p>So in this post we will estimate correlation between sweet food and mood based on provided daily data.<br \/>\n<b>Correlation<\/b> means association &#8211; more precisely it is a measure of the extent to which two variables are related. [4]<\/p>\n<h2>Data<\/h2>\n<p>The dataset has two columns, X and Y where:<br \/>\n<b>X<\/b> is how much sweet food was taken on daily basis, on the scale 0 &#8211; 1 , 0 is nothing, 1 means a max value.<br \/>\n<b>Y<\/b> is variation of mood from optimal state,  on the scale 0 &#8211; 1 , 0 &#8211; means no variations or no defects, 1 means a max value.  <\/p>\n<h2>Approach<\/h2>\n<p>If we calculate correlation between 2 columns of daily data we will get something around 0.  However this would not show whole picture. Because the effect of the food might take action in a few days. The good or bad feeling can also stay for few days after the event that caused this feeling.<br \/>\nSo we would need to take average data for several days for both X (looking back) and Y (looking forward). Here  is the diagram that explains how data will be aggregated:  <\/p>\n<figure id=\"attachment_2070\" aria-describedby=\"caption-attachment-2070\" style=\"width: 313px\" class=\"wp-caption alignnone\"><img data-attachment-id=\"2070\" data-permalink=\"https:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/changing-the-data-averaging\/#main\" data-orig-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/changing-the-data-averaging.png\" data-orig-size=\"323,248\" 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=\"Changing the data &#8211; averaging\" data-image-description=\"&lt;p&gt;Changing the data &#8211; averaging&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Changing the data &#8211; averaging&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/changing-the-data-averaging-300x230.png\" data-large-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/changing-the-data-averaging.png\" decoding=\"async\" loading=\"lazy\" src=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/changing-the-data-averaging.png\" alt=\"Changing the data - averaging\" width=\"323\" height=\"248\" class=\"size-full wp-image-2070\" srcset=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/changing-the-data-averaging.png 323w, https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/changing-the-data-averaging-300x230.png 300w\" sizes=\"(max-width: 323px) 100vw, 323px\" \/><figcaption id=\"caption-attachment-2070\" class=\"wp-caption-text\">Changing the data &#8211; averaging<\/figcaption><\/figure>\n<p>And here is how we can do this in the program:<br \/>\n  1.for each day take average X data for last N days and take average Y data for M next days.<br \/>\n  2.create a pandas dataframe which has now new moving averages  for X and Y.<br \/>\n  3.calculate correlation between new X and Y data<\/p>\n<p>What should be N and M? We will use different values &#8211; from 1 to 14. And we will check what is the highest value for correlation.<\/p>\n<p>Here is the python code to use pandas dataframe for calculating averages:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ndef get_data (df_pandas,k,z):\r\n    \r\n    x = np.zeros(df_pandas.shape[0]) \r\n    y = np.zeros(df_pandas.shape[0])\r\n       \r\n    new_df = pd.DataFrame() #creates a new dataframe that's empty\r\n    for index, row in df_pandas.iterrows():\r\n       \r\n        x[index]=df_pandas.loc[index-k:index,'X'].mean()\r\n     \r\n        y[index]=df_pandas.loc[index:index+z,'Y'].mean()\r\n    \r\n    new_df=pd.concat([pd.DataFrame(x),pd.DataFrame(y)], &quot;columns&quot;)\r\n    new_df.columns = ['X', 'Y']\r\n   \r\n    return new_df    \r\n\r\n<\/pre>\n<h2>Correlation Data Analysis<\/h2>\n<p>For calculating correlation we use also pandas dataframe. Here is the code snipped for this:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nfor i in range (1,n):\r\n    for j in range (1,m):\r\n   \r\n       data=get_data(df, i, j)\r\n       corr_df.loc[i, j] = data['X'].corr(data['Y'])\r\n\r\nprint (&quot;corr_df&quot;)       \r\nprint (corr_df)  \r\n<\/pre>\n<p>pandas.DataFrame.corr by default is calculating pearson correlation coefficient &#8211; it is the measure of the strength of the linear relationship between two variables. In our code we use this default option. [8]<\/p>\n<h2>Results<\/h2>\n<p>After calculating correlation coefficients we output data in the table format and plot results on heatmap using seaborn module. Below is the data output and the plot. The max value of correlation for each column is highlighted in yellow in the data table. Input data and full source code are available at [5],[6].<\/p>\n<figure id=\"attachment_2072\" aria-describedby=\"caption-attachment-2072\" style=\"width: 741px\" class=\"wp-caption alignnone\"><img data-attachment-id=\"2072\" data-permalink=\"https:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/correlation-data-for-heatmap\/#main\" data-orig-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-data-for-heatmap.png\" data-orig-size=\"751,282\" 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=\"correlation data for heatmap\" data-image-description=\"&lt;p&gt;Correlation data between sweet food and mood&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Correlation data between sweet food (taken in n days)  and mood (in next m days)&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-data-for-heatmap-300x113.png\" data-large-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-data-for-heatmap.png\" decoding=\"async\" loading=\"lazy\" src=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-data-for-heatmap.png\" alt=\"Correlation data \" width=\"751\" height=\"282\" class=\"size-full wp-image-2072\" srcset=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-data-for-heatmap.png 751w, https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-data-for-heatmap-300x113.png 300w\" sizes=\"(max-width: 751px) 100vw, 751px\" \/><figcaption id=\"caption-attachment-2072\" class=\"wp-caption-text\">Correlation data between sweet food (taken in n days)  and mood (in next m days)<\/figcaption><\/figure>\n<figure id=\"attachment_2074\" aria-describedby=\"caption-attachment-2074\" style=\"width: 470px\" class=\"wp-caption alignnone\"><img data-attachment-id=\"2074\" data-permalink=\"https:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/correlation-heatmap\/#main\" data-orig-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-heatmap-e1528641942369.png\" data-orig-size=\"480,396\" 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=\"correlation heatmap\" data-image-description=\"&lt;p&gt;Correlation data between sweet food (taken in N days)  and mood in the following  M days, averaged&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Correlation data between sweet food (taken in N days)  and mood in the following  M days, averaged&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-heatmap-300x247.png\" data-large-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-heatmap-e1528641942369.png\" decoding=\"async\" loading=\"lazy\" src=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-heatmap-e1528641942369.png\" alt=\"Correlation data between sweet food (taken in N days)  and mood in the following averaged M days,\" width=\"480\" height=\"396\" class=\"size-full wp-image-2074\" \/><figcaption id=\"caption-attachment-2074\" class=\"wp-caption-text\">Correlation data between sweet food (taken in N days)  and mood in the following  M days, averaged<\/figcaption><\/figure>\n<h2>Conclusion<\/h2>\n<p>We performed correlation analysis between eating sweet food and mental health. And we confirmed that in our data example there is a <b>moderate<\/b> correlation (0.4). This correlation is showing up when we use moving averaging for 5 or 6 days. This corresponds with observation that swing mood may appear in several days, not on the same or next day after eating sweet food. <\/p>\n<p>We also learned how we can estimate correlation between two time series variables X, Y. <\/p>\n<p><!--\nFeel free to experiment with your data or this example of correlation data analysis using this link <a href=\"http:\/\/intelligentonlinetools.com\/cgi-bin\/analytics\/ml.cgi?model_name_selection=Time Series Correlation\" target=\"_blank\">Online Machine Learning Algorithms<\/a>  Use \"load default values\" to run this example.  Below is the screenshot from this online tool.\n\n[caption id=\"attachment_2104\" align=\"alignnone\" width=\"420\"]<img data-attachment-id=\"2104\" data-permalink=\"https:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/correlation-online\/#main\" data-orig-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-online-e1528938154160.png\" data-orig-size=\"420,436\" 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=\"correlation online\" data-image-description=\"&lt;p&gt;Online calculation correlation and building heatmap&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Online calculation correlation and building heatmap&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-online-289x300.png\" data-large-file=\"https:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-online-e1528938154160.png\" decoding=\"async\" loading=\"lazy\" src=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/correlation-online-e1528938154160.png\" alt=\"Online calculation correlation and building heatmap\" width=\"420\" height=\"436\" class=\"size-full wp-image-2104\" \/> Online calculation correlation and building heatmap[\/caption]\n--><\/p>\n<p><strong>References<\/strong><br \/>\n1. <a href=\"https:\/\/www.theatlantic.com\/health\/archive\/2014\/03\/our-moods-our-foods\/284238\/\" target=\"_blank\">Our Moods, Our Foods The messy relationship between how we feel and what we eat<\/a><br \/>\n2. <a href=\"https:\/\/www.cnn.com\/2013\/11\/26\/health\/upwave-food-mood\/index.html\" target=\"_blank\">Can food affect your mood? By Cynthia Ramnarace, upwave.com<\/a><br \/>\n3. <a href=\"http:\/\/www.streetdirectory.com\/food_editorials\/snacks\/chocolates\/the_effects_of_chocolate_on_the_emotions.html\" target=\"_blank\">The Effects Of Chocolate On The Emotions<\/a><br \/>\n4. <a https:\/\/www.simplypsychology.org\/correlation.html target=\"_blank\">Correlation<\/a><br \/>\n5. <a href=http:\/\/intelligentonlinetools.com\/blog\/dataset-correlation-analysis-food-mood\/  target=_blank>Dataset from Correlation Data Analysis Between Food and Mood<\/a><br \/>\n6.<a href=\"http:\/\/intelligentonlinetools.com\/blog\/source-code-for-machine-learning-correlation-data-analysis-between-food-and-mood\/\" target=\"_blank\">Source Code for Machine Learning Correlation Data Analysis Between Food and Mood<\/a><br \/>\n7.<a href=\"http:\/\/www.tradinggeeks.net\/2015\/08\/calculating-correlation-in-python\/\" target=\"_blank\">Calculating Correlations of Forex Currency Pairs in Python<\/a><br \/>\n8.<a href=\"http:\/\/pandas.pydata.org\/pandas-docs\/version\/0.22\/generated\/pandas.DataFrame.corr.html\" target=\"_blank\">pandas.DataFrame.corr<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 connection between food and mood. &#8230; <a title=\"Machine Learning for Correlation Data Analysis Between Food and Mood\" class=\"read-more\" href=\"https:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/\">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":[9,10],"tags":[70,69,73,74,71,72],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Machine Learning for Correlation Data Analysis Between Food and Mood<\/title>\n<meta name=\"description\" content=\"Machine Learning for Correlation Data Analysis Between Food and Mood - dataset of daily sweet food intake and mood is used to investigate connection\" \/>\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\/06\/10\/machine-learning-correlation-analysis-food-mood\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Machine Learning for Correlation Data Analysis Between Food and Mood\" \/>\n<meta property=\"og:description\" content=\"Machine Learning for Correlation Data Analysis Between Food and Mood - dataset of daily sweet food intake and mood is used to investigate connection\" \/>\n<meta property=\"og:url\" content=\"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/\" \/>\n<meta property=\"og:site_name\" content=\"Machine Learning Applications\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-10T02:29:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-07T03:26:41+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/f-vs-m.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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/\",\"url\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/\",\"name\":\"Machine Learning for Correlation Data Analysis Between Food and Mood\",\"isPartOf\":{\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#website\"},\"datePublished\":\"2018-06-10T02:29:14+00:00\",\"dateModified\":\"2020-03-07T03:26:41+00:00\",\"author\":{\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478\"},\"description\":\"Machine Learning for Correlation Data Analysis Between Food and Mood - dataset of daily sweet food intake and mood is used to investigate connection\",\"breadcrumb\":{\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/intelligentonlinetools.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Machine Learning for Correlation Data Analysis Between Food and Mood\"}]},{\"@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\":\"https:\/\/secure.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g\",\"caption\":\"owygs156\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Machine Learning for Correlation Data Analysis Between Food and Mood","description":"Machine Learning for Correlation Data Analysis Between Food and Mood - dataset of daily sweet food intake and mood is used to investigate connection","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\/06\/10\/machine-learning-correlation-analysis-food-mood\/","og_locale":"en_US","og_type":"article","og_title":"Machine Learning for Correlation Data Analysis Between Food and Mood","og_description":"Machine Learning for Correlation Data Analysis Between Food and Mood - dataset of daily sweet food intake and mood is used to investigate connection","og_url":"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/","og_site_name":"Machine Learning Applications","article_published_time":"2018-06-10T02:29:14+00:00","article_modified_time":"2020-03-07T03:26:41+00:00","og_image":[{"url":"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/06\/f-vs-m.png"}],"author":"owygs156","twitter_card":"summary_large_image","twitter_misc":{"Written by":"owygs156","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/","url":"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/","name":"Machine Learning for Correlation Data Analysis Between Food and Mood","isPartOf":{"@id":"http:\/\/intelligentonlinetools.com\/blog\/#website"},"datePublished":"2018-06-10T02:29:14+00:00","dateModified":"2020-03-07T03:26:41+00:00","author":{"@id":"http:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478"},"description":"Machine Learning for Correlation Data Analysis Between Food and Mood - dataset of daily sweet food intake and mood is used to investigate connection","breadcrumb":{"@id":"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/intelligentonlinetools.com\/blog\/2018\/06\/10\/machine-learning-correlation-analysis-food-mood\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/intelligentonlinetools.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Machine Learning for Correlation Data Analysis Between Food and Mood"}]},{"@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":"https:\/\/secure.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.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-xi","jetpack-related-posts":[{"id":2253,"url":"https:\/\/intelligentonlinetools.com\/blog\/2018\/09\/06\/ml-applications\/","url_meta":{"origin":2064,"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":1628,"url":"https:\/\/intelligentonlinetools.com\/blog\/2017\/12\/17\/time-series-analysis-python-prophet\/","url_meta":{"origin":2064,"position":1},"title":"Time Series Analysis with Python and Prophet","date":"December 17, 2017","format":false,"excerpt":"Recently Facebook released Prophet - open source software tool for forecasting time series data. Facebook team have implemented in Prophet two trend models that can cover many applications: a saturating growth model, and a piecewise linear model. [4] With growth model Prophet can be used for prediction growth\/decay - for\u2026","rel":"","context":"In &quot;Machine Learning&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2017\/12\/time-series-analysis-python-300x180.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1385,"url":"https:\/\/intelligentonlinetools.com\/blog\/2017\/10\/15\/scraping\/","url_meta":{"origin":2064,"position":2},"title":"Combining Machine Learning and Data Scraping","date":"October 15, 2017","format":false,"excerpt":"I often come across web posts about extracting data (data scraping) from websites. For example recently in [1] Scrapy tool was used for web scraping with Python. Once we get scraping data we can use extracted information in many different ways. As computer algorithms evolve and can do more, the\u2026","rel":"","context":"In &quot;Data Mining&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":966,"url":"https:\/\/intelligentonlinetools.com\/blog\/2017\/02\/18\/building-decision-trees-in-python\/","url_meta":{"origin":2064,"position":3},"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":1446,"url":"https:\/\/intelligentonlinetools.com\/blog\/2017\/11\/06\/10-new-top-resources-on-machine-learning-from-around-the-web\/","url_meta":{"origin":2064,"position":4},"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":1516,"url":"https:\/\/intelligentonlinetools.com\/blog\/2017\/11\/23\/regression-and-classification-decision-trees-building-with-python-and-running-online\/","url_meta":{"origin":2064,"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":"https:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/2064"}],"collection":[{"href":"https:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/comments?post=2064"}],"version-history":[{"count":39,"href":"https:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/2064\/revisions"}],"predecessor-version":[{"id":2570,"href":"https:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/2064\/revisions\/2570"}],"wp:attachment":[{"href":"https:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/media?parent=2064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/categories?post=2064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/tags?post=2064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}