Skip to content

Instantly share code, notes, and snippets.

@vb100
Last active July 16, 2017 17:22
Show Gist options
  • Save vb100/662079454013cef14b096edee50b0989 to your computer and use it in GitHub Desktop.
Save vb100/662079454013cef14b096edee50b0989 to your computer and use it in GitHub Desktop.
Data pre-processing algorithm for R (Data Science)
# 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