-
We start from reading the files. We assume data files are already downloaded, unzipped and they are in working directory. data files can be obtained from following link: http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones
-
First we read training data set and then test data set. After we read all files, we start to build data set.
-
First thing we do is we combing train data. In this data set, subject.train refere to subjects of training data set. According to the given discription we have 30 subjects. Then y.train refers to their activities. Again they do 6 activides coded by 1-6. Next x.train contain the data of measurements. We combine these data as column wise
-
We do the step(3) again for test data.
-
Now we combine train data and test data together to obtain complete data set. This is done using row bind.
-
Next we extracts measurements on the mean and standard deviation of each measurement. To do that we check whether variable name contains "-mean()" or "-std()"
-
Next we read activity names from "activity_label.txt" file and use those activity labels to rename activities(instead of "1-6" naming convention now we have disriptive activity set).
-
next we need to label variables with disriptive names.
-
to do that first we seperate varaible name to two part. Seperation point is first occurance of "-". For example "tBodyAcc-mean()-X" seperate into "tBodyAcc" and "-mean()-X"
-
We assign first part to "nondiscpart1" varaible and second part to "nondiscpart2" variable
-
Next we take "nondiscpart2" varaible. Which contain elemnt like "-mean()-X", "-std()". We remove "()", "-" and substitute "X axis" for "X", "mean" by "meanof", "std" by "stdof",etc.
-
After that we take "nondiscpart1" varaible. We do foolowing assignments. i. ACC ----Accelaration ii Gyro --Gyroscope iii t-Timedomain iv f-FreqDomain v. we correct typo "BodyBody" by removing repetition vi. We bring "Mag" to front of varaible and now it read "Magnitudeof" vii We add "Signals" to the end
-
We concatenate nondiscpart1 and nondiscpart2 to get full discriptive lables
-
Then we assign that as names of data set(except first two labels("subject" and "Activity"))
-
Then we take average of each variable for each activity and each subject
-
We write the data set into current directory as text file.
courseproject's Introduction
courseproject's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.