Welcome back.
We learned about Standardscaler and why it's very important.
Now let's run this cell and everything should be fine.
Also, we can check the TensorFlow version by using TensorFlow version.
Let me run again.
There we go.
TensorFlow is already installed and all of those libraries are added and imported correctly.
Now let's move to the second step which is loading and exploring the data.
We'll use the classic auto mpg miles per gallon data set from an online website.
This website is
archived.1.edu/ml/machine
learning databases.
Auto mpg auto mpg data.
This is the link.
Also, you can get it from the resource folder or from the notebook you import from the resources folder.
Under each section, you notice there are a lot of data with the cars, the name of cars, number of
uh, the number, the name of the car, the mileage.
This is then the number that we need to, uh, to predict.
We have number of cylinders.
We have, uh, the displacement, horsepower, weight, acceleration, model year, and the origin.
So one refers for American, two refers for European, and three refers for Japanese.
Okay.
This is our data that we're going to work on and to develop our model that learns all of those data
and predict the mileage and mile per gallon.
Okay.
So in order to load this.
Copy the link.
Load the data by using the URI.
So in the special thing in this application and in this tutorial that we're going to use and load real
data from online website.
So this is real data real statistics and real numbers.
So we're going to deal with those real numbers.
So here this is the URL.
Then we need to get the column name.
So column names mpg miles per gallon cylinders displacement horsepower weight acceleration model year
and origin.
Here we need to read the CSV file from a URL into a pandas data frame with a specific parsing options,
as we did in the previous sections in the previous application.
We collect our data and store it inside the data frame.
So to do that we need to start with row data set equals to PD dot read csv.
Here we have six parameters.
Let me start with the URL.
The path to the CSV file could be a web URL or a local file path.
Also, you can upload your data sample and the data CSV file here in the folders and files for this
notebook.
Also, you can receive the link of your data exactly like we did here.
So I'm passing this URL here in the first parameter.
The second parameter is names.
This provides custom column names.
Instead of using the first row of the file, column names should be a list of strings containing your
desired column names.
So here we have the we have nine columns.
So I should specify nine names of our columns.
The third parameter name, underscore values, treats the question mark as a missing or non-available
value.
Any question mark in the data set will be converted to an Nan not available or not assigned.
So if we scroll down, you notice that in this row we have the question mark.
Also there are a lot of missing.
So if you scroll down here we go.
This is another question mark.
So those question marks will be dealt with as Nan as not available.
The fourth parameter comment backward slash t treats stab characters as comment indicators.
Any text after a tab character will be ignored.
Treated as comment.
The fifth parameter is Sep equals to this empty space.
Uses a single space as delimiter or separator between columns.
The file is space separated rather than comma separated.
So instead of separating the columns by comma, we're going to use a single space as a separator between
columns.
The last parameter is skip initial space equals to true skips any white space that appears immediately
after the delimiter.
Helps clean up extra space in the data.
Okay, now this code.
Use custom column names from column names or array Treat the question mark as missing data.
Ignore that t comment here, for example, as a comment, and parse the values separated by space and
handle the extra space before 6.0 properly.
This is a commonly used for reading formatted data set, where the default CSV settings don't apply
perfectly.
And you can see we use pandas to read the CSV file using the readcsv method.
Now dataset equals to row dataset dot copy.
This line of code creates a copy of the data frame.
What it does creates a deep copy.
Makes a complete independent copy of row data.
Set the new dataset variable points to the separated object in memory, and the changes made to dataset
will not affect the row data set and vice versa.
To print the data set shape we use and to print the data set.
The complete data set.
We use data set if we need to get only for, uh, the first ten numbers, we use the head function and
pass the value of the first columns that we need.
Run the cell and here we go.
This is our data set shape.
We have 389 rows with eight columns.
Okay.
So this is our data set 398 rows times eight columns.
This is a big and a moderate and uh, and real data set that we're going to.