Last active
June 9, 2018 14:52
-
-
Save grohith327/55fd3919e277de3d75b8f82cf0c9b0ae to your computer and use it in GitHub Desktop.
This file contains 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
import pandas as pd | |
import numpy as np | |
from sklearn.utils import shuffle | |
## Load Iris dataset | |
df = pd.read_csv('/Users/rohith/Documents/Datasets/Iris_dataset/iris.csv') | |
## Store the target vaue | |
classes = df['Species'] | |
## Drop the Id and Class values from dat | |
df = df.drop(['Id','Species'],axis=1) | |
## Convert dataframe into list and then into a numpy array | |
data = df.values.tolist() | |
data = np.array(data) | |
## Shuffle classes and data | |
data,classes = shuffle(data,classes) | |
## First 135 points are used for training and the rest is used for testing | |
train_data = data[:135] | |
test_data = data[135:] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment