Skip to content

Partial fix for issue #23 #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2017
Merged
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
@@ -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]

@@ -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()
4 changes: 2 additions & 2 deletions mglearn/plots.py
Original file line number Diff line number Diff line change
@@ -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)

@@ -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',