Skip to content

Commit

Permalink
Deploy commit: replace hyphen by whitespace again 2ee5807
Browse files Browse the repository at this point in the history
  • Loading branch information
jannes-m committed Oct 7, 2024
1 parent c5fab38 commit ff5d6ee
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions 12-spatial-cv.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ However, it is possible to include spatial autocorrelation\index{autocorrelation
Though, this is beyond the scope of this book, we give the interested reader some pointers where to look it up:

1. The predictions of regression kriging combines the predictions of a regression with the kriging of the regression's residuals [@goovaerts_geostatistics_1997; @hengl_practical_2007; @bivand_applied_2013].
2. One can also add a spatial correlation (dependency) structure to a generalized least squares model (`nlme::gls()`; @zuur_mixed_2009; @zuur_beginners_2017).
2. One can also add a spatial correlation (dependency) structure to a generalized least squares model [`nlme::gls()`; @zuur_mixed_2009; @zuur_beginners_2017].
3. One can also use mixed-effect modeling approaches.
Basically, a random effect imposes a dependency structure on the response variable which in turn allows for observations of one class to be more similar to each other than to those of another class [@zuur_mixed_2009].
Classes can be, for example, bee hives, owl nests, vegetation transects or an altitudinal stratification.
Expand Down Expand Up @@ -657,7 +657,7 @@ score_spcv_svm = dplyr::filter(score, learner_id == "classif.ksvm.tuned",
resampling_id == "repeated_spcv_coords")
```

Let us have a look at the final AUROC\index{AUROC}: the model's ability to discriminate the two classes.
Let's have a look at the final AUROC\index{AUROC}: the model's ability to discriminate the two classes.


``` r
Expand Down
2 changes: 1 addition & 1 deletion 14-location.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ That is, if there already is a bike shop in the vicinity of the chosen location,
E1. Download the csv file containing inhabitant information for a 100 m cell resolution (https://www.zensus2011.de/SharedDocs/Downloads/DE/Pressemitteilung/DemografischeGrunddaten/csv_Bevoelkerung_100m_Gitter.zip?__blob=publicationFile&v=3).
Please note that the unzipped file has a size of 1.23 GB.
To read it into R, you can use `readr::read_csv`.
This takes 30 seconds on a machine with 16-GB RAM.
This takes 30 seconds on a machine with 16 GB RAM.
`data.table::fread()` might be even faster, and returns an object of class `data.table()`.
Use `dplyr::as_tibble()` to convert it into a tibble.
Build an inhabitant raster, aggregate it to a cell resolution of 1 km, and compare the difference with the inhabitant raster (`inh`) we have created using class mean values.
Expand Down
Binary file modified figures/circle-intersection-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/points-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion location.html
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ <h2>
<p>E1. Download the csv file containing inhabitant information for a 100 m cell resolution (<a href="https://www.zensus2011.de/SharedDocs/Downloads/DE/Pressemitteilung/DemografischeGrunddaten/csv_Bevoelkerung_100m_Gitter.zip?__blob=publicationFile&amp;v=3" class="uri">https://www.zensus2011.de/SharedDocs/Downloads/DE/Pressemitteilung/DemografischeGrunddaten/csv_Bevoelkerung_100m_Gitter.zip?__blob=publicationFile&amp;v=3</a>).
Please note that the unzipped file has a size of 1.23 GB.
To read it into R, you can use <code><a href="https://readr.tidyverse.org/reference/read_delim.html">readr::read_csv</a></code>.
This takes 30 seconds on a machine with 16-GB RAM.
This takes 30 seconds on a machine with 16 GB RAM.
<code><a href="https://rdatatable.gitlab.io/data.table/reference/fread.html">data.table::fread()</a></code> might be even faster, and returns an object of class <code><a href="https://rdatatable.gitlab.io/data.table/reference/data.table.html">data.table()</a></code>.
Use <code><a href="https://tibble.tidyverse.org/reference/as_tibble.html">dplyr::as_tibble()</a></code> to convert it into a tibble.
Build an inhabitant raster, aggregate it to a cell resolution of 1 km, and compare the difference with the inhabitant raster (<code>inh</code>) we have created using class mean values.</p>
Expand Down
2 changes: 1 addition & 1 deletion search.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions spatial-cv.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ <h2>
Though, this is beyond the scope of this book, we give the interested reader some pointers where to look it up:</p>
<ol style="list-style-type: decimal">
<li>The predictions of regression kriging combines the predictions of a regression with the kriging of the regression’s residuals <span class="citation">(<a href="references.html#ref-goovaerts_geostatistics_1997">Goovaerts 1997</a>; <a href="references.html#ref-hengl_practical_2007">Hengl 2007</a>; <a href="references.html#ref-bivand_applied_2013">Bivand, Pebesma, and Gómez-Rubio 2013</a>)</span>.</li>
<li>One can also add a spatial correlation (dependency) structure to a generalized least squares model (<code><a href="https://rdrr.io/pkg/nlme/man/gls.html">nlme::gls()</a></code>; <span class="citation">A. Zuur et al. (<a href="references.html#ref-zuur_mixed_2009">2009</a>)</span>; <span class="citation">A. F. Zuur et al. (<a href="references.html#ref-zuur_beginners_2017">2017</a>)</span>).<br>
<li>One can also add a spatial correlation (dependency) structure to a generalized least squares model [<code><a href="https://rdrr.io/pkg/nlme/man/gls.html">nlme::gls()</a></code>; <span class="citation">A. Zuur et al. (<a href="references.html#ref-zuur_mixed_2009">2009</a>)</span>; <span class="citation">A. F. Zuur et al. (<a href="references.html#ref-zuur_beginners_2017">2017</a>)</span>].<br>
</li>
<li>One can also use mixed-effect modeling approaches.
Basically, a random effect imposes a dependency structure on the response variable which in turn allows for observations of one class to be more similar to each other than to those of another class <span class="citation">(<a href="references.html#ref-zuur_mixed_2009">A. Zuur et al. 2009</a>)</span>.
Expand Down Expand Up @@ -763,7 +763,7 @@ <h3>
<code class="sourceCode R"><span><span class="va">score</span> <span class="op">=</span> <span class="fu"><a href="https://rspatial.github.io/terra/reference/serialize.html">readRDS</a></span><span class="op">(</span><span class="st">"extdata/12-bmr_score.rds"</span><span class="op">)</span></span>
<span><span class="va">score_spcv_svm</span> <span class="op">=</span> <span class="fu">dplyr</span><span class="fu">::</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span><span class="op">(</span><span class="va">score</span>, <span class="va">learner_id</span> <span class="op">==</span> <span class="st">"classif.ksvm.tuned"</span>, </span>
<span> <span class="va">resampling_id</span> <span class="op">==</span> <span class="st">"repeated_spcv_coords"</span><span class="op">)</span></span></code></pre></div>
<p>Let us have a look at the final AUROC: the model’s ability to discriminate the two classes.</p>
<p>Let’s have a look at the final AUROC: the model’s ability to discriminate the two classes.</p>
<div class="sourceCode" id="cb439"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># final mean AUROC</span></span>
<span><span class="fu"><a href="https://rspatial.github.io/terra/reference/math-generics.html">round</a></span><span class="op">(</span><span class="fu"><a href="https://rspatial.github.io/terra/reference/summarize-generics.html">mean</a></span><span class="op">(</span><span class="va">score_spcv_svm</span><span class="op">$</span><span class="va">classif.auc</span><span class="op">)</span>, <span class="fl">2</span><span class="op">)</span></span>
Expand Down

0 comments on commit ff5d6ee

Please sign in to comment.