{"id":191549,"date":"2023-06-07T10:52:34","date_gmt":"2023-06-07T14:52:34","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=191549"},"modified":"2023-06-07T10:52:36","modified_gmt":"2023-06-07T14:52:36","slug":"deep-learning-artificial-neural-network-using-tensorflow-in-python","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/","title":{"rendered":"Deep Learning &#8211; Artificial Neural Network Using TensorFlow In Python"},"content":{"rendered":"\n<p><em>Originally posted on <a href=\"https:\/\/blog.quantinsti.com\/deep-learning-artificial-neural-network-tensorflow-python\/\">QuantInsti<\/a> blog.<\/em><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">You can also download the python code and dataset from&nbsp;<a href=\"https:\/\/github.com\/umeshpalai\/Algorithmic-trading\" target=\"_blank\" rel=\"noreferrer noopener\">my github a\/c<\/a><\/pre>\n\n\n\n<p><strong><em>Excerpt<\/em><\/strong><\/p>\n\n\n\n<p>In this article, we are going to develop a machine learning technique called Deep learning (Artificial Neural network) by using tensor flow and predicting stock price in python. At the end of this article you will learn how to build artificial neural network by using tensor flow and how to code a strategy using the predictions from the neural network.<\/p>\n\n\n\n<p><strong>System Requirements: Python 3.6<\/strong><\/p>\n\n\n\n<p>If you are new to Neural Networks and would like to gain an understanding of their working, I would recommend you to go through the following blogs before building a neural network.<\/p>\n\n\n\n<p><a href=\"https:\/\/blog.quantinsti.com\/working-neural-networks-stock-price-prediction\/\" target=\"_blank\" rel=\"noreferrer noopener\">Working of neural networks for stock price prediction<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/blog.quantinsti.com\/training-neural-networks-for-stock-price-prediction\/\" target=\"_blank\" rel=\"noreferrer noopener\">Training neural networks for stock price prediction<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-coding-the-strategy\"><strong>Coding The Strategy<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-importing-libraries\"><strong>Importing Libraries<\/strong><\/h4>\n\n\n\n<p>We will start by importing&nbsp;all libraries. Please note if the below library not installed yet you need to install 1st in anaconda prompt before importing.<\/p>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"329\" height=\"109\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Import-libraries-quantinsti.png\" alt=\"\" class=\"wp-image-191551 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Import-libraries-quantinsti.png 329w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Import-libraries-quantinsti-300x99.png 300w\" data-sizes=\"(max-width: 329px) 100vw, 329px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 329px; aspect-ratio: 329\/109;\" \/><\/figure>\n\n\n\n<p><strong>TensorFlow<\/strong>&nbsp;is an open-source software library for dataflow programming across a range of tasks. It is a symbolic math library, and is used for machine learning applications such as&nbsp;<a target=\"_blank\" href=\"https:\/\/blog.quantinsti.com\/deep-learning-finance\/\" rel=\"noreferrer noopener\">deep learning<\/a>&nbsp;neural networks.&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/TensorFlow\" target=\"_blank\" rel=\"noreferrer noopener\">Wikipedia<\/a>.<\/p>\n\n\n\n<p><strong>Numpy<\/strong>&nbsp;is a fundamental package for scientific computing, we will be using this library for computations on our dataset. The library is imported using the alias np.<\/p>\n\n\n\n<p><strong>Pandas<\/strong>&nbsp;will help us in using the powerful dataframe object, which will be used throughout the code for building the artificial&nbsp;<a target=\"_blank\" href=\"https:\/\/blog.quantinsti.com\/neural-network-python\/\" rel=\"noreferrer noopener\">neural network in Python<\/a>.<\/p>\n\n\n\n<p><strong>Scikit-learn<\/strong>&nbsp;is a free software machine learning library for the Python programming language. It features various classification,&nbsp;<a href=\"https:\/\/quantra.quantinsti.com\/course\/trading-with-machine-learning-regression%20target=\">regression<\/a>&nbsp;and clustering algorithms including&nbsp;<a href=\"https:\/\/quantra.quantinsti.com\/course\/trading-machine-learning-classification-svm\" target=\"_blank\" rel=\"noreferrer noopener\">support vector machines<\/a>.&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Scikit-learn\" target=\"_blank\" rel=\"noreferrer noopener\">Wikipedia<\/a><\/p>\n\n\n\n<p><strong>Matplotlib<\/strong>&nbsp;is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms<\/p>\n\n\n\n<p><strong>Talib<\/strong>&nbsp;is a technical analysis library, which will be used to compute the RSI and Williams %R. These will be used as features for training our artificial neural network. We could add more features using this library.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Importing the dataset<\/strong><\/h4>\n\n\n\n<p>We are going to use daily OHLC data for the stock of Tata Motors trading on NSE for the time period from 1st January 2000 to 30 Aug 2018. We 1st import our dataset .CSV file named \u2018TATAMOTORS.NS.csv\u2019 saved in personal drive in your computer. This is done using the pandas library, and the data is stored in a dataframe named dataset. We then drop the missing values in the dataset using the dropna() function. We choose only the OHLC data from this dataset, which would also contain the Date, Adjusted Close and Volume data. We will be building our input features by using only the OHLC values.<\/p>\n\n\n\n<p>Please note you can also download these data from my github.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"381\" height=\"74\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Importing-dataset-quantinsti.png\" alt=\"\" class=\"wp-image-191553 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Importing-dataset-quantinsti.png 381w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Importing-dataset-quantinsti-300x58.png 300w\" data-sizes=\"(max-width: 381px) 100vw, 381px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 381px; aspect-ratio: 381\/74;\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Preparing the dataset<\/strong><\/h4>\n\n\n\n<p>We then prepare the various input features which will be used by the artificial neural network to train itself for making the predictions. Please note I have limited to only below 8 features, however you should create more to get more accurate result.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>High minus Low price<\/li>\n\n\n\n<li>Close minus Open price<\/li>\n\n\n\n<li>Three day moving average<\/li>\n\n\n\n<li>Ten day moving average<\/li>\n\n\n\n<li>30 day moving average<\/li>\n\n\n\n<li>Standard deviation for a period of 5 days<\/li>\n\n\n\n<li>Relative Strength Index<\/li>\n\n\n\n<li>Williams %R<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"783\" height=\"127\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Prepare-the-dataset-quantinsti.png\" alt=\"\" class=\"wp-image-191556 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Prepare-the-dataset-quantinsti.png 783w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Prepare-the-dataset-quantinsti-700x114.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Prepare-the-dataset-quantinsti-300x49.png 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Prepare-the-dataset-quantinsti-768x125.png 768w\" data-sizes=\"(max-width: 783px) 100vw, 783px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 783px; aspect-ratio: 783\/127;\" \/><\/figure>\n\n\n\n<p>We then define the output value as price rise, which is a binary variable storing 1 when the closing price of tomorrow is greater than the closing price of today.<\/p>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"605\" height=\"25\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Price-Rise-quantinsti.png\" alt=\"\" class=\"wp-image-191565 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Price-Rise-quantinsti.png 605w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Price-Rise-quantinsti-300x12.png 300w\" data-sizes=\"(max-width: 605px) 100vw, 605px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 605px; aspect-ratio: 605\/25;\" \/><\/figure>\n\n\n\n<p>Next, we drop all the rows storing NaN values by using the dropna() function.<\/p>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"191\" height=\"22\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/drop-na-quantinsti.png\" alt=\"\" class=\"wp-image-191568 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 191px; aspect-ratio: 191\/22;\"><\/figure>\n\n\n\n<p>Next, we remove all OHLC data from \u201cdataset\u201d and keep only \u201c8 input features\u201d and \u201cOutput\u201d in a new data frame named as \u201cdata\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"195\" height=\"21\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/data-quantinsti.png\" alt=\"\" class=\"wp-image-191570 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 195px; aspect-ratio: 195\/21;\"><\/figure>\n\n\n\n<p>Next, we make all data in data a np.array.<\/p>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"156\" height=\"76\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/data-np-array-quantinsti.png\" alt=\"\" class=\"wp-image-191571 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 156px; aspect-ratio: 156\/76;\"><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Splitting the dataset<\/strong><\/h4>\n\n\n\n<p>Next, we split the whole dataset into training and test data. The training data contained 1st 80% of the total dataset starting from 01 Jan 2000 and test data contained remaining 20% of data set. The data was not shuffled but sequentially sliced.<\/p>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"398\" height=\"96\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Split-the-dataset-quantinsti.png\" alt=\"\" class=\"wp-image-191572 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Split-the-dataset-quantinsti.png 398w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Split-the-dataset-quantinsti-300x72.png 300w\" data-sizes=\"(max-width: 398px) 100vw, 398px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 398px; aspect-ratio: 398\/96;\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Scaling data &amp; Building X, Y<\/strong><\/h4>\n\n\n\n<p>Another important step in data pre-processing is to standardize the dataset. This process makes the mean of all the input features equal to zero and also converts their variance to 1. This ensures that there is no bias while training the model due to the different scales of all input features. If this is not done the neural network might get confused and give a higher weight to those features which have a higher average value than others. Also, most common activation functions of the network\u2019s neurons such as tanh or sigmoid are defined on the [-1, 1] or [0, 1] interval respectively. Nowadays, rectified linear unit (ReLU) activations are commonly used activations which are unbounded on the axis of possible activation values. However, we will scale both the inputs and targets. We will do Scaling using sklearn\u2019s MinMaxScaler. We instantiate the variable sc with the MinMaxScalerr() function. After which we use the fit &amp; then transform function train and test dataset.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"330\" height=\"64\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/MinMaxScalerr-function-quantinsti.png\" alt=\"\" class=\"wp-image-191573 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/MinMaxScalerr-function-quantinsti.png 330w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/MinMaxScalerr-function-quantinsti-300x58.png 300w\" data-sizes=\"(max-width: 330px) 100vw, 330px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 330px; aspect-ratio: 330\/64;\" \/><\/figure>\n\n\n\n<p>We then split the train and test dataset into X<em>train, y<\/em>train &amp; X<em>test, y<\/em>test. This selects the target and predictors from data<em>train and data<\/em>test. The target which is price rise (y<em>train &amp; y<\/em>test) is located in the last column of data<em>train\/test, the predictors which 8 features (X<\/em>train &amp; X<em>test) from 1st column to 8th column data<\/em>train\/test. The whole dataset will look like below.<\/p>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"229\" height=\"67\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Dataset1-quantinsti.png\" alt=\"\" class=\"wp-image-191575 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 229px; aspect-ratio: 229\/67;\"><\/figure>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"218\" height=\"121\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/Dataset2-quantinsti.png\" alt=\"\" class=\"wp-image-191576 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 218px; aspect-ratio: 218\/121;\"><\/figure>\n\n\n\n<p>This is an essential part of any&nbsp;machine learning&nbsp;algorithm, the training data is used by the model to arrive at the weights of the model. The test dataset is used to see how the model will perform on new data which would be fed into the model. The test dataset also has the actual value for the output, which helps us in understanding how efficient the model is. Now that the datasets are ready, we may proceed with building the Artificial Neural Network using the TensorFlow library. <\/p>\n\n\n\n<p><em>Visit <a href=\"https:\/\/blog.quantinsti.com\/deep-learning-artificial-neural-network-tensorflow-python\/\">QuantInsti<\/a> to read about <strong>Building The Artificial Neural Network<\/strong>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we are going to develop a machine learning technique called Deep learning (Artificial Neural network) by using tensor flow and predicting stock price in python. <\/p>\n","protected":false},"author":1168,"featured_media":40151,"comment_status":"open","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,349,338],"tags":[851,15395,806,2105,4659,1225,1224,595,4412,5482,924],"contributors-categories":[13654],"class_list":{"0":"post-191549","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-python-development","10":"category-ibkr-quant-news","11":"tag-algo-trading","12":"tag-artificial-neural-network","13":"tag-data-science","14":"tag-deep-learning","15":"tag-matplotlib","16":"tag-numpy","17":"tag-pandas","18":"tag-python","19":"tag-scikit-learn","20":"tag-talib","21":"tag-tensorflow","22":"contributors-categories-quantinsti"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Deep Learning &#8211; Artificial Neural Network Using TensorFlow In Python<\/title>\n<meta name=\"description\" content=\"In this article, we are going to develop a machine learning technique called Deep learning (Artificial Neural network) by using tensor flow and...\" \/>\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.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/191549\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deep Learning - Artificial Neural Network Using TensorFlow In Python | IBKR Campus US\" \/>\n<meta property=\"og:description\" content=\"In this article, we are going to develop a machine learning technique called Deep learning (Artificial Neural network) by using tensor flow and predicting stock price in python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-07T14:52:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-07T14:52:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/deep-learning-serve.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Umesh Palai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Umesh Palai\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/deep-learning-artificial-neural-network-using-tensorflow-in-python\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/deep-learning-artificial-neural-network-using-tensorflow-in-python\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Umesh Palai\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/13e3cdfcb57f8c058eea04467b9750bc\"\n\t            },\n\t            \"headline\": \"Deep Learning &#8211; Artificial Neural Network Using TensorFlow In Python\",\n\t            \"datePublished\": \"2023-06-07T14:52:34+00:00\",\n\t            \"dateModified\": \"2023-06-07T14:52:36+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/deep-learning-artificial-neural-network-using-tensorflow-in-python\\\/\"\n\t            },\n\t            \"wordCount\": 989,\n\t            \"commentCount\": 0,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/deep-learning-artificial-neural-network-using-tensorflow-in-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/03\\\/deep-learning-serve.jpg\",\n\t            \"keywords\": [\n\t                \"Algo Trading\",\n\t                \"Artificial Neural network\",\n\t                \"Data Science\",\n\t                \"Deep Learning\",\n\t                \"Matplotlib\",\n\t                \"NumPy\",\n\t                \"Pandas\",\n\t                \"Python\",\n\t                \"Scikit-learn\",\n\t                \"Talib\",\n\t                \"TensorFlow\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\"\n\t            ],\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"CommentAction\",\n\t                    \"name\": \"Comment\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/deep-learning-artificial-neural-network-using-tensorflow-in-python\\\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/deep-learning-artificial-neural-network-using-tensorflow-in-python\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/deep-learning-artificial-neural-network-using-tensorflow-in-python\\\/\",\n\t            \"name\": \"Deep Learning - Artificial Neural Network Using TensorFlow In Python | IBKR Campus US\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/deep-learning-artificial-neural-network-using-tensorflow-in-python\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/deep-learning-artificial-neural-network-using-tensorflow-in-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/03\\\/deep-learning-serve.jpg\",\n\t            \"datePublished\": \"2023-06-07T14:52:34+00:00\",\n\t            \"dateModified\": \"2023-06-07T14:52:36+00:00\",\n\t            \"description\": \"In this article, we are going to develop a machine learning technique called Deep learning (Artificial Neural network) by using tensor flow and predicting stock price in python.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/deep-learning-artificial-neural-network-using-tensorflow-in-python\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/deep-learning-artificial-neural-network-using-tensorflow-in-python\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/03\\\/deep-learning-serve.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/03\\\/deep-learning-serve.jpg\",\n\t            \"width\": 900,\n\t            \"height\": 550,\n\t            \"caption\": \"Deep Learning in Finance\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/13e3cdfcb57f8c058eea04467b9750bc\",\n\t            \"name\": \"Umesh Palai\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/umesh-palai\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Deep Learning &#8211; Artificial Neural Network Using TensorFlow In Python","description":"In this article, we are going to develop a machine learning technique called Deep learning (Artificial Neural network) by using tensor flow and...","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.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/191549\/","og_locale":"en_US","og_type":"article","og_title":"Deep Learning - Artificial Neural Network Using TensorFlow In Python | IBKR Campus US","og_description":"In this article, we are going to develop a machine learning technique called Deep learning (Artificial Neural network) by using tensor flow and predicting stock price in python.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/","og_site_name":"IBKR Campus US","article_published_time":"2023-06-07T14:52:34+00:00","article_modified_time":"2023-06-07T14:52:36+00:00","og_image":[{"width":900,"height":550,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/deep-learning-serve.jpg","type":"image\/jpeg"}],"author":"Umesh Palai","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Umesh Palai","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/"},"author":{"name":"Umesh Palai","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/13e3cdfcb57f8c058eea04467b9750bc"},"headline":"Deep Learning &#8211; Artificial Neural Network Using TensorFlow In Python","datePublished":"2023-06-07T14:52:34+00:00","dateModified":"2023-06-07T14:52:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/"},"wordCount":989,"commentCount":0,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/deep-learning-serve.jpg","keywords":["Algo Trading","Artificial Neural network","Data Science","Deep Learning","Matplotlib","NumPy","Pandas","Python","Scikit-learn","Talib","TensorFlow"],"articleSection":["Data Science","Programming Languages","Python Development","Quant"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/","name":"Deep Learning - Artificial Neural Network Using TensorFlow In Python | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/deep-learning-serve.jpg","datePublished":"2023-06-07T14:52:34+00:00","dateModified":"2023-06-07T14:52:36+00:00","description":"In this article, we are going to develop a machine learning technique called Deep learning (Artificial Neural network) by using tensor flow and predicting stock price in python.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/deep-learning-artificial-neural-network-using-tensorflow-in-python\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/deep-learning-serve.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/deep-learning-serve.jpg","width":900,"height":550,"caption":"Deep Learning in Finance"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/13e3cdfcb57f8c058eea04467b9750bc","name":"Umesh Palai","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/umesh-palai\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/deep-learning-serve.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/191549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/1168"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=191549"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/191549\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/40151"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=191549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=191549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=191549"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=191549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}