What are the parameters ‘clf’ and ‘legend’ in plot_decision_regions? Answer clf is the classifier object being returned from neighbors.KNeighborsClassifier, which is likely coming from sklearn. BigBen linked the documentation already for the plot_decision_regions function, which explains what they do.