对于matplotlib.pyplot( as plt ) 先输入主体数据部分: import numpy as np import matplotlib.pyplot as plt X_train = np.array([[1,2,3],[2,3,4],[2,2,1],[3,2,2]]) X_test = np.array([[1,1,1],[2,1,1]]) y_train = np.array([1,1,-1,1]) y_test = np.array([1,-1]) 我们先做二维图:(取