Skip to content

Commit 6d7e405

Browse files
fixing whitespace in Rmd so diff of errata is cleaner (#46)
* fixing whitespace in Rmd so diff of errata is cleaner * reapply kwargs fix
1 parent f132c18 commit 6d7e405

12 files changed

Lines changed: 392 additions & 410 deletions

Ch02-statlearn-lab.Rmd

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

Ch03-linreg-lab.Rmd

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Linear Regression
32

43
<a target="_blank" href="https://colab.research.google.com/github/intro-stat-learning/ISLP_labs/blob/v2.2/Ch03-linreg-lab.ipynb">
@@ -19,7 +18,7 @@ import pandas as pd
1918
from matplotlib.pyplot import subplots
2019
2120
```
22-
21+
2322

2423
### New imports
2524
Throughout this lab we will introduce new functions and libraries. However,
@@ -95,7 +94,7 @@ A.sum()
9594
9695
```
9796

98-
97+
9998

10099
## Simple Linear Regression
101100
In this section we will construct model
@@ -117,7 +116,7 @@ Boston = load_data("Boston")
117116
Boston.columns
118117
119118
```
120-
119+
121120
Type `Boston?` to find out more about these data.
122121

123122
We start by using the `sm.OLS()` function to fit a
@@ -132,7 +131,7 @@ X = pd.DataFrame({'intercept': np.ones(Boston.shape[0]),
132131
X[:4]
133132
134133
```
135-
134+
136135
We extract the response, and fit the model.
137136

138137
```{python}
@@ -154,7 +153,7 @@ method, and returns such a summary.
154153
summarize(results)
155154
156155
```
157-
156+
158157

159158
Before we describe other methods for working with fitted models, we outline a more useful and general framework for constructing a model matrix~`X`.
160159
### Using Transformations: Fit and Transform
@@ -225,8 +224,8 @@ The fitted coefficients can also be retrieved as the
225224
results.params
226225
227226
```
228-
229-
227+
228+
230229
The `get_prediction()` method can be used to obtain predictions, and produce confidence intervals and
231230
prediction intervals for the prediction of `medv` for given values of `lstat`.
232231

@@ -396,7 +395,7 @@ terms = Boston.columns.drop('medv')
396395
terms
397396
398397
```
399-
398+
400399
We can now fit the model with all the variables in `terms` using
401400
the same model matrix builder.
402401

@@ -407,7 +406,7 @@ results = model.fit()
407406
summarize(results)
408407
409408
```
410-
409+
411410
What if we would like to perform a regression using all of the variables but one? For
412411
example, in the above regression output, `age` has a high $p$-value.
413412
So we may wish to run a regression excluding this predictor.
@@ -482,7 +481,7 @@ model2 = sm.OLS(y, X)
482481
summarize(model2.fit())
483482
484483
```
485-
484+
486485

487486
## Non-linear Transformations of the Predictors
488487
The model matrix builder can include terms beyond
@@ -557,7 +556,7 @@ there is little discernible pattern in the residuals.
557556
In order to create a cubic or higher-degree polynomial fit, we can simply change the degree argument
558557
to `poly()`.
559558

560-
559+
561560

562561
## Qualitative Predictors
563562
Here we use the `Carseats` data, which is included in the

Ch04-classification-lab.Rmd

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
2-
3-
4-
51
# Logistic Regression, LDA, QDA, and KNN
62

73
<a target="_blank" href="https://colab.research.google.com/github/intro-stat-learning/ISLP_labs/blob/v2.2/Ch04-classification-lab.ipynb">

Ch05-resample-lab.Rmd

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
3-
41
# Cross-Validation and the Bootstrap
52

63
<a target="_blank" href="https://colab.research.google.com/github/intro-stat-learning/ISLP_labs/blob/v2.2/Ch05-resample-lab.ipynb">

0 commit comments

Comments
 (0)