import numpy as np
import matplotlib.pyplot as plt
x,y,min_x,max_x,min_y,max_y,X,mesh_step_size= 10,10,2,9,1,7,10,10
def visualize(c,x,y):
global min_x,max_x,min_y,max_y,X
min_x,max_x = ...
min_y,max_y = ...
x_vals,y_vals = np.meshgrid(np.arange(min_x,max_x, mesh_step_size))
# Run the classifier on the mesh grid
output = c.predict(np.c_[x_vals.ravel(), y_vals.ravel()])
# Reshape the output array
output = output.reshape(x_vals.shape)
# Create a plot
plt.figure()
# Choose a color scheme for the plot
plt.pcolormesh(x_vals, y_vals, output, cmap=plt.cm.gray)
# Overlay the training points on the plot
plt.scatter(X[:, 0], X[:, 1], c=y, s=75, edgecolors='black',
linewidth=1, cmap=plt.cm.Paired)
# Specify the boundaries of the plot
plt.xlim(x_vals.min(), x_vals.max())
plt.ylim(y_vals.min(), y_vals.max())
# Specify the ticks on the X and Y axes
plt.xticks((np.arange(int(X[:, 0].min() - 1), int(X[:, 0].max() + 1),
1.0)))
plt.yticks((np.arange(int(X[:, 1].min() - 1), int(X[:, 1].max() + 1),
1.0)))
plt.show()
Я получил эту ошибку, пожалуйста, помогите !!!!!!!!!!! Traceback (последний вызов последним): файл "D: \ AI using Python \ Logisti c Regression 2.py", строка 11, в x_val, y_val = np.meshgrid (np.arange (min_x, max_x, mesh_step_size)) ValueError: недостаточно значений для распаковки (ожидалось 2, получено 1)