import matplotlib.pyplot as plt # 导入Matplotlib库 from matplotlib.colors import Listed Colormap # 导入Listed Colormap def plot_decision_regions(X, y, classifier, test_idx=None, resolution=0.02):