SlideShare a Scribd company logo
1 of 18
“Regression Model and Artificial
Neural Network for Predictive
Analytics using R”
By
Vaibhav Kumar
Assistant Professor
Dept. of CSE
DIT University, Dehradun
Vaibhav Kumar@DIT University, Dehradun
Outline
 Introduction
 Predictive Analytics
 Predictive Analytics Techniques
 Regression Models in Prediction
 Machine Learning Models in Prediction
 Stock Market Prediction
 Prediction using Regression Model
 Prediction using Artificial Neural Network
 Comparison
 Conclusion
Vaibhav Kumar@DIT University, Dehradun
Introduction
 On the basis of several input attributes, the value of an output attribute can be
determined through a model which formulates the relationship between these input and
output attributes.
 There are many real life examples such as weather condition, dearness etc. where we see
that many independent variables which affects the future value of a dependent variable.
 To model this dependency of a variable on other variables, there are a variety of methods
available.
 Statistics, one of the premier field of mathematics, has given many methods to formulate
the relationship between variables.
 The developments in the field of Computer Science have given many intelligent
algorithms, which are known as machine learning. It simulates the human learning
process.
Vaibhav Kumar@DIT University, Dehradun
Introduction
 There are a variety of machine learning models which use the concept of statistics and
process the data intelligently with the speed of computer in order to generate a fast and
accurate result.
 Research and development in the field of machine learning of is going on a full swing and
continuously proposing a much faster and accurate result.
 A new field in the area of computer science is on boom – Data Science. It leverages the
capabilities of statistical and machine learning tools and works on data.
 Industries are using data science to grow their businesses.
Vaibhav Kumar@DIT University, Dehradun
Predictive Analytics
 Predictive analytics, a branch in the domain of advanced analytics, is used in predicting
the future events.
 It analyze the current and historical data in order to make predictions about the future by
employing the techniques from statistics, data mining, machine learning, and artificial
intelligence.
 It brings together the information technology, business modeling process and
management to make prediction about the future.
 Businesses can appropriately use big data for their profit by successfully applying the
predictive analytics.
 It can help organizations in becoming proactive, forward looking and anticipating trends
or behavior based on the data.
Vaibhav Kumar@DIT University, Dehradun
Predictive Analytics
 Predictive analytics has a wide range of application in many domains.
 It is widely used in e-commerce business to find the customer behaviors and offer them a
customized solution.
 Insurance companies collect the data of working professional from a third party and
identifies which type of working professional would be interested in which type of
insurance plan and they approach them to attract towards its products.
 Banking companies apply predictive analytics models to identify credit card risks and
fraudulent customer and become alert from those type of customers.
 Organizations involved in financial investments identify the stocks which may give a good
return on their investment and they even predict the future performance of stocks based
on the past and current performance.
 There are many other applications.
Vaibhav Kumar@DIT University, Dehradun
Predictive Analytics Techniques
All predictive analytics techniques are grouped into two categories:-
1. Classification Techniques: The class of a new observation is assigned based on the class
assignment of past observations. All the techniques used in this category give the discrete
output. For Example: Class A or Class B if there are two classes to classify the
observations.
2. Regression Techniques: Models used in the techniques give a continuous output. It
predicts a number. For example Temperature today at 08:00 PM.
Vaibhav Kumar@DIT University, Dehradun
Regression Models in Prediction
 Regression is one of the most popular statistical technique which estimates the
relationship among variables.
 It models the relationship between a dependent variable and one or more independent
variables.
 It analyzes how the value of a dependent variable changes on changing the values of
independent variables in the modeled relation.
 There are two types of regression models used in predictive analytics:-
1. Linear Regression Model (as a regression model)
2. Logistic Regression Model (as a classification model)
Vaibhav Kumar@DIT University, Dehradun
Machine Learning Models in Prediction
 Machine learning is an application of artificial intelligence (AI) that provides systems the ability
to automatically learn and improve from experience without being explicitly programmed.
 Machine learning focuses on the development of computer programs that can access data and
use it learn for themselves.
 There are variety of machine learning model used in predictive analytics:-
 Artificial Neural Network
 Decision Tree
 Support Vector Machine
 Gradient Boosting
 Random Forest
 Many other
Vaibhav Kumar@DIT University, Dehradun
Stock Market Prediction
 Machine learning models have a dominating role in financial applications.
 In predicting the prices and trends in stock, machine learning techniques have always
been dominating among all the predictive analytics techniques.
 This is only because of fast computing algorithms and working on large datasets.
 Many of the stock market-based organization use machine learning models for predicting
the stock prices.
 An accurate prediction of future prices may lead to higher yield of profit to investors
through stock investments.
 As per the prediction, the investor shall be able to pick the stocks which may give a higher
return.
Vaibhav Kumar@DIT University, Dehradun
Prediction using Regression Model
 Lets consider an example of stock market prediction. Please refer to the following data
set.
Vaibhav Kumar@DIT University, Dehradun
 First take the historical data of all the attributes for same duration.
 Normalize the data.
 Fetch the data in Rstudio
> data=read.csv(“filename.csv”)
 Split the data set into two sets– training set and test set.
> tr.data=data[1:380,]
> ts.data=data[381:495,]
Set the independent and dependent variables.
> y=tr.data$DAY_CLOSE
>x=tr.data$SENSEX+tr.data$NIFTY.50+tr.data$ST_52_High+tr.data$ST_52_Low+tr.data$PREV_
CLOSE+tr.data$DOLLAR+tr.data$CRUDE+tr.data$HANG_SENG+tr.data$DAX+tr.data$SENT_SCR
> reg.model=lm(y~x)
> print(summary(reg.model))
Vaibhav Kumar@DIT University, Dehradun
 Prepare the test data.
>x=ts.data$SENSEX+ts.data$NIFTY.50+ts.data$ST_52_High+ts.data$ST_52_Low+ts.data$PREV
_CLOSE+ts.data$DOLLAR+ts.data$CRUDE+ts.data$HANG_SENG+ts.data$DAX+ts.data$SENT_S
CR
> result=predict(reg.model,data.frame(x))
> res=as.data.frame(result)
> test.y=ts.data$DAY_CLOSE
> test.x=result
Find the correlation between original values and the predicted values
> cor(test.x,test.y)
It can also be visualized through a graph.
> plot(test.x,test.y, abline(lm(test.y~test.x))
Vaibhav Kumar@DIT University, Dehradun
Artificial Neural Network
 Artificial Neural Network (ANN) is a machine learning tool.
 It is inspired by biological neural network of brain.
 Billion of neurons are connected together in the brain. They receive electrochemical
signals from neighboring neurons, they process it and forward it to the next neighboring
neurons in the network.
 Similar to the biological neurons, artificial neurons are connected together to form the
artificial neural network.
 The network process the data in patterns rather than executing sequential information.
 As information is stored in brain as strengths of synaptic gaps between neurons, similarly
the knowledge is stored in ANN as weights associated with the interconnection between
artificial neurons.
Vaibhav Kumar@DIT University, Dehradun
Introduction (Cont….)
Vaibhav Kumar@DIT University, Dehradun
Structure of an artificial neuron is shown in the above figure. The net input yin to the
neuron can be given as:
yin = b+x1w1+x2w2+…..+xnwn
Or, yin = 𝑖=1
𝑛
xiwi
where b is the bias term. The output of the neuron can be given as:
yout = f(yin)
Where f(.) is called the activation or transfer function of the neuron. This function is
used as per the required output.
Learning
 The main goal of neural network is to solve the problems through learning which are
complex to solve by human.
 In all the neural net learning methods, weights of the network are adjusted.
 There are a variety if learning algorithms used by neural networks to solve problems.
 Some popular neural network learning algorithms are:
 Backpropagation Learning
 Hebbian learning Supervised Learning
 Perceptron Learning
 Delta/Least Mean Square learning
 Winner-Takes-All Unsupervised Learning
Vaibhav Kumar@DIT University, Dehradun
Application in Stock Market Prediction
 The input attributes of the dataset will be applied at the input layer of the neural network
and the day’s closing price of stock will be obtained at the output layer.
> library("neuralnet")
>f=tr.data$DAY_CLOSE~tr.data$SENSEX+tr.data$NIFTY.50+tr.data$ST_52_High+tr.data$ST_52_
Low+tr.data$PREV_CLOSE+tr.data$DOLLAR+tr.data$CRUDE+tr.data$HANG_SENG+tr.data$DAX
+tr.data$SENT_SCR
> net=neuralnet(f,tr.data,hidden = 12, algorithm = "rprop+", act.fct = "logistic", linear.output =
TRUE, lifesign.step = 1000)
> summary(net)
> plot(net)
> tt.x=ts.data[,1:10]
> result=compute(net,tt.x)
> cor(ts.data$DAY_CLOSE,result$net.result)
Vaibhav Kumar@DIT University, Dehradun
Thank You
Vaibhav Kumar@DIT University, Dehradun

More Related Content

What's hot

Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modelingrabiya Ashiq
 
final ppt -ORIGINAL_Facial_Emotion_Detection special topic -2 review 1-1 (1) ...
final ppt -ORIGINAL_Facial_Emotion_Detection special topic -2 review 1-1 (1) ...final ppt -ORIGINAL_Facial_Emotion_Detection special topic -2 review 1-1 (1) ...
final ppt -ORIGINAL_Facial_Emotion_Detection special topic -2 review 1-1 (1) ...SharaneshUpase1
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
Reflex and model based agents
Reflex and model based agentsReflex and model based agents
Reflex and model based agentsMegha Sharma
 
Facial Emoji Recognition
Facial Emoji RecognitionFacial Emoji Recognition
Facial Emoji Recognitionijtsrd
 
Emotion based music player
Emotion based music playerEmotion based music player
Emotion based music playerNizam Muhammed
 
FAKE CURRENCY DETECTION PDF NEW PPT.pptx
FAKE CURRENCY DETECTION PDF NEW PPT.pptxFAKE CURRENCY DETECTION PDF NEW PPT.pptx
FAKE CURRENCY DETECTION PDF NEW PPT.pptxBasavaPrabhu14
 
IRJET- Crop Yield Prediction based on Climatic Parameters
IRJET- Crop Yield Prediction based on Climatic ParametersIRJET- Crop Yield Prediction based on Climatic Parameters
IRJET- Crop Yield Prediction based on Climatic ParametersIRJET Journal
 
Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determinationPatel Punit
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsNuruzzaman Milon
 
Fault avoidance and fault tolerance
Fault avoidance and fault toleranceFault avoidance and fault tolerance
Fault avoidance and fault toleranceJabez Winston
 
Software engineering critical systems
Software engineering   critical systemsSoftware engineering   critical systems
Software engineering critical systemsDr. Loganathan R
 
Scan line method
Scan line methodScan line method
Scan line methodPooja Dixit
 
Basic Software Effort Estimation
Basic Software Effort EstimationBasic Software Effort Estimation
Basic Software Effort Estimationumair khan
 
software-effort_estimation(updated)9 ch05
 software-effort_estimation(updated)9 ch05 software-effort_estimation(updated)9 ch05
software-effort_estimation(updated)9 ch05Shahid Riaz
 
Computer Graphics 471 Project Report Final
Computer Graphics 471 Project Report FinalComputer Graphics 471 Project Report Final
Computer Graphics 471 Project Report FinalAli Ahmed
 
Delphi cost estimation model
Delphi cost estimation modelDelphi cost estimation model
Delphi cost estimation modelShashwat Shriparv
 

What's hot (20)

Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
 
final ppt -ORIGINAL_Facial_Emotion_Detection special topic -2 review 1-1 (1) ...
final ppt -ORIGINAL_Facial_Emotion_Detection special topic -2 review 1-1 (1) ...final ppt -ORIGINAL_Facial_Emotion_Detection special topic -2 review 1-1 (1) ...
final ppt -ORIGINAL_Facial_Emotion_Detection special topic -2 review 1-1 (1) ...
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Reflex and model based agents
Reflex and model based agentsReflex and model based agents
Reflex and model based agents
 
Facial Emoji Recognition
Facial Emoji RecognitionFacial Emoji Recognition
Facial Emoji Recognition
 
Spm unit2
Spm unit2Spm unit2
Spm unit2
 
Emotion based music player
Emotion based music playerEmotion based music player
Emotion based music player
 
FAKE CURRENCY DETECTION PDF NEW PPT.pptx
FAKE CURRENCY DETECTION PDF NEW PPT.pptxFAKE CURRENCY DETECTION PDF NEW PPT.pptx
FAKE CURRENCY DETECTION PDF NEW PPT.pptx
 
IRJET- Crop Yield Prediction based on Climatic Parameters
IRJET- Crop Yield Prediction based on Climatic ParametersIRJET- Crop Yield Prediction based on Climatic Parameters
IRJET- Crop Yield Prediction based on Climatic Parameters
 
Z buffer
Z bufferZ buffer
Z buffer
 
Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determination
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic Agents
 
Fault avoidance and fault tolerance
Fault avoidance and fault toleranceFault avoidance and fault tolerance
Fault avoidance and fault tolerance
 
Software engineering critical systems
Software engineering   critical systemsSoftware engineering   critical systems
Software engineering critical systems
 
Scan line method
Scan line methodScan line method
Scan line method
 
Basic Software Effort Estimation
Basic Software Effort EstimationBasic Software Effort Estimation
Basic Software Effort Estimation
 
software-effort_estimation(updated)9 ch05
 software-effort_estimation(updated)9 ch05 software-effort_estimation(updated)9 ch05
software-effort_estimation(updated)9 ch05
 
Computer Graphics 471 Project Report Final
Computer Graphics 471 Project Report FinalComputer Graphics 471 Project Report Final
Computer Graphics 471 Project Report Final
 
Digital Forensic Case Study
Digital Forensic Case StudyDigital Forensic Case Study
Digital Forensic Case Study
 
Delphi cost estimation model
Delphi cost estimation modelDelphi cost estimation model
Delphi cost estimation model
 

Similar to Regression and Artificial Neural Network in R

Machine learning in Data Science
Machine learning in Data ScienceMachine learning in Data Science
Machine learning in Data ScienceDr. Vaibhav Kumar
 
Regression with Microsoft Azure & Ms Excel
Regression with Microsoft Azure & Ms ExcelRegression with Microsoft Azure & Ms Excel
Regression with Microsoft Azure & Ms ExcelDr. Abdul Ahad Abro
 
IRJET- Sentiment Analysis to Segregate Attributes using Machine Learning Tech...
IRJET- Sentiment Analysis to Segregate Attributes using Machine Learning Tech...IRJET- Sentiment Analysis to Segregate Attributes using Machine Learning Tech...
IRJET- Sentiment Analysis to Segregate Attributes using Machine Learning Tech...IRJET Journal
 
CUSTOMER CHURN PREDICTION
CUSTOMER CHURN PREDICTIONCUSTOMER CHURN PREDICTION
CUSTOMER CHURN PREDICTIONIRJET Journal
 
Survey on Techniques for Predictive Analysis of Student Grades and Career
Survey on Techniques for Predictive Analysis of Student Grades and CareerSurvey on Techniques for Predictive Analysis of Student Grades and Career
Survey on Techniques for Predictive Analysis of Student Grades and CareerIRJET Journal
 
IRJET- Machine Learning: Survey, Types and Challenges
IRJET- Machine Learning: Survey, Types and ChallengesIRJET- Machine Learning: Survey, Types and Challenges
IRJET- Machine Learning: Survey, Types and ChallengesIRJET Journal
 
Industrial training ppt
Industrial training pptIndustrial training ppt
Industrial training pptHRJEETSINGH
 
IRJET - A Survey on Machine Learning Algorithms, Techniques and Applications
IRJET - A Survey on Machine Learning Algorithms, Techniques and ApplicationsIRJET - A Survey on Machine Learning Algorithms, Techniques and Applications
IRJET - A Survey on Machine Learning Algorithms, Techniques and ApplicationsIRJET Journal
 
Student Performance Predictor
Student Performance PredictorStudent Performance Predictor
Student Performance PredictorIRJET Journal
 
Hybrid-Training & Placement Management with Prediction System
Hybrid-Training & Placement Management with Prediction SystemHybrid-Training & Placement Management with Prediction System
Hybrid-Training & Placement Management with Prediction SystemIRJET Journal
 
IRJET- Prediction of Crime Rate Analysis using Supervised Classification Mach...
IRJET- Prediction of Crime Rate Analysis using Supervised Classification Mach...IRJET- Prediction of Crime Rate Analysis using Supervised Classification Mach...
IRJET- Prediction of Crime Rate Analysis using Supervised Classification Mach...IRJET Journal
 
Post Graduate Admission Prediction System
Post Graduate Admission Prediction SystemPost Graduate Admission Prediction System
Post Graduate Admission Prediction SystemIRJET Journal
 
IRJET- Stabilization of Black Cotton Soil using Rice Husk Ash and Lime
IRJET- Stabilization of Black Cotton Soil using Rice Husk Ash and LimeIRJET- Stabilization of Black Cotton Soil using Rice Husk Ash and Lime
IRJET- Stabilization of Black Cotton Soil using Rice Husk Ash and LimeIRJET Journal
 
IRJET- Student Placement Prediction using Machine Learning
IRJET- Student Placement Prediction using Machine LearningIRJET- Student Placement Prediction using Machine Learning
IRJET- Student Placement Prediction using Machine LearningIRJET Journal
 
A Survey on Machine Learning Algorithms
A Survey on Machine Learning AlgorithmsA Survey on Machine Learning Algorithms
A Survey on Machine Learning AlgorithmsAM Publications
 
A survey of modified support vector machine using particle of swarm optimizat...
A survey of modified support vector machine using particle of swarm optimizat...A survey of modified support vector machine using particle of swarm optimizat...
A survey of modified support vector machine using particle of swarm optimizat...Editor Jacotech
 
MACHINE LEARNING CLASSIFIERS TO ANALYZE CREDIT RISK
MACHINE LEARNING CLASSIFIERS TO ANALYZE CREDIT RISKMACHINE LEARNING CLASSIFIERS TO ANALYZE CREDIT RISK
MACHINE LEARNING CLASSIFIERS TO ANALYZE CREDIT RISKIRJET Journal
 

Similar to Regression and Artificial Neural Network in R (20)

Machine learning in Data Science
Machine learning in Data ScienceMachine learning in Data Science
Machine learning in Data Science
 
Regression with Microsoft Azure & Ms Excel
Regression with Microsoft Azure & Ms ExcelRegression with Microsoft Azure & Ms Excel
Regression with Microsoft Azure & Ms Excel
 
IRJET- Sentiment Analysis to Segregate Attributes using Machine Learning Tech...
IRJET- Sentiment Analysis to Segregate Attributes using Machine Learning Tech...IRJET- Sentiment Analysis to Segregate Attributes using Machine Learning Tech...
IRJET- Sentiment Analysis to Segregate Attributes using Machine Learning Tech...
 
CUSTOMER CHURN PREDICTION
CUSTOMER CHURN PREDICTIONCUSTOMER CHURN PREDICTION
CUSTOMER CHURN PREDICTION
 
Eckovation Machine Learning
Eckovation Machine LearningEckovation Machine Learning
Eckovation Machine Learning
 
Survey on Techniques for Predictive Analysis of Student Grades and Career
Survey on Techniques for Predictive Analysis of Student Grades and CareerSurvey on Techniques for Predictive Analysis of Student Grades and Career
Survey on Techniques for Predictive Analysis of Student Grades and Career
 
IRJET- Machine Learning: Survey, Types and Challenges
IRJET- Machine Learning: Survey, Types and ChallengesIRJET- Machine Learning: Survey, Types and Challenges
IRJET- Machine Learning: Survey, Types and Challenges
 
Industrial training ppt
Industrial training pptIndustrial training ppt
Industrial training ppt
 
Machine Learning.pptx
Machine Learning.pptxMachine Learning.pptx
Machine Learning.pptx
 
IRJET - A Survey on Machine Learning Algorithms, Techniques and Applications
IRJET - A Survey on Machine Learning Algorithms, Techniques and ApplicationsIRJET - A Survey on Machine Learning Algorithms, Techniques and Applications
IRJET - A Survey on Machine Learning Algorithms, Techniques and Applications
 
Student Performance Predictor
Student Performance PredictorStudent Performance Predictor
Student Performance Predictor
 
Hybrid-Training & Placement Management with Prediction System
Hybrid-Training & Placement Management with Prediction SystemHybrid-Training & Placement Management with Prediction System
Hybrid-Training & Placement Management with Prediction System
 
Ew36913917
Ew36913917Ew36913917
Ew36913917
 
IRJET- Prediction of Crime Rate Analysis using Supervised Classification Mach...
IRJET- Prediction of Crime Rate Analysis using Supervised Classification Mach...IRJET- Prediction of Crime Rate Analysis using Supervised Classification Mach...
IRJET- Prediction of Crime Rate Analysis using Supervised Classification Mach...
 
Post Graduate Admission Prediction System
Post Graduate Admission Prediction SystemPost Graduate Admission Prediction System
Post Graduate Admission Prediction System
 
IRJET- Stabilization of Black Cotton Soil using Rice Husk Ash and Lime
IRJET- Stabilization of Black Cotton Soil using Rice Husk Ash and LimeIRJET- Stabilization of Black Cotton Soil using Rice Husk Ash and Lime
IRJET- Stabilization of Black Cotton Soil using Rice Husk Ash and Lime
 
IRJET- Student Placement Prediction using Machine Learning
IRJET- Student Placement Prediction using Machine LearningIRJET- Student Placement Prediction using Machine Learning
IRJET- Student Placement Prediction using Machine Learning
 
A Survey on Machine Learning Algorithms
A Survey on Machine Learning AlgorithmsA Survey on Machine Learning Algorithms
A Survey on Machine Learning Algorithms
 
A survey of modified support vector machine using particle of swarm optimizat...
A survey of modified support vector machine using particle of swarm optimizat...A survey of modified support vector machine using particle of swarm optimizat...
A survey of modified support vector machine using particle of swarm optimizat...
 
MACHINE LEARNING CLASSIFIERS TO ANALYZE CREDIT RISK
MACHINE LEARNING CLASSIFIERS TO ANALYZE CREDIT RISKMACHINE LEARNING CLASSIFIERS TO ANALYZE CREDIT RISK
MACHINE LEARNING CLASSIFIERS TO ANALYZE CREDIT RISK
 

Recently uploaded

{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Delhi Call girls
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...shambhavirathore45
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...shivangimorya083
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Delhi Call girls
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxolyaivanovalion
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 

Recently uploaded (20)

{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 

Regression and Artificial Neural Network in R

  • 1. “Regression Model and Artificial Neural Network for Predictive Analytics using R” By Vaibhav Kumar Assistant Professor Dept. of CSE DIT University, Dehradun Vaibhav Kumar@DIT University, Dehradun
  • 2. Outline  Introduction  Predictive Analytics  Predictive Analytics Techniques  Regression Models in Prediction  Machine Learning Models in Prediction  Stock Market Prediction  Prediction using Regression Model  Prediction using Artificial Neural Network  Comparison  Conclusion Vaibhav Kumar@DIT University, Dehradun
  • 3. Introduction  On the basis of several input attributes, the value of an output attribute can be determined through a model which formulates the relationship between these input and output attributes.  There are many real life examples such as weather condition, dearness etc. where we see that many independent variables which affects the future value of a dependent variable.  To model this dependency of a variable on other variables, there are a variety of methods available.  Statistics, one of the premier field of mathematics, has given many methods to formulate the relationship between variables.  The developments in the field of Computer Science have given many intelligent algorithms, which are known as machine learning. It simulates the human learning process. Vaibhav Kumar@DIT University, Dehradun
  • 4. Introduction  There are a variety of machine learning models which use the concept of statistics and process the data intelligently with the speed of computer in order to generate a fast and accurate result.  Research and development in the field of machine learning of is going on a full swing and continuously proposing a much faster and accurate result.  A new field in the area of computer science is on boom – Data Science. It leverages the capabilities of statistical and machine learning tools and works on data.  Industries are using data science to grow their businesses. Vaibhav Kumar@DIT University, Dehradun
  • 5. Predictive Analytics  Predictive analytics, a branch in the domain of advanced analytics, is used in predicting the future events.  It analyze the current and historical data in order to make predictions about the future by employing the techniques from statistics, data mining, machine learning, and artificial intelligence.  It brings together the information technology, business modeling process and management to make prediction about the future.  Businesses can appropriately use big data for their profit by successfully applying the predictive analytics.  It can help organizations in becoming proactive, forward looking and anticipating trends or behavior based on the data. Vaibhav Kumar@DIT University, Dehradun
  • 6. Predictive Analytics  Predictive analytics has a wide range of application in many domains.  It is widely used in e-commerce business to find the customer behaviors and offer them a customized solution.  Insurance companies collect the data of working professional from a third party and identifies which type of working professional would be interested in which type of insurance plan and they approach them to attract towards its products.  Banking companies apply predictive analytics models to identify credit card risks and fraudulent customer and become alert from those type of customers.  Organizations involved in financial investments identify the stocks which may give a good return on their investment and they even predict the future performance of stocks based on the past and current performance.  There are many other applications. Vaibhav Kumar@DIT University, Dehradun
  • 7. Predictive Analytics Techniques All predictive analytics techniques are grouped into two categories:- 1. Classification Techniques: The class of a new observation is assigned based on the class assignment of past observations. All the techniques used in this category give the discrete output. For Example: Class A or Class B if there are two classes to classify the observations. 2. Regression Techniques: Models used in the techniques give a continuous output. It predicts a number. For example Temperature today at 08:00 PM. Vaibhav Kumar@DIT University, Dehradun
  • 8. Regression Models in Prediction  Regression is one of the most popular statistical technique which estimates the relationship among variables.  It models the relationship between a dependent variable and one or more independent variables.  It analyzes how the value of a dependent variable changes on changing the values of independent variables in the modeled relation.  There are two types of regression models used in predictive analytics:- 1. Linear Regression Model (as a regression model) 2. Logistic Regression Model (as a classification model) Vaibhav Kumar@DIT University, Dehradun
  • 9. Machine Learning Models in Prediction  Machine learning is an application of artificial intelligence (AI) that provides systems the ability to automatically learn and improve from experience without being explicitly programmed.  Machine learning focuses on the development of computer programs that can access data and use it learn for themselves.  There are variety of machine learning model used in predictive analytics:-  Artificial Neural Network  Decision Tree  Support Vector Machine  Gradient Boosting  Random Forest  Many other Vaibhav Kumar@DIT University, Dehradun
  • 10. Stock Market Prediction  Machine learning models have a dominating role in financial applications.  In predicting the prices and trends in stock, machine learning techniques have always been dominating among all the predictive analytics techniques.  This is only because of fast computing algorithms and working on large datasets.  Many of the stock market-based organization use machine learning models for predicting the stock prices.  An accurate prediction of future prices may lead to higher yield of profit to investors through stock investments.  As per the prediction, the investor shall be able to pick the stocks which may give a higher return. Vaibhav Kumar@DIT University, Dehradun
  • 11. Prediction using Regression Model  Lets consider an example of stock market prediction. Please refer to the following data set. Vaibhav Kumar@DIT University, Dehradun
  • 12.  First take the historical data of all the attributes for same duration.  Normalize the data.  Fetch the data in Rstudio > data=read.csv(“filename.csv”)  Split the data set into two sets– training set and test set. > tr.data=data[1:380,] > ts.data=data[381:495,] Set the independent and dependent variables. > y=tr.data$DAY_CLOSE >x=tr.data$SENSEX+tr.data$NIFTY.50+tr.data$ST_52_High+tr.data$ST_52_Low+tr.data$PREV_ CLOSE+tr.data$DOLLAR+tr.data$CRUDE+tr.data$HANG_SENG+tr.data$DAX+tr.data$SENT_SCR > reg.model=lm(y~x) > print(summary(reg.model)) Vaibhav Kumar@DIT University, Dehradun
  • 13.  Prepare the test data. >x=ts.data$SENSEX+ts.data$NIFTY.50+ts.data$ST_52_High+ts.data$ST_52_Low+ts.data$PREV _CLOSE+ts.data$DOLLAR+ts.data$CRUDE+ts.data$HANG_SENG+ts.data$DAX+ts.data$SENT_S CR > result=predict(reg.model,data.frame(x)) > res=as.data.frame(result) > test.y=ts.data$DAY_CLOSE > test.x=result Find the correlation between original values and the predicted values > cor(test.x,test.y) It can also be visualized through a graph. > plot(test.x,test.y, abline(lm(test.y~test.x)) Vaibhav Kumar@DIT University, Dehradun
  • 14. Artificial Neural Network  Artificial Neural Network (ANN) is a machine learning tool.  It is inspired by biological neural network of brain.  Billion of neurons are connected together in the brain. They receive electrochemical signals from neighboring neurons, they process it and forward it to the next neighboring neurons in the network.  Similar to the biological neurons, artificial neurons are connected together to form the artificial neural network.  The network process the data in patterns rather than executing sequential information.  As information is stored in brain as strengths of synaptic gaps between neurons, similarly the knowledge is stored in ANN as weights associated with the interconnection between artificial neurons. Vaibhav Kumar@DIT University, Dehradun
  • 15. Introduction (Cont….) Vaibhav Kumar@DIT University, Dehradun Structure of an artificial neuron is shown in the above figure. The net input yin to the neuron can be given as: yin = b+x1w1+x2w2+…..+xnwn Or, yin = 𝑖=1 𝑛 xiwi where b is the bias term. The output of the neuron can be given as: yout = f(yin) Where f(.) is called the activation or transfer function of the neuron. This function is used as per the required output.
  • 16. Learning  The main goal of neural network is to solve the problems through learning which are complex to solve by human.  In all the neural net learning methods, weights of the network are adjusted.  There are a variety if learning algorithms used by neural networks to solve problems.  Some popular neural network learning algorithms are:  Backpropagation Learning  Hebbian learning Supervised Learning  Perceptron Learning  Delta/Least Mean Square learning  Winner-Takes-All Unsupervised Learning Vaibhav Kumar@DIT University, Dehradun
  • 17. Application in Stock Market Prediction  The input attributes of the dataset will be applied at the input layer of the neural network and the day’s closing price of stock will be obtained at the output layer. > library("neuralnet") >f=tr.data$DAY_CLOSE~tr.data$SENSEX+tr.data$NIFTY.50+tr.data$ST_52_High+tr.data$ST_52_ Low+tr.data$PREV_CLOSE+tr.data$DOLLAR+tr.data$CRUDE+tr.data$HANG_SENG+tr.data$DAX +tr.data$SENT_SCR > net=neuralnet(f,tr.data,hidden = 12, algorithm = "rprop+", act.fct = "logistic", linear.output = TRUE, lifesign.step = 1000) > summary(net) > plot(net) > tt.x=ts.data[,1:10] > result=compute(net,tt.x) > cor(ts.data$DAY_CLOSE,result$net.result) Vaibhav Kumar@DIT University, Dehradun
  • 18. Thank You Vaibhav Kumar@DIT University, Dehradun