So in this lecture, we will continue looking at our notebook for human activity recognition in this
video.
Our goal is to check how well our model performs using only static features.
That is, we will not use any time series, but only features derived from the Time series.
So this is more like traditional machine learning.
We'll also take this opportunity to test the other machine learning models suited to this problem,
like the ones we discussed in the previous section.
So we'll start by imparting the standard scalar from Saikat learn for tabular data.
It's useful to standardize the features for certain models like neural networks.
The next step is to define a new function and called the load features, the job of this function is
to return the train and test features, both of which will be two dimensional and biddy's.
Inside the function will begin by using pedigreed CSV to load in the file extranets.
The next step is to convert the data frame into a Nampara.
The next step is to do the same process for tests.
The next step is to use the standard scalar to standardize both the training and test features.
The next step is Duckula, a new function to get train and feed test.
The next step is to determine the dimensionality of our features, which is the number of columns in
either array.
The next step is to create a feed for it and then what you already know how to do.
The next step is to call the compile function, which has the same arguments as before.
The next step is to create a checkpoint, note that we've given this a new file name so as not to conflict
with the existing file.
The next step is to call the fifth function to begin the training process.
The next step is to plot the laws, Repak.
OK, so again, the train loss is much better than the test loss.
The next step is to plot the accuracy prepack.
Interestingly, this model seems to do pretty well, it seems to do better than the Time series version.
The next step is to load in our best model.
The next step is to compute our test predictions and the accuracy.
OK, so you can see that our suspicions are correct, in fact, using the features led to a better performing
model compared to using the TIME series.
The next step is to try a few machine learning models from Saikat learn.
So we'll start by testing logistic regression.
Note that for some reason, the default optimizer didn't work that well.
So I've set the solver to live linear.
OK, so the train accuracy seems pretty high.
And we see that the test accuracy is also pretty high, even better than our neural network.
This suggests that our data might have close to a linear decision boundary.
The next step is to test the support vector machine.
Again, the train score is pretty good.
So the test score is also good, but not as good as logistic regression.
So to test this idea that the data might be close to linearly separable, we're going to test the support
vector machine again, but this time we'll use a linear kernel.
So the train score is better when we use a linear kernel.
And again, our test score beats the nonlinear version.
The next step is to test the random forest.
So, as usual, the random forest gets a perfect score on the train set.
Unfortunately, the REENFORCE performed poorly on the test.
OK, so what have we learned in this lecture?
We've learned that feature engineering is very useful, working with raw time.
So it sounds cool.
But sometimes the more practical approach might be to just make some features and use regular machine
learning and also don't discount linear models.
They should always be part of your list of things to try.