Skip to content

Commit

Permalink
check ch06 on latest softw.
Browse files Browse the repository at this point in the history
rasbt committed Dec 5, 2019
1 parent 7bf4d1f commit 76495d1
Showing 2 changed files with 66 additions and 57 deletions.
114 changes: 58 additions & 56 deletions ch06/ch06.ipynb

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion ch06/ch06.py
Original file line number Diff line number Diff line change
@@ -172,6 +172,7 @@


kfold = StratifiedKFold(n_splits=10,
shuffle=True,
random_state=1).split(X_train, y_train)

scores = []
@@ -329,6 +330,7 @@
gs = GridSearchCV(estimator=pipe_svc,
param_grid=param_grid,
scoring='accuracy',
refit=True,
cv=10,
n_jobs=-1)
gs = gs.fit(X_train, y_train)
@@ -339,7 +341,11 @@


clf = gs.best_estimator_
clf.fit(X_train, y_train)

# clf.fit(X_train, y_train)
# note that we do not need to refit the classifier
# because this is done automatically via refit=True.

print('Test accuracy: %.3f' % clf.score(X_test, y_test))


@@ -499,6 +505,7 @@


cv = list(StratifiedKFold(n_splits=3,
shuffle=True,
random_state=1).split(X_train, y_train))

fig = plt.figure(figsize=(7, 5))

0 comments on commit 76495d1

Please sign in to comment.