OK, so in this lecture, we are going to look at the notebook for human activity recognition, since
you may not have seen this data set before, we are going to take things slowly at first and look at
each part of the code step by step.
So let's start with the imports.
So there are some new things to pay attention to.
We'll need to import the concatenate layer since that is needed to join multiple features together.
We'll need to import the spice categorical across entropy, since we need to pass in customs arguments
into the laws.
As you recall, when you just want to use the defaults, you can specify the losses of string will also
need to import the model checkpoint callback.
Basically, we're going to use this to save the best model we encountered during training.
This is a necessary but it's useful since the validation laws can start to increase due to overfitting.
OK, so the next step is to download our data, so this data is currently posted on my website.
However, you're encouraged to check out the original sources to learn more.
The next step is to unzip the zip file that we just downloaded.
The next step is to run the allus command to see what we just got unzipped.
As you can see, we now have a folder called UCI Data Set.
The next step is to run that command again to see what's inside this folder.
OK, so it looks like we have a few files along with two folders, test and train.
Now these files are basically just information about the data set if you want to read about it.
The actual data is stored inside the train and test folders.
So let's run the Ellis command again to see what's inside the train folder.
Note that analagous files can also be found in the test folder.
OK, so we have three files along with one folder, so the subject's file is not too important unless
you want to be able to identify which subject corresponds to which sample.
Since we don't really care about that for this task, it's not really important for us as an exercise.
You might want to check whether or not the same subjects appear in both the train and test set.
That would indicate how much we can trust our model to generalize to new subjects.
The next fall to look at is extraneous.
So, as you recall, although the data is a time series, the researchers also created features from
each time series Extreme.
That is where those features are stored.
As usual, it's formatted with each row being one sample and each column being one feature.
The next step is to look at why train T.
This is where the labels are stored.
And lastly, we have the inertial signals folder.
So this is where the time series are stored.
Will look inside this folder in a moment.
The next step is to check inside what's inside the subject's train t file.
OK, so basically it's one integer per row.
These are the subject IDs, as you may be able to surmise.
The next step is to check out what's inside extranets.
So basically, it's just the table of numbers, the samples go along the rows and the features go along
the columns as promised.
The next step is to check out what's inside, why train?
So, again, we have a list of integers, one per row.
These are the class labels for each sample, you might want to verify that these labels start from one,
which means we'll need to subtract one from them in the code.
This is because, as you recall, in Python, we start counting from zero.
OK, so the next step is to look inside of the inertial signals folder.
So you can see that there are nine files corresponding to the nine different Times series measurements
based on this, we can tell it's going to take some work in order to convert these files into the format
we need.
As you recall, we'd like to have a data set of shape and by TBD.
Note that we can also check what's inside the test folder as well.
So you can see that we have all the same files except that they end in the word test, which is kind
of redundant.
The next step is to actually look at what's inside one of these times series files, so I've chosen
this one randomly, but they all basically look like this.
So, again, it's just the table of numbers now, since each row is a sample.
This means that each column is a different point in time.
This is somewhat unconventional since earlier in the course time series like stock prices and airline
passengers had each row is a different point in time.
OK, so now just to show you how this works, I'm going to read in one of these CSV files using pandas
since the files don't have any headers.
I'm going to set header to none.
And since each data point is separated by whitespace, I'm going to set Dehlin whitespace the true.
This is unlike a regular CSV which uses commas.
OK, so the next step is to do a drug head to see what's inside our data frame.
So basically, it's a table of numbers as expected.
Now, keep in mind that this is just a convenient way to read in this data.
What do we eventually want is to store all this data inside an umpire, Ray?
OK, so let's do a deal of that info to see some basic information about our data.
The important things to notice here are the range index and the columns.
Basically, this says that we have seven thousand three hundred fifty two rows and one hundred twenty
eight columns.
So this means that we have seven thousand three hundred fifty two samples.
And each time Sari's has one hundred twenty eight measurements, as we discussed.
The next step is to call the plight on one of these Times series.
So this should give you a sense of what these Times series look like.
OK, so at this point, I feel like we understand how our data is organized, so we should now be ready
to actually load it into a format that we can use with tensor flow.