Olá está aparecendo esse problema, alguém sabe como resolver?
Aqui está meu código: seed = 5 np.random.seed(seed)
raw_train_x, raw_test_x, train_y, test_y = train_test_split(x, y, test_size = 0.25, stratify = y)
scaler = StandardScaler() scaler.fit(raw_train_x) train_x = scaler.transform(raw_train_x) test_x = scaler.transform(raw_train_x)
model = SVC(gamma = 'auto') model.fit(train_x, train_y)
predict = model.predict(test_x)
taxa_acerto = accuracy_score(test_y, predict) print(f'{(taxa_acerto * 100):.2f}%')
data_x = test_x[:, 0] data_y = test_x[:, 1]
x_min = data_x.min() x_max = data_x.max()
y_min = data_y.min() y_max = data_y.max()
pixel = 100
axis_x = np.arange(x_min, x_max, ((x_max - x_min) / pixel)) axis_y = np.arange(y_min, y_max, ((y_max - y_min) / pixel))
xx, yy = np.meshgrid(axis_x, axis_y)
points = np.c_[xx.ravel(), yy.ravel()]
Z = model.predict(points) Z = Z.reshape(xx.shape)
plt.contourf(xx, yy, Z, alpha = 0.3) plt.scatter(data_x, data_y, s = 1.5)