Skip to content

Commit

Permalink
fix code indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGatto committed Oct 11, 2017
1 parent 0baf482 commit 2da2698
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions 30-sml.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -469,16 +469,16 @@ for us.
```{r trctrlroc, warning = FALSE}
## Create trainControl object: myControl
myControl <- trainControl(
method = "cv", ## cross validation
number = 10, ## 10-fold
summaryFunction = twoClassSummary, ## NEW
classProbs = TRUE, # IMPORTANT
verboseIter = FALSE
method = "cv", ## cross validation
number = 10, ## 10-fold
summaryFunction = twoClassSummary, ## NEW
classProbs = TRUE, # IMPORTANT
verboseIter = FALSE
)
## Train glm with custom trainControl: model
model <- train(Class ~ ., Sonar,
method = "glm", ## to use glm's logistic regression
trControl = myControl)
method = "glm", ## to use glm's logistic regression
trControl = myControl)
## Print model to console
print(model)
Expand Down
14 changes: 7 additions & 7 deletions docs/supervised-learning.html
Original file line number Diff line number Diff line change
Expand Up @@ -581,16 +581,16 @@ <h3><span class="header-section-number">5.4.3</span> AUC in <code>caret</code></
<p>When using <em><a href="https://CRAN.R-project.org/package=caret">caret</a></em>’s <code>trainControl</code> function to train a model, we can set it so that it computes the ROC and AUC properties for us.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">## Create trainControl object: myControl
myControl &lt;-<span class="st"> </span><span class="kw">trainControl</span>(
<span class="dt">method =</span> <span class="st">&quot;cv&quot;</span>, ## cross validation
<span class="dt">number =</span> <span class="dv">10</span>, ## 10-fold
<span class="dt">summaryFunction =</span> twoClassSummary, ## NEW
<span class="dt">classProbs =</span> <span class="ot">TRUE</span>, <span class="co"># IMPORTANT</span>
<span class="dt">verboseIter =</span> <span class="ot">FALSE</span>
<span class="dt">method =</span> <span class="st">&quot;cv&quot;</span>, ## cross validation
<span class="dt">number =</span> <span class="dv">10</span>, ## 10-fold
<span class="dt">summaryFunction =</span> twoClassSummary, ## NEW
<span class="dt">classProbs =</span> <span class="ot">TRUE</span>, <span class="co"># IMPORTANT</span>
<span class="dt">verboseIter =</span> <span class="ot">FALSE</span>
)
## Train glm with custom trainControl: model
model &lt;-<span class="st"> </span><span class="kw">train</span>(Class <span class="op">~</span><span class="st"> </span>., Sonar,
<span class="dt">method =</span> <span class="st">&quot;glm&quot;</span>, ## to use glm&#39;s logistic regression
<span class="dt">trControl =</span> myControl)
<span class="dt">method =</span> <span class="st">&quot;glm&quot;</span>, ## to use glm&#39;s logistic regression
<span class="dt">trControl =</span> myControl)

## Print model to console
<span class="kw">print</span>(model)</code></pre></div>
Expand Down

0 comments on commit 2da2698

Please sign in to comment.