Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mglearn/plot_cross_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import matplotlib.pyplot as plt


def plot_label_kfold():
def plot_group_kfold():
from sklearn.model_selection import GroupKFold
groups = [0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3]

Expand Down Expand Up @@ -36,7 +36,7 @@ def plot_label_kfold():
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")

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

axes.invert_yaxis()
Expand Down
4 changes: 2 additions & 2 deletions mglearn/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .plot_agglomerative import plot_agglomerative, plot_agglomerative_algorithm
from .plot_kmeans import plot_kmeans_algorithm, plot_kmeans_boundaries, plot_kmeans_faces
from .plot_improper_preprocessing import plot_improper_processing, plot_proper_processing
from .plot_cross_validation import (plot_threefold_split, plot_label_kfold,
from .plot_cross_validation import (plot_threefold_split, plot_group_kfold,
plot_shuffle_split, plot_cross_validation,
plot_stratified_cross_validation)

Expand Down Expand Up @@ -54,7 +54,7 @@
'plot_kmeans_algorithm',
'plot_kmeans_faces',
'cm3', 'cm2', 'plot_improper_processing', 'plot_proper_processing',
'plot_label_kfold',
'plot_group_kfold',
'plot_shuffle_split',
'plot_stratified_cross_validation',
'plot_threefold_split',
Expand Down