{"id":775,"date":"2018-12-27T20:57:14","date_gmt":"2018-12-27T19:57:14","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=775"},"modified":"2020-11-21T22:22:48","modified_gmt":"2020-11-21T21:22:48","slug":"smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/","title":{"rendered":"Smile: Predicting the Direction of Stock Market Prices using a Random Forrest Classifier"},"content":{"rendered":"<p>In this demo we show how to forecast if the NASDAQ-100 is moving up or down. We do this with the help of a Random Forrest Classifier from the <a href=\"https:\/\/haifengl.github.io\/smile\/\">Smile Machine Learning Framework<\/a>. I tried to replicate the result from a <a href=\"https:\/\/www.researchgate.net\/publication\/301818771_Predicting_the_direction_of_stock_market_prices_using_random_forest\">research paper<\/a><br \/>\nauthored by Luckyson Khaidem, Snehanshu Saha, Sudeepa Roy Dey:<\/p>\n<ul>\n<li>Data Preprocessing\n<ul>\n<li>exponentially smoothing<\/li>\n<\/ul>\n<\/li>\n<li>Features\n<ul>\n<li>Relative Strength Index<\/li>\n<li>Stochastic Oscillator<\/li>\n<li>Williams %R<\/li>\n<li>Moving Average Convergence Divergence<\/li>\n<li>Price Rate of Change<\/li>\n<li>On Balance Volume<\/li>\n<\/ul>\n<\/li>\n<li>Labels\n<ul>\n<li>Sign(closei+d \u2212 closei)<\/li>\n<\/ul>\n<\/li>\n<li>Ticker Symbols\n<ul>\n<li>NDX<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>The solution has been implemented in Scala using Jupyter with the <a href=\"http:\/\/beakerx.com\/\">BeakerX<\/a> kernel using the following libraries<br \/>\n&#8211; <a href=\"https:\/\/www.pschatzmann.ch\/home\/projects\/402-2\/\">Investor<\/a><br \/>\n&#8211; <a href=\"https:\/\/haifengl.github.io\/smile\/\">Smile (Machine Learning Framework for Java and Scala)<\/a><\/p>\n<p>The result can be found in the <a href=\"https:\/\/nbviewer.jupyter.org\/a3231b3d81ba3685c596c17f0b496291\" rel=\"noopener noreferrer\" target=\"_blank\">following Gist<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this demo we show how to forecast if the NASDAQ-100 is moving up or down. We do this with the help of a Random Forrest Classifier from the Smile Machine Learning Framework. I tried to replicate the result from a research paper authored by Luckyson Khaidem, Snehanshu Saha, Sudeepa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[4,14,13],"tags":[],"class_list":["post-775","post","type-post","status-publish","format-standard","hentry","category-data-science","category-machine-learning","category-quantitative-trading"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Smile: Predicting the Direction of Stock Market Prices using a Random Forrest Classifier - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Smile: Predicting the Direction of Stock Market Prices using a Random Forrest Classifier - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"In this demo we show how to forecast if the NASDAQ-100 is moving up or down. We do this with the help of a Random Forrest Classifier from the Smile Machine Learning Framework. I tried to replicate the result from a research paper authored by Luckyson Khaidem, Snehanshu Saha, Sudeepa [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-27T19:57:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-21T21:22:48+00:00\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/12\\\/27\\\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/12\\\/27\\\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Smile: Predicting the Direction of Stock Market Prices using a Random Forrest Classifier\",\"datePublished\":\"2018-12-27T19:57:14+00:00\",\"dateModified\":\"2020-11-21T21:22:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/12\\\/27\\\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\\\/\"},\"wordCount\":133,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"articleSection\":[\"Data Science\",\"Machine Learning\",\"Quantitative Trading\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/12\\\/27\\\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/12\\\/27\\\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/12\\\/27\\\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\\\/\",\"name\":\"Smile: Predicting the Direction of Stock Market Prices using a Random Forrest Classifier - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"datePublished\":\"2018-12-27T19:57:14+00:00\",\"dateModified\":\"2020-11-21T21:22:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/12\\\/27\\\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/12\\\/27\\\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/12\\\/27\\\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Smile: Predicting the Direction of Stock Market Prices using a Random Forrest Classifier\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Smile: Predicting the Direction of Stock Market Prices using a Random Forrest Classifier - Phil Schatzmann","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":"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/","og_locale":"en_US","og_type":"article","og_title":"Smile: Predicting the Direction of Stock Market Prices using a Random Forrest Classifier - Phil Schatzmann","og_description":"In this demo we show how to forecast if the NASDAQ-100 is moving up or down. We do this with the help of a Random Forrest Classifier from the Smile Machine Learning Framework. I tried to replicate the result from a research paper authored by Luckyson Khaidem, Snehanshu Saha, Sudeepa [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/","og_site_name":"Phil Schatzmann","article_published_time":"2018-12-27T19:57:14+00:00","article_modified_time":"2020-11-21T21:22:48+00:00","author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Smile: Predicting the Direction of Stock Market Prices using a Random Forrest Classifier","datePublished":"2018-12-27T19:57:14+00:00","dateModified":"2020-11-21T21:22:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/"},"wordCount":133,"commentCount":1,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"articleSection":["Data Science","Machine Learning","Quantitative Trading"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/","url":"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/","name":"Smile: Predicting the Direction of Stock Market Prices using a Random Forrest Classifier - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"datePublished":"2018-12-27T19:57:14+00:00","dateModified":"2020-11-21T21:22:48+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/12\/27\/smile-predicting-the-direction-of-stock-market-prices-using-a-naive-bayes-classifier\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Smile: Predicting the Direction of Stock Market Prices using a Random Forrest Classifier"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/775","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=775"}],"version-history":[{"count":1,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/775\/revisions"}],"predecessor-version":[{"id":2194,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/775\/revisions\/2194"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}