3.3: Linear Regression with Ordinary Least Squares Part 2 – Intelligence and Learning

[ad_1]
In this video, part of my series on “Machine Learning”, I explain how to perform Linear Regression for a 2D dataset using the Ordinary Least Squares method. This is Part 2 where I demonstrate how to code the algorithm in JavaScript, using the p5.js library

Link to Part 1:

This video is part of session 3 of my Spring 2017 ITP “Intelligence and Learning” course (

Support this channel on Patreon:
To buy Coding Train merchandise:

Send me your questions and coding challenges!:

Contact:
Twitter:
The Coding Train website:

Links discussed in this video:
Session 3 of Intelligence and Learning:
Nature of Code:
kwichmann’s Linear Regression Diagnostics:
Linear Regression on Wikipedia:
Anscombe’s quartet on Wikipedia:
My video on the p5.js map() function:

Source Code for the all Video Lessons:

p5.js:
Processing:

For More Coding Challenges:
For More Intelligence and Learning:

Help us caption & translate this video!


Posted

in

by

Tags:

Comments

25 responses to “3.3: Linear Regression with Ordinary Least Squares Part 2 – Intelligence and Learning”

  1. Никита Богданов Avatar

    I wonder to say that it is my first project is done with yours help of your videos from your youtube chanel . I Started from KhanAcademy and there i heard about you Dan and come here now . My version of that task : https://gist.github.com/Worseize/4fbbca25de1f68a46e39e914ec1dc854

  2. DuskNoun Avatar

    Good tutorial but I think you should extend the utility of linear models. Right now, given an X value, you can determine the Y value of the rect calculated. But every single Y value follows a normal distribution. Thus, instead of giving just the Y value given an X value we're trying to predict, you can give a 95% confidence interval of that particular Y value and state "given that X value, I don't know which Y value will really have, but there's a 95% of chances that the actual Y value is between this and this other one".

  3. Chris Mills Avatar

    Hey Dan, it mightve been simpler to use scale() to just flip the canvas math so its right side up like most people understand graphs.

  4. Najib Saad Avatar

    You are one of the few Youtubers who work hard for high-quality content, and has a really good preforming personality as well as charisma. I only wanted to say that you are the person who should has viral videos.

  5. Oussama Single Avatar

    learning while having some fun is great , you are my favorite instructor <3

  6. Angelo Cella Avatar

    The Coding Train your a very good programmer.

  7. RedKugelblitz Avatar

    Your exitement is contagious! Really liking your newer videos.

  8. Andrew Jones Avatar

    That was an amazing demostration of linear regression.

  9. Andrew Jones Avatar

    you could have just done xsum = data.reduce((acc, cur) => acc + cur.x, 0)

  10. lucasmontec Avatar

    Is is possible to create a detection algorithm that says if linear regression is bad for a data set?

  11. Lucas Lopes Avatar

    15:23 I notice what you did here haha

  12. tim southorn Avatar

    Subscribed for "math-sss"

  13. shivam dube Avatar

    hey can u plz upload the ringtone of coding train …I loved it ..plz share the download link
    as always u are the best !!

  14. Gav Art Avatar

    Code liero
    I'd like to see that
    It'd be a challenge

  15. Nenad Fluka Avatar

    I wonder will you ever use forEach or reduce functions. Some how you always forget 🙂
    But, as always very interesting video. To bad I've missed stream.

  16. Studio MZK Avatar

    Bravo for this really nice realtime linear regression demo!

  17. Brett Haupt Avatar

    Kelvin is the only true temperature. anyway keep up the educational videos

  18. Joe Thuo Avatar

    part 2 didn't take long. Awesome thanks

  19. Carlos Carlos Avatar

    you are the best!!! all your videos are pretty awesome

  20. Phil Boswell Avatar

    Do you have a video which shows how to set up the environment that you use? It's probably something really simple that I'm overlooking but I don't recognise the editor or how you get it to always use the :8000 sub-address. It's similar enough to Processing that I could manage to follow but different enough to confuse…

  21. Jordan Scarrott Avatar

    I'm so happy to see this channel getting 250k+ subs. I hate to be that guy, but I subbed when it was called Daniel Shiffman and had about 13k. This is some quality content thats made available here, keep it up

  22. אלון עטר Avatar

    with which program launguge you write this code?

  23. Sudo Hyde Avatar

    great video. very interesting

  24. Randy King Avatar

    You also forgot the link for kwichmann GitHub site…

  25. Randy King Avatar

    You forgot to put in the link for the "map" function… Sorry, Dan…

Leave a Reply

Your email address will not be published. Required fields are marked *