Skip to content

Commit

Permalink
update look issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
m-clark committed Mar 26, 2019
1 parent c98444c commit 632ccfd
Show file tree
Hide file tree
Showing 40 changed files with 6,350 additions and 764 deletions.
177 changes: 177 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions _bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,14 @@ language:
chapter_name: "Chapter "
output_dir: "docs"
delete_merged_file: true

rmd_files: [
"index.Rmd",
"preface.Rmd",
"intro.Rmd",
'concepts.Rmd',
'blackbox.Rmd',
'other.Rmd',
'appendix.Rmd',
'references.Rmd'
]
68 changes: 47 additions & 21 deletions _output.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,48 @@

bookdown::gitbook:
css: [css/standard_html.css, css/book.css]
font-import: https://fonts.googleapis.com/css?family=Roboto|Open+Sans
font-family: 'Roboto'
config:
toc:
before: |
<li class='before'><a href="https://m-clark.github.io/">Machine Learning</span></a></li>
after: |
<li class='after'><a href="https://m-clark.github.io/"><img src="img/mc.png" style="width:50%; padding:0px 0; display:block; margin: 0 auto;" alt="MC logo"></a></li>
<li class='after'><a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="width:50%; border-width:0; display:block; margin: 0 auto;" src="img/ccbysa.png" /></a></li>
# <li><a href="https://m-clark.github.io" target="blank" style="font-size:150%; font-variant:small-caps; color:#1f65b7; margin: 0 auto;">Michael Clark</a></li><br><br>
edit:
link: https://github.com/m-clark/documents/
highlight: pygments
# bookdown::pdf_book:
# includes:
# in_header: preamble.tex
# latex_engine: xelatex
# citation_package: natbib
# bookdown::epub_book: default
css: [css/book.css, 'https://use.fontawesome.com/releases/v5.0.13/css/all.css']
font-import: https://fonts.googleapis.com/css?family=Roboto|Open+Sans
font-family: 'Roboto'
number_sections: false
split_by: rmd
config:
df_print: kable
highlight: pygments
edit : null
download: null
search: yes
sharing:
facebook: no
twitter: no
google: no
weibo: no
instapper: no
vk: no
all: ['twitter', 'facebook', 'google', 'weibo', 'instapaper']
toc:
depth: 2
collapse: section
scroll_highlight: yes
before: |
<li class='before'><a href="./">Machine Learning</a></li>
after: |
<li class='after'">
<a href="https://m-clark.github.io/">
<img src="img/mc_logo.png" style="width:25%; padding:0px 0; display:block; margin: 0 auto;" alt="MC logo">
</a>
</li>
<li class='after'">
<div style='text-align:center'>
<a href="https://github.com/m-clark/">
<i class="fab fa-github fa-2x" aria-hidden="true"></i>
</a>
</div>
</li>
<li class='after'">
<div style='text-align:center'>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">
<i class="fab fa-creative-commons fa-lg"></i>
<i class="fab fa-creative-commons-by fa-lg"></i>
<i class="fab fa-creative-commons-sa fa-lg"></i>
</a>
</div>
</li>
2 changes: 0 additions & 2 deletions 1000_appendix.Rmd → appendix.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@ For a given predictor variable $X_j$
<span class="emph">weights</span>: coefficients, parameters


# References


[^rfaster]: Actually, for this <span class="func">rf.fit</span> was slower than the default <span class="func">randomForest</span> function in R by about a second under similar settings.

Expand Down
31 changes: 21 additions & 10 deletions 03_blackbox.Rmd → blackbox.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -951,15 +951,26 @@ library(plotly)
plot_ly(data=d, x=~alcohol, y=~volatile.acidity, z=zmat,
type = 'surface',
colors = viridis::plasma(1e3, alpha = .75)) %>%
lazerhawk::theme_blank()
# %>%
# layout(plot_bgcolor='black',
# paper_bgcolor='black',
# scene = list(xaxis = a,
# yaxis = a,
# zaxis = a
# )
# )
lazerhawk::theme_blank() #%>%
# the following was used for readme img
# hide_colorbar() %>%
# layout(#plot_bgcolor='black',
# #paper_bgcolor='black',
# scene = list(
# xaxis = list(title='Alcohol',
# titlefont=list(family='Roboto, sans',
# size=12,
# color='#7f7f7f')),
# yaxis = list(title='Volatile Acidity',
# titlefont=list(family='Roboto, sans',
# size=12,
# color='#7f7f7f')),
# zaxis = list(title='Probability Good',
# titlefont=list(family='Roboto, sans',
# size=12,
# color='#7f7f7f'))
# )
# )

```

Expand Down Expand Up @@ -1021,7 +1032,7 @@ In the end, you'll have a good idea of what predictor variables are driving your
So we can see that alcohol content and volatile acidity are the most important, but what is the nature of the relationship? <span class="emph">Partial dependence plots</span> allow us to understand the predictive effect of any particular covariate, controlling for the effects of others. This is particularly important in the case where we have nonlinear relationships as we do here.
The <span class="pack">ggRandomForests</span> package provides such plots, as well as other ways to explore variable importance we'll look at. Unfortunately, they forgot to work with the basic <span class="objclass">randomForest</span> class objects, so we'll use the <span class="pack">randomForestSRC</span> package it is associated with. In general, you could get something similar by using the basic <span class="func">predict</span> function and a little effort.
The <span class="pack">ggRandomForests</span> package provides such plots, as well as other ways to explore variable importance we'll look at. Unfortunately, despite appearances to the contrary, I could find no example that used a basic <span class="objclass">randomForest</span> class object, and none worked with the final model, so we'll use the <span class="pack">randomForestSRC</span> package it is primarily associated with. In general though, you could get something similar by using the basic <span class="func">predict</span> function and a little effort.
```{r run_rfsrc}
Expand Down
Loading

0 comments on commit 632ccfd

Please sign in to comment.