Skip to content

Commit 75a239c

Browse files
committed
fix two things
1 parent 0d71bc0 commit 75a239c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • 08_PracticalMachineLearning/016preProcessingPCA

08_PracticalMachineLearning/016preProcessingPCA/index.Rmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ mode : selfcontained # {standalone, draft}
1818
```{r setup, cache = F, echo = F, message = F, warning = F, tidy = F}
1919
# make this an external chunk that can be included in any file
2020
options(width = 100)
21+
library(knitr)
2122
opts_chunk$set(message = F, error = F, warning = F, comment = NA, fig.align = 'center', dpi = 100, tidy = F, cache.path = '.cache/', fig.path = 'fig/')
2223
2324
options(xtable.type = 'html')
@@ -158,7 +159,7 @@ plot(spamPC[,1],spamPC[,2],col=typeColor)
158159
```{r pcaCaret,dependson="spamPC",cache=TRUE,fig.height=3.5,fig.width=3.5}
159160
preProc <- preProcess(log10(training[,-58]+1),method="pca",pcaComp=2)
160161
trainPC <- predict(preProc,log10(training[,-58]+1))
161-
modelFit <- train(training$type ~ .,method="glm",data=trainPC)
162+
modelFit <- train(y=training$type,method="glm",x=trainPC)
162163
```
163164

164165
---

0 commit comments

Comments
 (0)