Beginner Intro to Neural Networks 8 Linear Regression
>> YOUR LINK HERE: ___ http://youtube.com/watch?v=GwVTM28HKYk
Hey everyone! • In this video we're going to look at something called linear regression. • We're really just adding an input to our super simple neural network (which was NN() = b) before. • For those that know a bit about neural nets: I'm including this because we're getting one step closer to a full blown neural network. You can think of each hidden unit (before applying its activation function) as a multiple linear regression. So if we understand simple linear regression first, I'm hoping when we move up to bigger + more complex neural nets we'll have a stronger foundation. • ------- • Let's jump into an example to see what this is and what it allows us to do. • Our farmer has a dog. She wants to learn more about her dog, and today specifically how many tail wags can she expect when she pats him on the head a certain number of times? • She knows that to answer her question, she should start by collecting some data. • To create an observation she pats his head a specific number of times, then records how many times he wags his tail. • To get a rough idea of any relationship between pats and wags, our farmer thinks visual thoughts... scatter plot! pats on x axis and wags on y axis, each observation is a point! • Woah! Look at that! It seems like the more pats there are, the more wags! Astonishing! • The points almost seem to follow a line... this hints that there is a linear relationship going on. • What does our farmer think then? Linear regression! • Our farmer is going to use this equation to model the data. • wags(pats) = w * pats + b • Aside: • When I say model, all I mean is capture or distill some relationship from the data that will allow her to make predictions or learn something new about her data, like how many more wags can she expect if she pats one more time? Or how many wags for 1.5 pats? • It takes in the number of pats as an input • and multiplies it by some random weight we have to find w • then adds another random variable we need to find b to that • then we simplify and that's its prediction for number of wags! • let's bring back our data and graph our current model! • To generate pairs of points using our linear regression model, we need some random parameters first. • Then we use the same number of pats, and generate predictions by plugging those in one at a time and simplifying • Now we plot our models predictions, and see they're quite off • We can play with w and b by hand to minimize each prediction point's vertical distance to its corresponding data point (minimize the amount our model's predictions are off by what our data says) • Now we can do this by hand of course, but a computer can do it much better! • In the next video we'll come up with a cost function that will get us closer to finding how to change w and b, in order to find the best line that fits the data. • I realize you can also just solve for w and b using the data alone and not treat it like an optimization problem, but for our purposes we're gaining useful experience for when that's not a possability. • • • • Some further resources for learning more about linear regression: • http://www.stat.yale.edu/Courses/1997... • https://www.khanacademy.org/math/stat... • Some data to play around with, we'll see how to do so with python in a future video: • Predicting the temperature given a latitude value (in Texas) Data: (http://www.stat.ufl.edu/~winner/datas...) • Predicting murders based on unemployment rate. Data: (https://people.sc.fsu.edu/~jburkardt/...)
#############################
