Skip to content

Commit

Permalink
check compat of ch02-07
Browse files Browse the repository at this point in the history
  • Loading branch information
rasbt committed Jul 2, 2018
1 parent 9c9e714 commit 36219d8
Show file tree
Hide file tree
Showing 10 changed files with 532 additions and 604 deletions.
116 changes: 52 additions & 64 deletions code/ch02/ch02.ipynb

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions code/ch02/ch02.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,3 @@ def predict(self, X):








172 changes: 69 additions & 103 deletions code/ch03/ch03.ipynb

Large diffs are not rendered by default.

172 changes: 97 additions & 75 deletions code/ch04/ch04.ipynb

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions code/ch04/ch04.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@



df = pd.DataFrame([['green', 'M', 10.1, 'class1'],
['red', 'L', 13.5, 'class2'],
['blue', 'XL', 15.3, 'class1']])
df = pd.DataFrame([['green', 'M', 10.1, 'class2'],
['red', 'L', 13.5, 'class1'],
['blue', 'XL', 15.3, 'class2']])

df.columns = ['color', 'size', 'price', 'classlabel']
df
Expand Down Expand Up @@ -253,6 +253,8 @@
class_le.inverse_transform(y)


# 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).


# ## Performing one-hot encoding on nominal features

Expand Down Expand Up @@ -411,6 +413,9 @@


lr = LogisticRegression(penalty='l1', C=1.0)
# Note that C=1.0 is the default. You can increase
# or decrease it to make the regulariztion effect
# stronger or weaker, respectively.
lr.fit(X_train_std, y_train)
print('Training accuracy:', lr.score(X_train_std, y_train))
print('Test accuracy:', lr.score(X_test_std, y_test))
Expand Down
210 changes: 93 additions & 117 deletions code/ch05/ch05.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion code/ch05/ch05.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ def rbf_kernel_pca(X, gamma, n_components):
Returns
------------
alphas: {NumPy ndarray}, shape = [n_samples, k_features]
Projected dataset
Projected dataset
lambdas: list
Eigenvalues
Expand Down
144 changes: 67 additions & 77 deletions code/ch06/ch06.ipynb

Large diffs are not rendered by default.

302 changes: 144 additions & 158 deletions code/ch07/ch07.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion code/ch07/ch07.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8


from scipy.misc import comb
from scipy.special import comb
import math
import numpy as np
import matplotlib.pyplot as plt
Expand Down

0 comments on commit 36219d8

Please sign in to comment.