以下の実行時にエラーになります。
学習前に間違ってる場所はありますでしょうか?
アドバイスよろしくお願いします。
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn import datasets
from sklearn import svm
from sklearn.model_selection import train_test_split
iris = datasets.load_iris()
x = iris.data[:, [2,3]]
y = iris.target
x_train, x_test, y_train, y_test = train_test_split(x,y, test_size=0.3, random_state=0)
svc = svm.SVC(C=1, kernel='rdf', gamma=0.001)
svc.fit(x_train, y_train)
実行結果
ValueError Traceback (most recent call last)
<ipython-input-24-6880a99bdee3> in <module>
1
2 svc = svm.SVC(C=1, kernel='rdf', gamma=0.001)
----> 3 svc.fit(x_train, y_train)
~/opt/anaconda3/lib/python3.7/site-packages/sklearn/svm/base.py in fit(self, X, y, sample_weight)
207
208 seed = rnd.randint(np.iinfo('i').max)
--> 209 fit(X, y, sample_weight, solver_type, kernel, random_seed=seed)
210 # see comment on the other call to np.iinfo in this file
211
~/opt/anaconda3/lib/python3.7/site-packages/sklearn/svm/base.py in _dense_fit(self, X, y, sample_weight, solver_type, kernel, random_seed)
266 cache_size=self.cache_size, coef0=self.coef0,
267 gamma=self._gamma, epsilon=self.epsilon,
--> 268 max_iter=self.max_iter, random_seed=random_seed)
269
270 self._warn_from_fit_status()
sklearn/svm/libsvm.pyx in sklearn.svm.libsvm.fit()
ValueError: 'rdf' is not in list