Last active
June 16, 2020 05:37
-
-
Save findtharun/b16b7c399f6fff87e2a14ba3c5ff5fc9 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.svm import SVC | |
from sklearn.model_selection import train_test_split | |
from sklearn import datasets | |
data=pd.read_csv('Iris.csv') | |
# iris=datasets.load_iris() | |
# x=iris.data | |
# y=iris.target | |
#print(y) | |
# x=data.iloc[:,:4] | |
# y=data['variety'] | |
x=data.iloc[:,:-1] | |
y=data.iloc[:,-1] | |
from sklearn.model_selection import train_test_split | |
x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=.25) | |
svc=SVC() | |
svc.fit(x_train,y_train) | |
print(svc.predict([[5.4,3.5,1.8,5.6]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment