text_plain_output_1.png
from sklearn import svm, datasets

from sklearn.model_selection import cross_val_score

import numpy as np

import pandas as pd

from sklearn import svm, datasets
iris = datasets.load_iris()

df = pd.DataFrame(iris.data, columns=iris.feature_names)

df['target'] = iris.target

df['target'] = df['target'].apply(lambda x: iris.target_names[x])

result = cross_val_score(svm.SVC(kernel='linear', C=10, gamma='auto'), iris.data, iris.target, cv=5)
np.mean(result)

result = cross_val_score(svm.SVC(kernel='rbf', C=5, gamma='auto'), iris.data, iris.target, cv=5)
np.mean(result)