Last active
July 16, 2017 17:22
-
-
Save vb100/662079454013cef14b096edee50b0989 to your computer and use it in GitHub Desktop.
Data pre-processing algorithm for R (Data Science)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Importing the dataset | |
dataset = read.csv('data.csv') | |
# Splitting the datase into the Training set and Test set | |
#install.packages('caTools') | |
library(caTools) | |
set.seed(123) | |
split = sample.split(dataset$DependentVariable, SplitRatio = 0.8) | |
training_set = subset(dataset, split == TRUE) | |
test_se = subset(dataset, split == FALSE) | |
# Feature Scaling | |
# training_set = scale(training_set) | |
# test_set = scale(test_set) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment