Photo by h heyerlein on Unsplash

Human Activity Recognition using the Smartphone Data with Machine Learning Algorithm

The problem of classifying sequences of data recorded by specialized harnesses is known as human activity recognition.

Mohammad Sakib Mahmood
3 min readAug 8, 2021

--

Introduction

Human activity recognition is the problem of classifying sequences of data recorded by specialized harnesses or smart phones into known well-defined Human activities. It is a challenging problem as the large number of observations are produced each second, the temporal nature of the observations, and the lack of a clear way to relate data to known movements increase the challenges.

Let’s start with Importing necessary libraries which are using in this project.

Download the data sets (Link)

Now to combine both the data frames

Then run the following code in the another cell train.shape, test.shape

Output Result

then run the code both.head

both.dtypes.value_counts()

Now let’s have to see in the data table,

To Scale the data

Standard Scaler:

dimensionality reduction:

Splitting the data into training and testing
Almost this training set is larger than the testing set. The 80:20 split ratio is the most common split ratio used by data scientist. A split ratio of 80:20 means that 80% of data will be used in the training set, while 20% will be used in the testing set.

Test options and evaluation metric:

Scikit Learn’s Library:

Scikit-learn has a feature that allows to analyze data with non-Gaussain latent factors. The FastICA component can be used in the same way for this case.

Finalizing the model and comparing the test, predict results

Classification report

Conclusion

In this article, I have created a model for recognition of human activity using the smartphone data.

GitHub page for Human Activity Recognition

--

--

Mohammad Sakib Mahmood
Mohammad Sakib Mahmood

Written by Mohammad Sakib Mahmood

Co-op Intern @Central Station Marketing, Euless TX & Graduate Student @Missouri State University, USA.

No responses yet