Skip to content

Commit 0fc51ea

Browse files
authored
Merge pull request amueller#24 from joaquinvanschoren/master
Partial fix for issue amueller#23
2 parents 6fa07a6 + c7f0bdd commit 0fc51ea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: mglearn/plot_cross_validation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import matplotlib.pyplot as plt
33

44

5-
def plot_label_kfold():
5+
def plot_group_kfold():
66
from sklearn.model_selection import GroupKFold
77
groups = [0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3]
88

@@ -36,7 +36,7 @@ def plot_label_kfold():
3636
axes.barh(bottom=[n_iter] * n_folds, width=[1 - 0.1] * n_folds, left=np.arange(n_folds) * n_samples_per_fold, height=.6, color="w")
3737

3838
for i in range(12):
39-
axes.text((i + .5) * n_samples_per_fold, 3.5, "%d" % labels[i], horizontalalignment="center")
39+
axes.text((i + .5) * n_samples_per_fold, 3.5, "%d" % groups[i], horizontalalignment="center")
4040
#ax.set_ylim(4, -0.1)
4141

4242
axes.invert_yaxis()

Diff for: mglearn/plots.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from .plot_agglomerative import plot_agglomerative, plot_agglomerative_algorithm
1919
from .plot_kmeans import plot_kmeans_algorithm, plot_kmeans_boundaries, plot_kmeans_faces
2020
from .plot_improper_preprocessing import plot_improper_processing, plot_proper_processing
21-
from .plot_cross_validation import (plot_threefold_split, plot_label_kfold,
21+
from .plot_cross_validation import (plot_threefold_split, plot_group_kfold,
2222
plot_shuffle_split, plot_cross_validation,
2323
plot_stratified_cross_validation)
2424

@@ -54,7 +54,7 @@
5454
'plot_kmeans_algorithm',
5555
'plot_kmeans_faces',
5656
'cm3', 'cm2', 'plot_improper_processing', 'plot_proper_processing',
57-
'plot_label_kfold',
57+
'plot_group_kfold',
5858
'plot_shuffle_split',
5959
'plot_stratified_cross_validation',
6060
'plot_threefold_split',

0 commit comments

Comments
 (0)