Download Ipynb

cleak here

Bento Activity Recognition Tutorial:

This notebook has been designed for the bento activity challenge recognition competition with the the aim of providing the basic knowledge of Human Activity Recognition by MOCAP.

It has been made by Nazmun Nahid.

Library import:

Here we are going to use pandas(https://pandas.pydata.org/docs/user_guide/index.html), numpy(https://numpy.org/devdocs/user/whatisnumpy.html) and matplotlib(https://matplotlib.org/stable/contents.html).

Read Data:

First, we have to load the data in the data frame.

Now let's check what information the data contains!

So, here we can see in the data file there are many rows and columns. Do you want to know the exact number of rows and columns?

Data Visualization:

Now, let's see how the data looks like!

Pre-processing:

In the preprocessing stage we need to first focus on the missing values. Let's check if our data have any missing values.

We have some missing values. So, we have to keep that in mind while handling the data. To work with this data we will devide the whole data into smaller segments.

Feature Extarction:

There are many types of features. For ease of use we have shown only some very common features.

Now we have a feature list and lablel list. Next step is classification.

Training:

For classification there are several models. Here we are using one of the most commonly used model Random Forest.

Here we only have one subject. So, we will divide data from this subject into train and test file to evaluate the results. For more than one subject you can also put one subject in testing and others in training.

Now let's train the model!

The training is complete but how can we see the results? For that we will here use classification report with which we can see the accuracy, precision, recall and f1 score. We will also use confusion matrix for the evaluation.

We have successfully completed learning to read the data, visualize data, pre-processing, feature extraction, classification and evaluation of the generated model. Now it's your turn to generate a model following these steps and predict the labels of the test data. Best of luck!