Skip to content

Commit

Permalink
fix two things
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew-May committed Feb 18, 2018
1 parent 0d71bc0 commit 75a239c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 08_PracticalMachineLearning/016preProcessingPCA/index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ mode : selfcontained # {standalone, draft}
```{r setup, cache = F, echo = F, message = F, warning = F, tidy = F}
# make this an external chunk that can be included in any file
options(width = 100)
library(knitr)
opts_chunk$set(message = F, error = F, warning = F, comment = NA, fig.align = 'center', dpi = 100, tidy = F, cache.path = '.cache/', fig.path = 'fig/')
options(xtable.type = 'html')
Expand Down Expand Up @@ -158,7 +159,7 @@ plot(spamPC[,1],spamPC[,2],col=typeColor)
```{r pcaCaret,dependson="spamPC",cache=TRUE,fig.height=3.5,fig.width=3.5}
preProc <- preProcess(log10(training[,-58]+1),method="pca",pcaComp=2)
trainPC <- predict(preProc,log10(training[,-58]+1))
modelFit <- train(training$type ~ .,method="glm",data=trainPC)
modelFit <- train(y=training$type,method="glm",x=trainPC)
```

---
Expand Down

1 comment on commit 75a239c

@Matthew-May
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the problem in the code calling train() function according to this page:
topepo/caret#480
DataScienceSpecialization#157

Please sign in to comment.