Chans

Untitled

Jan 11th, 2018
2,404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. # Importing the libraries
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4. import pandas as pd
  5.  
  6. # Importing the dataset
  7. dataset = pd.read_csv('Salary_Data.csv')
  8. X = dataset.iloc[:,:-1].values
  9. y = dataset.iloc[:, 1].values
  10.  
  11. # Splitting the dataset into the Traing Set and Test Set
  12. from sklearn.model_selection import train_test_split
  13. X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=1/3, random_state = 0)
Advertisement
Add Comment
Please, Sign In to add comment