Last updated: 2020-08-18
Checks: 6 1
Knit directory: baumarten/analysis/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20200723) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version f248923. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/.Rhistory
Ignored: analysis/figure/
Ignored: data/sen2/
Unstaged changes:
Modified: analysis/evaluation.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/evaluation.Rmd) and HTML (docs/evaluation.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| Rmd | 9e1da18 | wiesehahn | 2020-08-11 | update |
| html | 9e1da18 | wiesehahn | 2020-08-11 | update |
| Rmd | 3a7b47b | wiesehahn | 2020-08-04 | update |
| html | 3a7b47b | wiesehahn | 2020-08-04 | update |
| Rmd | c7df603 | wiesehahn | 2020-07-28 | general additions |
| html | c7df603 | wiesehahn | 2020-07-28 | general additions |
| html | f400426 | wiesehahn | 2020-07-23 | init |
| Rmd | 369d039 | wiesehahn | 2020-07-23 | wflow_git_commit(all = T) |
| Rmd | 27a9ab6 | wiesehahn | 2020-07-23 | wflow_git_commit(“evaluation.Rmd”) |
(classification steps and validation possibilities)
Reference data sampling locations
Tree species classification result for Solling
Tree species classification result for Harz
Tree species classification result for Heide
The Random Forest algorithm simply counts the fraction of trees in a forest that vote for a certain class to generate the predicted class. This class probability can be generated separately and provides insights in classification certainty.
Pixelwise classification probability (and average by latitude and longitiude) for the entire study region
Pixelwise classification probability (and average by latitude and longitiude) for Solling
Pixelwise classification probability (and average by latitude and longitiude) for Harz
Pixelwise classification probability (and average by latitude and longitiude) for Heide
Classification probabilities were extracted for each pixel inside reference polygons. The extracted values grant insight in classification certainty by tree species and reference site.
Classification probability by site and tree species for reference data locations
Class predictions for all reference pixels were extracted from the model prediction raster. These predictions were thought to be compared with the reference data label to produce an error matrix. The accuracy was expected to be biased since we used part of the reference data for training the model. But instead, all reference data was classified correctly. This might suggest that the model is overfitted to the reference data, performing very well on the reference data but weaker outside.
Error Matrix| Eiche | Buche | Fichte | Douglasie | Kiefer | Laerche | |
|---|---|---|---|---|---|---|
| Eiche | 6082 | 0 | 0 | 0 | 0 | 0 |
| Buche | 0 | 8025 | 0 | 0 | 0 | 0 |
| Fichte | 0 | 0 | 9495 | 0 | 0 | 0 |
| Douglasie | 0 | 0 | 0 | 1760 | 0 | 0 |
| Kiefer | 0 | 0 | 0 | 0 | 1896 | 0 |
| Laerche | 0 | 0 | 0 | 0 | 0 | 3232 |
BWI-plots in Lower Saxony were filtered by certain criteria to serve as validation data. Only plots with a relative tree species proportion of more than 75% in the main canopy layer for one of the classified tree species groups were considered. Class predictions for all pixels covered by these plots were extracted from the model prediction raster and compared against the inventory data.
Error Matrix| Buche | Douglasie | Eiche | Fichte | Kiefer | Laerche | |
|---|---|---|---|---|---|---|
| Buche | 147 | 0 | 9 | 7 | 3 | 1 |
| Douglasie | 1 | 5 | 0 | 18 | 63 | 0 |
| Eiche | 27 | 0 | 27 | 4 | 7 | 0 |
| Fichte | 1 | 1 | 0 | 155 | 25 | 0 |
| Kiefer | 1 | 1 | 0 | 23 | 180 | 1 |
| Laerche | 17 | 1 | 12 | 34 | 95 | 15 |
Respective Accuracy
Accuracy Kappa
0.6004540 0.4968075
Forest tracks, ways and official streets cut through the forest. Along these lines the spectral reflectances are heavily influenced by the surface material. Hence, the classification certainty is much lower along these features and tree species might be classified wrong.



In many areas the forest stocking changed in recent years due to drought, wind, bark beetle and other stressors. In these areas where healthy tree cover has been lost (and in these areas where it has never been) the reflectances are totally different from reflectances in healthy forest conditions. Hence, the classification certainty is much lower in these areas and tree species might be classified wrong.



Atmospheric conditions, namely haze, clouds, contrails and other aerosols, have a strong influence on the reflectance values. In areas where they are not correctly masked or corrected the classification certainty is much lower and tree species might be classified wrong.



R version 4.0.2 (2020-06-22)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] spdplyr_0.4.0 rasterVis_0.48 latticeExtra_0.6-29
[4] kableExtra_1.1.0 RColorBrewer_1.1-2 caret_6.0-86
[7] lattice_0.20-41 plotly_4.9.2.1 forcats_0.5.0
[10] stringr_1.4.0 dplyr_1.0.0 purrr_0.3.4
[13] readr_1.3.1 tidyr_1.1.0 tibble_3.0.3
[16] ggplot2_3.3.2 tidyverse_1.3.0 formattable_0.2.0.1
[19] raster_3.3-13 leaflet_2.0.3 rgdal_1.5-12
[22] sp_1.4-2
loaded via a namespace (and not attached):
[1] colorspace_1.4-1 ellipsis_0.3.1 class_7.3-17
[4] rprojroot_1.3-2 fs_1.4.2 rstudioapi_0.11
[7] hexbin_1.28.1 farver_2.0.3 prodlim_2019.11.13
[10] fansi_0.4.1 lubridate_1.7.9 xml2_1.3.2
[13] codetools_0.2-16 splines_4.0.2 knitr_1.29
[16] jsonlite_1.7.0 workflowr_1.6.2 pROC_1.16.2
[19] broom_0.7.0 dbplyr_1.4.4 png_0.1-7
[22] compiler_4.0.2 httr_1.4.2 backports_1.1.7
[25] assertthat_0.2.1 Matrix_1.2-18 lazyeval_0.2.2
[28] cli_2.0.2 later_1.1.0.1 leaflet.providers_1.9.0
[31] htmltools_0.5.0 tools_4.0.2 gtable_0.3.0
[34] glue_1.4.1 reshape2_1.4.4 Rcpp_1.0.5
[37] cellranger_1.1.0 vctrs_0.3.2 nlme_3.1-148
[40] iterators_1.0.12 crosstalk_1.1.0.1 timeDate_3043.102
[43] gower_0.2.2 xfun_0.15 rvest_0.3.6
[46] lifecycle_0.2.0 zoo_1.8-8 MASS_7.3-51.6
[49] scales_1.1.1 ipred_0.9-9 hms_0.5.3
[52] promises_1.1.1 parallel_4.0.2 yaml_2.2.1
[55] rpart_4.1-15 stringi_1.4.6 highr_0.8
[58] foreach_1.5.0 e1071_1.7-3 lava_1.6.7
[61] rlang_0.4.7 pkgconfig_2.0.3 spbabel_0.5.1
[64] evaluate_0.14 recipes_0.1.13 htmlwidgets_1.5.1
[67] tidyselect_1.1.0 plyr_1.8.6 magrittr_1.5
[70] R6_2.4.1 generics_0.0.2 DBI_1.1.0
[73] pillar_1.4.6 haven_2.3.1 whisker_0.4
[76] withr_2.2.0 survival_3.2-3 nnet_7.3-14
[79] modelr_0.1.8 crayon_1.3.4 rmarkdown_2.3
[82] jpeg_0.1-8.1 grid_4.0.2 readxl_1.3.1
[85] data.table_1.12.8 blob_1.2.1 git2r_0.27.1
[88] ModelMetrics_1.2.2.2 reprex_0.3.0 digest_0.6.25
[91] webshot_0.5.2 httpuv_1.5.4 stats4_4.0.2
[94] munsell_0.5.0 viridisLite_0.3.0