4.4.1: Implement a neuron for linear regression - Training data and outliers
Skills:
ML Maths Basics70%
Key Takeaways
Implements a neuron for linear regression using TensorFlow.js, including data normalization and outlier handling
Full Transcript
foreign you'll put your knowledge of neurons into practice to create a tensorflow.js web app that will train a custom model live in your web browser so first let's define a problem you'll be trying to solve imagine a customer comes to you and says I'd like to create a web app that could estimate the house price of properties in a certain City all right well this sounds like something you should probably try and make with your existing knowledge in your mind you know that property prices might be linearly correlated with certain features like the size of the house but first you'll need some data to see if this works well now after asking the customer for more information you find they've gathered some example data of houses in the area here's an example of the data provided now the full size of the table is over 2 000 rows of data so it's shortened here but essentially it contains size in square feet number of bedrooms and the value of the house in dollars seems like there's enough data to give it a try at this step you may want to check for data to ensure there are no potential issues with how it's been recorded like missing values there are many ways to do this of course if there's a small amount of data like you have here you can visually check the columns that a value is in each or write a small bit of code to show the min max values and check for null values as a starting point there isn't third-party libraries that exists that can do much of his work for you and much more but those libraries are outside the scope of this course however if you're interested you might want to check out another Library called danfo.js that makes working of data easier in JavaScript that you could use as part of your tensorflow.js pipeline for processing data it tries to replicate a library known as pandas which python developers quite often use in data science in order to understand their input data features better for this exercise the data is already in good shape so let's start analyzing what you have now you can start by visualizing the correlation between each column of data that you have and the target value you're trying to predict here you want to predict house price so let's plot all the other values versus the house price to see how they relate first you plot size versus the value of the house as shown here now how did I draw this graph well you can use any graphing library of your choice to plot a chart like this I made these Scatter Plots using a library called plotly which is well suited for JavaScript and is built upon the very popular and Powerful d3.js library for data visualization it should be noted that tensorflow.js has a simple visualization number you can use too that you can import via a script tag check for links for more information so back to the data bin it seems that generally speaking ignoring some of the outliers highlighted the larger the house the more its value which is somewhat as expected you can also see that these features could be correlated with a straight line so it's well suited for linear regression which is what we're going to be doing next you can plot bedrooms versus Cell price which also shows a linear correlation between value and number of bedrooms it should be noted that you can see the variance quite nicely here you can see that for each bedroom level the house values can differ with a range of about a hundred thousand dollars in value again there are some fairly clear outliers which you may want to consider dropping from your data set to achieve better results now there are accurate mathematical ways of finding which points constitute to being outliers which you can then safely remove but again that is beyond the scope of this course and we'll be diving deeper into the world of data science instead however a quick search will provide many resources on this subject if you're interested that you can then replicate in JavaScript as needed intuitively then if your chosen line is going through the central points of those distributions the maximum error you would expect would be around fifty thousand dollars either above or below what the line itself predicts so hopefully your train model will have an average error lower than this okay so given the strong correlation in both chosen features along with the fact that they both seem to be linear in nature they should be well suited for a single neuron to learn from so now head on to the next section where it's time to start coding [Music] [Music]
Original Description
In this video you will learn how to take the example data provided in the prior video, import it into the JavaScript environment, and then normalize it so that it is in a form ready for training for our neuron to learn from.
Catch more episodes from Machine Learning for Web Developers (Web ML) → https://goo.gle/learn-WebML
Check out TensorFlow on YouTube → https://goo.gle/TensorFlow-YouTube
Subscribe to Google Developers → https://goo.gle/developers
Connect with Jason Mayes to ask questions:
LinkedIn → https://goo.gle/3GwgeLw
Twitter →https://goo.gle/3Xh6MT7
Discord →https://goo.gle/3WWVO5t
Use #WebML to share your learnings and creations from this course to meet your peers on social media!
See what others have already made with Web ML → http://goo.gle/made-with-tfjs
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Google for Developers · Google for Developers · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Developer Journey - Sunnyvale DSC Summit ‘19
Google for Developers
How Google is working with students - Sunnyvale DSC Summit ‘19
Google for Developers
Starting your career in the Cloud - Sunnyvale DSC Summit ‘19
Google for Developers
The Solution Challenge - Sunnyvale DSC Summit ‘19
Google for Developers
Firebase - Sunnyvale DSC Summit ‘19
Google for Developers
Cloud Hero - Sunnyvale DSC Summit ‘19
Google for Developers
Panel discussion - Sunnyvale DSC Summit ‘19
Google for Developers
The art of negotiation - Sunnyvale DSC Summit ‘19
Google for Developers
Courage to care, solve and share - Sunnyvale DSC Summit ‘19
Google for Developers
Version 9 of Angular, Glass Enterprise Edition 2, path to DX deprecation, & more!
Google for Developers
[DEPRECATING] Introducing a new series (Assistant for Developers Pro Tips)
Google for Developers
Detecting memory bugs with HWASan, Bazel 2.1, Next ‘20 session guide, & more!
Google for Developers
Why Podcast.app chose a .app domain name
Google for Developers
Machine Learning Bootcamp Jakarta 2019
Google for Developers
Android Studio 3.6, Android 11 Developer Preview, Kubeflow 1.0, & more!
Google for Developers
[DEPRECATING] Importance of community (Assistant on Air)
Google for Developers
Why the Flutter team switched from .io to a .dev domain name
Google for Developers
3 website-building tips from .dev creators
Google for Developers
Why NimbleDroid chose a .app domain name
Google for Developers
Android Platform Codelab, Bazel 2.2, Maps Android Utility Library v1.0, & more!
Google for Developers
Google for Games Developer Summit: A free, digital experience for game developers
Google for Developers
Inspecting Home Graph (Assistant for Developers Pro Tips)
Google for Developers
Google for Games Developer Summit Keynote
Google for Developers
Stadia Games & Entertainment presents: Keys to a great game pitch (Google Games Dev Summit)
Google for Developers
Empowering game developers with Stadia R&D (Google Games Dev Summit)
Google for Developers
Supercharging discoverability with Stadia (Google Games Dev Summit)
Google for Developers
Stadia Games & Entertainment presents: Creating for content creators (Google Games Dev Summit)
Google for Developers
Bringing Destiny to Stadia: A postmortem (Google Games Dev Summit)
Google for Developers
Live Captioning in Google Slides
Google for Developers
[DEPRECATING] User engagement for the Google Assistant
Google for Developers
TensorFlow Dev Summit ‘20, Google for Games Dev Summit, Cloud AI Platform Pipelines, & much more!
Google for Developers
Top 5 from the TensorFlow Dev Summit 2020
Google for Developers
Developer Student Clubs 2019 Turkey Leads Summit
Google for Developers
Building simpler payment experiences | Google Pay Plugin for Magento 2
Google for Developers
Become A Developer Student Club Lead
Google for Developers
Firebase Kotlin Extensions, ARM apps on the Android Emulator, Angular v9.1, & more!
Google for Developers
Test suite for Smart Home (Assistant for Developers Pro Tips)
Google for Developers
Google Play updates, Bazel 3.0, Business Console for Google Pay, & more!
Google for Developers
How to use error logs (Assistant for Developers Pro Tips)
Google for Developers
Contact Center AI, Android Studio 4.1 Canary 5, TensorFlow QAT API, & more!
Google for Developers
WebView DevTools, Kotlin meets gRPC, Flutter CodePen support, & more! (Episode 200)
Google for Developers
Offline handling for Smart Home (Assistant for Developers Pro Tips)
Google for Developers
Android 11 Dev Preview 3, Google Fonts for Flutter, Shielded VM, & more!
Google for Developers
Machine Learning Foundations: Ep #1 - What is ML?
Google for Developers
Flutter web support updates, BigQuery materialized views, Cloud Spanner emulator, & more!
Google for Developers
Computer vision by building a neural network with TensorFlow | Machine Learning Foundations
Google for Developers
Machine Learning Foundations: Ep #3 - Convolutions and pooling
Google for Developers
Android 11 Beta plans, Flutter 1.17, Dart 2.8, & much more!
Google for Developers
Machine Learning Foundations: Ep #4 - Coding with Convolutional Neural Networks
Google for Developers
Google Developers ML Summit
Google for Developers
Real-world image classification using convolutional neural networks | Machine Learning Foundations
Google for Developers
Adobe XD support for Flutter, Architecture Framework, temporary closures with Places API, & more!
Google for Developers
Machine Learning Foundations: Ep #6 - Convolutional cats and dogs
Google for Developers
Machine Learning Foundations: Ep #7 - Image augmentation and overfitting
Google for Developers
Announcing Firebase Live, Flutter Day, Java 11 on Google Cloud Functions, & more!
Google for Developers
Machine Learning Foundations: Ep #8 - Tokenization for Natural Language Processing
Google for Developers
Android 11 Beta, Google Play Asset Delivery, Firebase Crashlytics SDK, & much more!
Google for Developers
Natural Language Processing: Using sequencing APIs in TensorFlow | Machine Learning Foundations
Google for Developers
Build a sarcasm classifier using NLP and TensorFlow | Machine Learning Foundations
Google for Developers
AR Realism with the ARCore Depth API
Google for Developers
More on: ML Maths Basics
View skill →Related Reads
🎓
Tutor Explanation
DeepCamp AI