SlideShare a Scribd company logo
1 of 1
Download to read offline
In the Python file, you will be creating a neural network to predict the price of a stock. Part of the
program is already implemented, your goal is to set up the model, train the model on the training
data set, then finally predict the values from the testing data set. You should create a Sequential
model with 5 layers. Your model should use 2 LSTM layers, and after each use a Dropout layer
with a rate of 0.2. The first LSTM layer should have input_shape as a parameter along with units
set to 4. The final layer should be a Dense layer with units set to 1. Once the model is set up, you
should compile it with a mean_squared_error loss and the optimizer set to adam. When you fit the
training dataset, make sure to set the following values: epochs=5, batch_size=16, verbose=0
Finally, you should run the predict function on the x_test dataset and print the last column of the
array along with the model summary.

More Related Content

Similar to In the Python file you will be creating a neural network to.pdf

Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docx
fredharris32
 
Declaring a PointerTo define a pointer, use an asterisk, (), in t.pdf
Declaring a PointerTo define a pointer, use an asterisk, (), in t.pdfDeclaring a PointerTo define a pointer, use an asterisk, (), in t.pdf
Declaring a PointerTo define a pointer, use an asterisk, (), in t.pdf
malavshah9013
 
modelling and simulation of second order mechanical system
modelling and simulation of second order mechanical systemmodelling and simulation of second order mechanical system
modelling and simulation of second order mechanical system
sanmudo
 
Reaction StatisticsBackgroundWhen collecting experimental data f.pdf
Reaction StatisticsBackgroundWhen collecting experimental data f.pdfReaction StatisticsBackgroundWhen collecting experimental data f.pdf
Reaction StatisticsBackgroundWhen collecting experimental data f.pdf
fashionbigchennai
 

Similar to In the Python file you will be creating a neural network to.pdf (19)

Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docx
 
House price prediction
House price predictionHouse price prediction
House price prediction
 
projectreport
projectreportprojectreport
projectreport
 
Lab5
Lab5Lab5
Lab5
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
 
Java conceptual learning material
Java conceptual learning materialJava conceptual learning material
Java conceptual learning material
 
Mat-lab image processing tatorial
Mat-lab  image processing tatorialMat-lab  image processing tatorial
Mat-lab image processing tatorial
 
interfacing matlab with embedded systems
interfacing matlab with embedded systemsinterfacing matlab with embedded systems
interfacing matlab with embedded systems
 
Declaring a PointerTo define a pointer, use an asterisk, (), in t.pdf
Declaring a PointerTo define a pointer, use an asterisk, (), in t.pdfDeclaring a PointerTo define a pointer, use an asterisk, (), in t.pdf
Declaring a PointerTo define a pointer, use an asterisk, (), in t.pdf
 
Introductio2.docx
Introductio2.docxIntroductio2.docx
Introductio2.docx
 
Anything but simple Mathematica
Anything but simple MathematicaAnything but simple Mathematica
Anything but simple Mathematica
 
Automated Machine Learning (Auto ML)
Automated Machine Learning (Auto ML)Automated Machine Learning (Auto ML)
Automated Machine Learning (Auto ML)
 
DLT UNIT-3.docx
DLT  UNIT-3.docxDLT  UNIT-3.docx
DLT UNIT-3.docx
 
modelling and simulation of second order mechanical system
modelling and simulation of second order mechanical systemmodelling and simulation of second order mechanical system
modelling and simulation of second order mechanical system
 
Reaction StatisticsBackgroundWhen collecting experimental data f.pdf
Reaction StatisticsBackgroundWhen collecting experimental data f.pdfReaction StatisticsBackgroundWhen collecting experimental data f.pdf
Reaction StatisticsBackgroundWhen collecting experimental data f.pdf
 
Maxbox starter
Maxbox starterMaxbox starter
Maxbox starter
 
Ecet 370 week 1 lab
Ecet 370 week 1 labEcet 370 week 1 lab
Ecet 370 week 1 lab
 
Matlab Tutorial.ppt
Matlab Tutorial.pptMatlab Tutorial.ppt
Matlab Tutorial.ppt
 
Stackpirt20170222
Stackpirt20170222Stackpirt20170222
Stackpirt20170222
 

More from spsvirdi

in this case we chose the best option would be to work with .pdf
in this case we chose the best option would be to work with .pdfin this case we chose the best option would be to work with .pdf
in this case we chose the best option would be to work with .pdf
spsvirdi
 
In the Solutions column identify as a team possible solut.pdf
In the Solutions column identify as a team possible solut.pdfIn the Solutions column identify as a team possible solut.pdf
In the Solutions column identify as a team possible solut.pdf
spsvirdi
 

More from spsvirdi (18)

In what ways did the evolution of an exoskeleton help insect.pdf
In what ways did the evolution of an exoskeleton help insect.pdfIn what ways did the evolution of an exoskeleton help insect.pdf
In what ways did the evolution of an exoskeleton help insect.pdf
 
In which external environments do changes usually occur mo.pdf
In which external environments do changes usually occur mo.pdfIn which external environments do changes usually occur mo.pdf
In which external environments do changes usually occur mo.pdf
 
In this era of tough economic conditions voters increasingl.pdf
In this era of tough economic conditions voters increasingl.pdfIn this era of tough economic conditions voters increasingl.pdf
In this era of tough economic conditions voters increasingl.pdf
 
In user interface design what is typically TRUE Group of a.pdf
In user interface design what is typically TRUE Group of a.pdfIn user interface design what is typically TRUE Group of a.pdf
In user interface design what is typically TRUE Group of a.pdf
 
In week 23 and 4 we will look at travel trade from the pers.pdf
In week 23 and 4 we will look at travel trade from the pers.pdfIn week 23 and 4 we will look at travel trade from the pers.pdf
In week 23 and 4 we will look at travel trade from the pers.pdf
 
In use cases an association aka communication relationshi.pdf
In use cases an association aka communication relationshi.pdfIn use cases an association aka communication relationshi.pdf
In use cases an association aka communication relationshi.pdf
 
In use cases an inheritance relationship is A relationship .pdf
In use cases an inheritance relationship is A relationship .pdfIn use cases an inheritance relationship is A relationship .pdf
In use cases an inheritance relationship is A relationship .pdf
 
In their article summarizing how one company rooted out bias.pdf
In their article summarizing how one company rooted out bias.pdfIn their article summarizing how one company rooted out bias.pdf
In their article summarizing how one company rooted out bias.pdf
 
In Unit Seven the Redfield ratio is defined Based on this .pdf
In Unit Seven the Redfield ratio is defined Based on this .pdfIn Unit Seven the Redfield ratio is defined Based on this .pdf
In Unit Seven the Redfield ratio is defined Based on this .pdf
 
in this case we chose the best option would be to work with .pdf
in this case we chose the best option would be to work with .pdfin this case we chose the best option would be to work with .pdf
in this case we chose the best option would be to work with .pdf
 
In the United States in 2017 approximately what percentage .pdf
In the United States in 2017 approximately what percentage .pdfIn the United States in 2017 approximately what percentage .pdf
In the United States in 2017 approximately what percentage .pdf
 
In the video Bob Williams talks about setting up a factory .pdf
In the video Bob Williams talks about setting up a factory .pdfIn the video Bob Williams talks about setting up a factory .pdf
In the video Bob Williams talks about setting up a factory .pdf
 
In this discussion reflect on the head of the IT department.pdf
In this discussion reflect on the head of the IT department.pdfIn this discussion reflect on the head of the IT department.pdf
In this discussion reflect on the head of the IT department.pdf
 
In the ZW sexdetermination system for birds males ZZ are.pdf
In the ZW sexdetermination system for birds males ZZ are.pdfIn the ZW sexdetermination system for birds males ZZ are.pdf
In the ZW sexdetermination system for birds males ZZ are.pdf
 
In the Stanford Journal of law Businessamp Finance expla.pdf
In the Stanford Journal of law Businessamp Finance expla.pdfIn the Stanford Journal of law Businessamp Finance expla.pdf
In the Stanford Journal of law Businessamp Finance expla.pdf
 
In the vertebrate brain each region is specialized in funct.pdf
In the vertebrate brain each region is specialized in funct.pdfIn the vertebrate brain each region is specialized in funct.pdf
In the vertebrate brain each region is specialized in funct.pdf
 
In the Solutions column identify as a team possible solut.pdf
In the Solutions column identify as a team possible solut.pdfIn the Solutions column identify as a team possible solut.pdf
In the Solutions column identify as a team possible solut.pdf
 
In the tugofwar for policy attention elected officials of.pdf
In the tugofwar for policy attention elected officials of.pdfIn the tugofwar for policy attention elected officials of.pdf
In the tugofwar for policy attention elected officials of.pdf
 

Recently uploaded

Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 

Recently uploaded (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

In the Python file you will be creating a neural network to.pdf

  • 1. In the Python file, you will be creating a neural network to predict the price of a stock. Part of the program is already implemented, your goal is to set up the model, train the model on the training data set, then finally predict the values from the testing data set. You should create a Sequential model with 5 layers. Your model should use 2 LSTM layers, and after each use a Dropout layer with a rate of 0.2. The first LSTM layer should have input_shape as a parameter along with units set to 4. The final layer should be a Dense layer with units set to 1. Once the model is set up, you should compile it with a mean_squared_error loss and the optimizer set to adam. When you fit the training dataset, make sure to set the following values: epochs=5, batch_size=16, verbose=0 Finally, you should run the predict function on the x_test dataset and print the last column of the array along with the model summary.