Skip to content

Instantly share code, notes, and snippets.

@srishilesh
Last active May 9, 2019 08:57
Show Gist options
  • Save srishilesh/3400daab89bf1618927e1fa1d787b134 to your computer and use it in GitHub Desktop.
Save srishilesh/3400daab89bf1618927e1fa1d787b134 to your computer and use it in GitHub Desktop.
Data preprocessing
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('./Data.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
# Splitting the dataset into the Training set and Test set
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment