Skip to content

Commit 36219d8

Browse files
committed
check compat of ch02-07
1 parent 9c9e714 commit 36219d8

File tree

10 files changed

+532
-604
lines changed

10 files changed

+532
-604
lines changed

code/ch02/ch02.ipynb

Lines changed: 52 additions & 64 deletions
Large diffs are not rendered by default.

code/ch02/ch02.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,3 @@ def predict(self, X):
587587

588588

589589

590-
591-
592-
593-
594-

code/ch03/ch03.ipynb

Lines changed: 69 additions & 103 deletions
Large diffs are not rendered by default.

code/ch04/ch04.ipynb

Lines changed: 97 additions & 75 deletions
Large diffs are not rendered by default.

code/ch04/ch04.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@
184184

185185

186186

187-
df = pd.DataFrame([['green', 'M', 10.1, 'class1'],
188-
['red', 'L', 13.5, 'class2'],
189-
['blue', 'XL', 15.3, 'class1']])
187+
df = pd.DataFrame([['green', 'M', 10.1, 'class2'],
188+
['red', 'L', 13.5, 'class1'],
189+
['blue', 'XL', 15.3, 'class2']])
190190

191191
df.columns = ['color', 'size', 'price', 'classlabel']
192192
df
@@ -253,6 +253,8 @@
253253
class_le.inverse_transform(y)
254254

255255

256+
# Note: The deprecation warning shown above is due to an implementation detail in scikit-learn. It was already addressed in a pull request (https://github.com/scikit-learn/scikit-learn/pull/9816), and the patch will be released with the next version of scikit-learn (i.e., v. 0.20.0).
257+
256258

257259
# ## Performing one-hot encoding on nominal features
258260

@@ -411,6 +413,9 @@
411413

412414

413415
lr = LogisticRegression(penalty='l1', C=1.0)
416+
# Note that C=1.0 is the default. You can increase
417+
# or decrease it to make the regulariztion effect
418+
# stronger or weaker, respectively.
414419
lr.fit(X_train_std, y_train)
415420
print('Training accuracy:', lr.score(X_train_std, y_train))
416421
print('Test accuracy:', lr.score(X_test_std, y_test))

code/ch05/ch05.ipynb

Lines changed: 93 additions & 117 deletions
Large diffs are not rendered by default.

code/ch05/ch05.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ def rbf_kernel_pca(X, gamma, n_components):
797797
Returns
798798
------------
799799
alphas: {NumPy ndarray}, shape = [n_samples, k_features]
800-
Projected dataset
800+
Projected dataset
801801
802802
lambdas: list
803803
Eigenvalues

code/ch06/ch06.ipynb

Lines changed: 67 additions & 77 deletions
Large diffs are not rendered by default.

code/ch07/ch07.ipynb

Lines changed: 144 additions & 158 deletions
Large diffs are not rendered by default.

code/ch07/ch07.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33

4-
from scipy.misc import comb
4+
from scipy.special import comb
55
import math
66
import numpy as np
77
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)