WEBVTT

00:00.080 --> 00:04.160
Hey everyone, welcome to our Machine Learning course.

00:04.160 --> 00:11.480
Today we're going to build something really exciting, a car mileage predictor app that uses artificial

00:11.480 --> 00:17.680
intelligence to estimate a car's fuel efficiency based on its specifications.

00:17.680 --> 00:20.920
We're going to build not a simple model.

00:20.920 --> 00:29.240
We're going to build a moderate to complex model using TensorFlow, and we're going to integrate it

00:29.240 --> 00:32.000
with our Android applications.

00:32.000 --> 00:37.080
Let's start with an overview of our model.

00:37.080 --> 00:42.440
We'll have an input layer that takes nine parameters.

00:42.560 --> 00:45.360
Did you hear it right nine numbers.

00:45.360 --> 00:48.360
We're going to work with nine parameters.

00:48.360 --> 00:50.360
Let's start with the cylinders.

00:50.480 --> 00:53.720
We're going to make a range of cylinders 3 to 8.

00:53.960 --> 00:59.400
Our example will take six cylinders just just for testing.

00:59.400 --> 01:06.800
So you can put any number but just for testing and making a reference for our predictions.

01:06.840 --> 01:11.600
A displacement from 68 to 455 cc.

01:11.800 --> 01:20.720
Our example takes 256 horsepower from 46 to 230 horsepower.

01:20.880 --> 01:23.760
Our example takes 100 hp.

01:24.040 --> 01:29.960
The weight from 161 3 to 5 one four £0.

01:30.000 --> 01:38.080
Our example takes £3,500 acceleration from 8 to 25 seconds.

01:38.280 --> 01:39.360
15 seconds.

01:39.400 --> 01:45.120
Our example the model year from 1970 to 1982.

01:45.480 --> 01:47.840
Our example 1976.

01:48.000 --> 01:58.320
The parameters origin one uh refers one for American, zero for non-American origin to the the manufacturer

01:58.320 --> 02:01.960
or the country of the manufacturer.

02:02.080 --> 02:05.330
Origin two if we put one so it's European.

02:05.370 --> 02:06.970
European zero.

02:07.010 --> 02:07.970
Our example.

02:08.290 --> 02:09.410
And the third?

02:09.610 --> 02:11.690
The third origin is Japanese.

02:11.730 --> 02:17.210
Put zero to make it zero for Japanese, zero for European and one for American.

02:17.210 --> 02:22.010
We consider that our car is an American origin.

02:22.210 --> 02:22.730
Okay.

02:22.930 --> 02:33.130
So we have nine input features cylinders, displacement, horsepower, weight, acceleration, model

02:33.130 --> 02:35.490
year, and the car's origin.

02:35.730 --> 02:40.610
Our target is the mpg, the mile per gallon.

02:40.770 --> 02:43.690
That's what we want to predict.

02:43.730 --> 02:44.610
We have.

02:44.970 --> 02:47.890
The first layer is the hidden layer.

02:48.090 --> 02:51.290
Number of neurons is 64.

02:51.490 --> 02:56.130
This layer learns basic feature combination.

02:56.170 --> 03:05.170
Different neurons specialize in recognizing different patterns like height, weight, plus low horsepower

03:05.290 --> 03:09.970
or many cylinders plus old model year.

03:10.170 --> 03:15.850
Then we're going to move to the second hidden layer, which is number two.

03:15.890 --> 03:22.730
Here we have two architectures 264 two by 64 architecture.

03:23.010 --> 03:32.050
This is a well tested starting point for problems with 10 to 20 input features and hundreds to thousands

03:32.050 --> 03:33.290
of samples.

03:33.530 --> 03:36.050
So why 64 neurons?

03:36.050 --> 03:37.530
It's a sweet spot.

03:37.770 --> 03:43.810
Enough capacity to learn complex relationships, but not so much.

03:43.810 --> 03:48.970
That is easily overfit our 400 sample data set.

03:49.130 --> 03:53.290
So our car prediction problem is moderately complex.

03:53.330 --> 04:00.170
Nine input features with nonlinear relationship between the input features.

04:00.330 --> 04:07.250
Need to learn patterns like, uh, heavier cars with more cylinders equals to lower mpg.

04:07.570 --> 04:08.250
For example.

04:08.330 --> 04:10.450
another, uh, another pattern.

04:10.490 --> 04:15.970
Newer models with same specs equals to better mpg.

04:16.250 --> 04:24.730
So the first layer, if we make our application only containing one layer and 16 neurons, it would

04:24.730 --> 04:31.250
be a it might give us 3.5 Ma, which is too simple.

04:31.450 --> 04:32.850
Did you remember the Ma?

04:33.290 --> 04:40.770
And if we make it with two layers exactly like our application, we have only two hidden layers, each

04:40.810 --> 04:43.050
with 64 neurons.

04:43.290 --> 04:43.890
It will.

04:44.290 --> 04:47.610
It will make, uh, gives us a good balance.

04:47.610 --> 04:55.130
If we make four layers, we have 256 neurons and might get 2.1 Ma.

04:55.170 --> 04:57.850
It's closer to two layers.

04:57.850 --> 05:04.490
So we're going to use two layers for simplicity and making good results.

05:04.650 --> 05:10.730
And by the way this is this is a general like general formula.

05:10.730 --> 05:18.850
If you have 10 to 20 input features and hundreds to thousands of samples, go with two layers.

05:18.890 --> 05:24.130
Go and create two layers, each with 64 neurons.

05:24.330 --> 05:28.650
Then we have the output layer, which gives us the mileage.

05:28.850 --> 05:42.090
And if we put six lenders 200 250 600 hp, 3500 LPs, 15 seconds, acceleration 1976 and an American

05:42.090 --> 05:49.890
origin will get an closer to 22.5 miles per gallon.

05:50.050 --> 05:55.330
And by the way, guys, those are real examples and real data.

05:55.610 --> 06:00.650
In this application we're going to work with real data.

06:00.650 --> 06:09.850
We're going to cover the principles data pre-processing, neural network design, model conversion and

06:09.850 --> 06:15.620
mobile integration Applied to countless other machine learning applications.

06:15.620 --> 06:20.900
So in the previous section, we learned about simple linear regression.

06:21.100 --> 06:30.700
In this application, we're going to learn about very complex and moderate complex applications.

06:30.700 --> 06:36.580
That applies to countless other machine learning applications.

06:36.700 --> 06:38.020
Thanks for watching.

06:38.260 --> 06:48.540
In our next video we're going to start in start exploring and creating our model and adding new features

06:48.740 --> 06:52.580
like the nine features that we specified here.

06:52.900 --> 07:01.180
Then we're going to implement our model into Android Studio and see if our application works fine with

07:01.180 --> 07:05.060
the flight models and test them.

07:05.100 --> 07:09.980
Let's start building our car mileage prediction application.
