import pandas as pd
from [Link] import load_iris
iris = load_iris()
iris.feature_names
[Link]
iris.target_names
df = [Link]([Link],columns=iris.feature_names)
[Link]()
df['target'] = [Link]
[Link]()
df[[Link]==1].head()
df[[Link]==2].head()
df0 = df[:50]
df1 = df[50:100]
df2 = df[100:]
# Commented out IPython magic to ensure Python compatibility.
import [Link] as plt
%matplotlib inline
#Sepal length vs Sepal Width (Setosa vs Versicolor)
[Link]('Sepal Length')
[Link]('Sepal Width')
[Link](df0['sepal length (cm)'], df0['sepal width (cm)'],color="green",marker='+')
[Link](df1['sepal length (cm)'], df1['sepal width (cm)'],color="blue",marker='.')
from sklearn.model_selection import train_test_split
X = [Link](['target'], axis='columns')
y = [Link]
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2,random_state=10)
len(X_train)
len(X_test)
from [Link] import SVC
model = SVC()
[Link](X_train, y_train)
[Link](X_test, y_test)
[Link]([[4.8,3.0,1.5,0.3]])
#Tune parameters
#1. Regularization (C)
model = SVC(C=10)
[Link](X_train, y_train)
[Link](X_test,y_test)
#2. Gamma
model = SVC(gamma=100)
[Link](X_train, y_train)
[Link](X_test,y_test)
#3. Kernel
model = SVC(kernel='linear')
[Link](X_train, y_train)
[Link](X_test,y_test)