Giter Site home page Giter Site logo

cleaningdata's Introduction

To dos:

  1. Merge the training and test data sets to create one data sets:
    • training set is contained in the file: UCI HAR Dataset/train/X_train.txt
    • test set is contained in the file: UCI HAR Dataset/train/X_test.txt
    • read the both the files into a list using data.table
    • add a new label to each train and test set: "train" and "test" respectively
	testset = cbind(testset , label = "test")
	trainset = cbind(trainset , label = "train")
- merge the two datasets into one
		overallSet = mapply(cbind, testset, trainset, SIMPLIFY=FALSE)
- write the merged data to a csv file
		write.csv(overallSet, file = ".~/UCI HAR Dataset/merge/mergedDataSet.csv")

2.Extract the mean and the standard deviation overallSets = rbind(means = colMeans(overallSet))

	library(matrixStats)
	overallSets = rbind(std = colSds(matrixStats))

3.Adding the labels by running the cbind command

    trainLabels = cbind(trainLabels, activity_label = activitylabels$V2);
    testLabels = cbind(testLabels, activity_label = activitylabels$V2);

4.Read the activity labels from the traiing and test files and merge them

	activitylabels <- read.table(file = "./data/UCI HAR Dataset/activity_labels.txt");
	trainLabels <-read.table(file = "./data/UCI HAR Dataset/y_train.txt")
	testLabels <-read.table(file = "./data/UCI HAR Dataset/y_test.txt")

5.add the names to the columns in the activity labels

	trainLabels = cbind(trainLabels, activity_label = activitylabels$V2);
	testLabels = cbind(testLabels, activity_label = activitylabels$V2);

cleaningdata's People

Contributors

taimooralam avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.