Hey everyone, welcome to our Machine Learning course.
Today we're going to build something really exciting, a car mileage predictor app that uses artificial
intelligence to estimate a car's fuel efficiency based on its specifications.
We're going to build not a simple model.
We're going to build a moderate to complex model using TensorFlow, and we're going to integrate it
with our Android applications.
Let's start with an overview of our model.
We'll have an input layer that takes nine parameters.
Did you hear it right nine numbers.
We're going to work with nine parameters.
Let's start with the cylinders.
We're going to make a range of cylinders 3 to 8.
Our example will take six cylinders just just for testing.
So you can put any number but just for testing and making a reference for our predictions.
A displacement from 68 to 455 cc.
Our example takes 256 horsepower from 46 to 230 horsepower.
Our example takes 100 hp.
The weight from 161 3 to 5 one four £0.
Our example takes £3,500 acceleration from 8 to 25 seconds.
15 seconds.
Our example the model year from 1970 to 1982.
Our example 1976.
The parameters origin one uh refers one for American, zero for non-American origin to the the manufacturer
or the country of the manufacturer.
Origin two if we put one so it's European.
European zero.
Our example.
And the third?
The third origin is Japanese.
Put zero to make it zero for Japanese, zero for European and one for American.
We consider that our car is an American origin.
Okay.
So we have nine input features cylinders, displacement, horsepower, weight, acceleration, model
year, and the car's origin.
Our target is the mpg, the mile per gallon.
That's what we want to predict.
We have.
The first layer is the hidden layer.
Number of neurons is 64.
This layer learns basic feature combination.
Different neurons specialize in recognizing different patterns like height, weight, plus low horsepower
or many cylinders plus old model year.
Then we're going to move to the second hidden layer, which is number two.
Here we have two architectures 264 two by 64 architecture.
This is a well tested starting point for problems with 10 to 20 input features and hundreds to thousands
of samples.
So why 64 neurons?
It's a sweet spot.
Enough capacity to learn complex relationships, but not so much.
That is easily overfit our 400 sample data set.
So our car prediction problem is moderately complex.
Nine input features with nonlinear relationship between the input features.
Need to learn patterns like, uh, heavier cars with more cylinders equals to lower mpg.
For example.
another, uh, another pattern.
Newer models with same specs equals to better mpg.
So the first layer, if we make our application only containing one layer and 16 neurons, it would
be a it might give us 3.5 Ma, which is too simple.
Did you remember the Ma?
And if we make it with two layers exactly like our application, we have only two hidden layers, each
with 64 neurons.
It will.
It will make, uh, gives us a good balance.
If we make four layers, we have 256 neurons and might get 2.1 Ma.
It's closer to two layers.
So we're going to use two layers for simplicity and making good results.
And by the way this is this is a general like general formula.
If you have 10 to 20 input features and hundreds to thousands of samples, go with two layers.
Go and create two layers, each with 64 neurons.
Then we have the output layer, which gives us the mileage.
And if we put six lenders 200 250 600 hp, 3500 LPs, 15 seconds, acceleration 1976 and an American
origin will get an closer to 22.5 miles per gallon.
And by the way, guys, those are real examples and real data.
In this application we're going to work with real data.
We're going to cover the principles data pre-processing, neural network design, model conversion and
mobile integration Applied to countless other machine learning applications.
So in the previous section, we learned about simple linear regression.
In this application, we're going to learn about very complex and moderate complex applications.
That applies to countless other machine learning applications.
Thanks for watching.
In our next video we're going to start in start exploring and creating our model and adding new features
like the nine features that we specified here.
Then we're going to implement our model into Android Studio and see if our application works fine with
the flight models and test them.
Let's start building our car mileage prediction application.