Created
December 29, 2016 18:53
-
-
Save mxposed/836f388f7c103d632c92961a7764250d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# таблица с результатами и параметрами | |
clf.grid_scores_ | |
# отфильтровать из неё записи, где параметр p был 2, а параметр weights был distance и положить результат в переменную means | |
means = filter(lambda x: x[0]['p'] == 2 and x[0]['weights'] == 'distance', clf.grid_scores_) | |
# нарисовать график, в котором по оси абсцисс параметр n_neighbors, а по оси ординат score | |
plt.plot([x[0]['n_neighbors'] for x in means], [x[1] for x in means]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment