Primer on Neural networks

Slides:



Advertisements
Similar presentations
Artificial Neural Networks
Advertisements

A brief review of non-neural-network approaches to deep learning
Beyond Linear Separability
A Brief Overview of Neural Networks By Rohit Dua, Samuel A. Mulder, Steve E. Watkins, and Donald C. Wunsch.
Neural networks Introduction Fitting neural networks
also known as the “Perceptron”
Lecture 14 – Neural Networks
1 Part I Artificial Neural Networks Sofia Nikitaki.
September 30, 2010Neural Networks Lecture 8: Backpropagation Learning 1 Sigmoidal Neurons In backpropagation networks, we typically choose  = 1 and 
Neural Networks. R & G Chapter Feed-Forward Neural Networks otherwise known as The Multi-layer Perceptron or The Back-Propagation Neural Network.
CHAPTER 11 Back-Propagation Ming-Feng Yeh.
General Mining Issues a.j.m.m. (ton) weijters Overfitting Noise and Overfitting Quality of mined models (some figures are based on the ML-introduction.
October 28, 2010Neural Networks Lecture 13: Adaptive Networks 1 Adaptive Networks As you know, there is no equation that would tell you the ideal number.
Artificial Neural Networks
© Copyright 2004 ECE, UM-Rolla. All rights reserved A Brief Overview of Neural Networks By Rohit Dua, Samuel A. Mulder, Steve E. Watkins, and Donald C.
Chapter 3 Neural Network Xiu-jun GONG (Ph. D) School of Computer Science and Technology, Tianjin University
11 CSE 4705 Artificial Intelligence Jinbo Bi Department of Computer Science & Engineering
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 31: Feedforward N/W; sigmoid.
Artificial Intelligence Chapter 3 Neural Networks Artificial Intelligence Chapter 3 Neural Networks Biointelligence Lab School of Computer Sci. & Eng.
Reservoir Uncertainty Assessment Using Machine Learning Techniques Authors: Jincong He Department of Energy Resources Engineering AbstractIntroduction.
Artificial Intelligence for Data Mining in the Context of Enterprise Systems Thesis Presentation by Real Carbonneau.
Artificial Intelligence Methods Neural Networks Lecture 3 Rakesh K. Bissoondeeal Rakesh K. Bissoondeeal.
Neural Networks The Elements of Statistical Learning, Chapter 12 Presented by Nick Rizzolo.
VISUALIZATION TECHNIQUES UTILIZING THE SENSITIVITY ANALYSIS OF MODELS Ivo Kondapaneni, Pavel Kordík, Pavel Slavík Department of Computer Science and Engineering,
Combining Models Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya.
Robert Anderson SAS JMP
Deep Feedforward Networks
Today we will graph linear equations in slope intercept form.
Machine Learning & Deep Learning
Adavanced Numerical Computation 2008, AM NDHU
Computer Science and Engineering, Seoul National University
第 3 章 神经网络.
Applications of Deep Learning and how to get started with implementation of deep learning Presentation By : Manaswi Advisor : Dr.Chinmay.
USE OF DATA ANALYTICS TO PREDICT THE DEMAND OF BIKES
A Practical Framework Toward Prediction of Breaking Force and Disintegration of Tablet Formulations Using Machine Learning Tools  Ilgaz Akseli, Jingjin.
DEPARTMENT: COMPUTER SC. & ENGG. SEMESTER : VII
A Simple Artificial Neuron
CSE 473 Introduction to Artificial Intelligence Neural Networks
Announcements HW4 due today (11:59pm) HW5 out today (due 11/17 11:59pm)
Predict House Sales Price
NEURAL NETWORK APPROACHES FOR AUTOMOBILE MPG PREDICTION
The Introduction to Neural Networks
Generalization ..
CS621: Artificial Intelligence
Machine Learning Today: Reading: Maria Florina Balcan
CSC 578 Neural Networks and Deep Learning
ECE 471/571 - Lecture 17 Back Propagation.
Artificial Intelligence Chapter 3 Neural Networks
Neural Networks Geoff Hulten.
Deep Learning for Non-Linear Control
Machine Learning Interpretability
Zip Codes and Neural Networks: Machine Learning for
Artificial Intelligence Chapter 3 Neural Networks
Neural Networks ICS 273A UC Irvine Instructor: Max Welling
Part I Review Highlights, Chap 1, 2
Model generalization Brief summary of methods
Overview of deep learning
Artificial Intelligence Chapter 3 Neural Networks
Neural networks (1) Traditional multi-layer perceptrons
Chapter - 3 Single Layer Percetron
Artificial Intelligence Chapter 3 Neural Networks
COSC 4335: Part2: Other Classification Techniques
Positive analysis in public finance
CS623: Introduction to Computing with Neural Nets (lecture-3)
Prediction Networks Prediction A simple example (section 3.7.3)
Multiple features Linear Regression with multiple variables
Multiple features Linear Regression with multiple variables
CS621: Artificial Intelligence Lecture 22-23: Sigmoid neuron, Backpropagation (Lecture 20 and 21 taken by Anup on Graphical Models) Pushpak Bhattacharyya.
A Data Partitioning Scheme for Spatial Regression
Artificial Intelligence Chapter 3 Neural Networks
Presentation transcript:

Primer on Neural networks Brooke aker 10-27-16

What are Models & Machine Learning ? All models are routines that minimize the error between observations and a fitted line. Models become equations that accept inbound data to form a prediction. Machine Learning is a model that automatically changes over time with more data.

Neural network (generally) use gradient decent methods

How to give neural networks a try in R Background: compare a linear regression model to Neural Network model We are going to use the Boston dataset in the MASS package. The Boston dataset is a collection of data about housing values in the suburbs of Boston. Our goal is to predict the median value of owner-occupied homes (medv) using all the other continuous variables

Start with a linear model for comparison We proceed by randomly splitting the data into a train and a test set, then we fit a linear regression model and test it on the test set. Note that I am using the gml() function instead of the lm() this will become useful later when cross validating the linear model.

Now prepare the Neural networks NN work best when data is scaled into 0-1 or -1 to 1 scales. To scale your data do this: find the max and mins maxs <- apply(data, 2, max) mins <- apply(data, 2, min) Now scale the data - e.g. in this case where the center point of each variable is the min# and where the max goes no further than the difference max less min. # note scale needs to be converted back to data frame scaled <- as.data.frame(scale(data, center = mins, scale = maxs - mins)) Set new training and testing data frames specific to NN train_ <- scaled[index,]test_ <- scaled[-index,]

Layers and Neurons !! neurons

Layers and Neurons !! Not a good understanding of how to formulate layers and neurons except following rule of thumb; 1-2 layers are sufficient for most Neural Networks Try neurons as 2/3rd the input layer size in first layer, 2nd layer neurons should be 2/3rd of first layer neuron size. For Boston housing data we have 13 data variables n <- names(train_) f <- as.formula(paste("medv ~", paste(n[!n %in% "medv"], collapse = " + "))) nn <- neuralnet(f,data=train_,hidden=c(8,5),linear.output = T) plot(nn)

Plot(nn) The black lines show the connections between each layer and the weights on each connection while the blue lines show the bias term added in each step. The bias can be thought as the intercept of a linear model. The net is essentially a black box so we cannot say that much about the fitting, the weights and the model. But the training algorithm has converged and therefore the model is ready to be used.

Then calc a mean squared error for the nn Do the NN prediction with the test_ data pr.nn <- compute(nn,test_[,1:13]) Rescale the data back to its original form so the MSE comparison is valid pr.nn_ <- pr.nn$net.result*(max(data$medv)-min(data$medv))+min(data$medv) test.r <- (test_$medv)*(max(data$medv)-min(data$medv))+min(data$medv) Get the MSE of the NN MSE.nn <- sum((test.r - pr.nn_)^2)/nrow(test_)

Finally compare the linear to nn model mse Linear Model MSE Neural Network MSE 21.6 7.1

Compare errors graphically plot(test$medv,pr.nn_,col='red',main='Real vs predicted NN',pch=18,cex=0.7)abline(0,1,lwd=2)legend('bottomright',legend='NN',pch=18,col='red', bty='n') plot(test$medv,pr.lm,col='blue',main='Real vs predicted lm',pch=18, cex=0.7)abline(0,1,lwd=2)legend('bottomright',legend='LM',pch=18,col='blue', bty='n', cex=.95)

conclusions Questions Neural Networks are (one of) the basis for Artificial Intelligence and can produce superior outcomes compared to more traditional methods. Subject to experimentation Are black boxes How to do feature selection / engineering? Does the neural network experiment with which variables to include / exclude? What conclusion to draw if MSE is larger than traditional methods?