knitr::opts_chunk$set(
  fig.retina = 3,
  fig.align = "center",
  out.width = "100%",
  echo = FALSE
)
source(here::here("code/99-packages.R"))
load_packages()
sourceDirectory("R")

# load drake objects
loadd(
  defoliation_raster,
  defoliation_raster_relative,
  defoliation_df,
  defoliation_df_relative,

  tune_xgboost_plan_project
)

Predicted defoliation (absolute)

Predicted defoliation by XGBOOST on 20 m spatial resolution in the Basque Country.

With an RMSE of 36 % (for a range of 0 - 100), the model focuses its prediction to the mean of the response range (0 - 100) to achieve acceptable performance results on the test set.

The following vegetation indices have been used, selected by the internal variable importance rating of XGBOOST:

Optimization path of hyperparameter tuning

The following shows the optimization path (RMSE) of the hyperparameter tuning for the XGBOOST model using 20 MBO iterations (with a starting design of 30).

suppressMessages(getOptPathY(tune_xgboost_plan_project$opt.path))

Some more details on the optimization path are presented below:

suppressMessages(plotOptPath(tune_xgboost_plan_project$opt.path))

Predicted Defoliation (relative)

Since these absolute values do not reflect the truth, we decided to create a relative Index from the predicted absolute values.

This was done by calling

scale(data$defoliation,
  center = FALSE,
  scale = max(data$defoliation, na.rm = TRUE) / 100
)

which re-scales the data from 0 - 100. The code was adapted from this Stackoverflow answer.

Defoliation evaluation {.tabset .tabset-fade}

Absolute defoliation {.tabset .tabset-fade}

Maps

2017

plot <- create_defoliation_map(defoliation_raster[[1]],
  algorithm = "XGBOOST",
  limits = c(35, 60), title = "Defoliation of trees [%]"
)
suppressWarnings(suppressMessages(print(plot)))

2018

plot <- create_defoliation_map(defoliation_raster[[2]],
  algorithm = "XGBOOST",
  limits = c(35, 60), title = "Defoliation of trees [%]"
)
suppressWarnings(suppressMessages(print(plot)))

Histograms

2017

hist <- suppressWarnings(suppressMessages(ggplot(defoliation_df[[1]], aes(x = defoliation)) +
  geom_histogram() +
  labs(x = "Defoliation (%)") +
  theme_pubr()))

suppressMessages(print(hist))

2018

hist <- suppressWarnings(suppressMessages(ggplot(defoliation_df[[2]], aes(x = defoliation)) +
  geom_histogram() +
  labs(x = "Defoliation (%)") +
  theme_pubr()))
suppressMessages(print(hist))

Relative defoliation {.tabset .tabset-fade}

Maps

2017

plot <- create_defoliation_map(defoliation_raster_relative[[1]],
  algorithm = "XGBOOST",
  limits = c(65, 100), title = "Relative defoliation of trees"
)
suppressWarnings(suppressMessages(print(plot)))

2018

plot <- create_defoliation_map(defoliation_raster_relative[[2]],
  algorithm = "XGBOOST",
  limits = c(65, 100), title = "Relative defoliation of trees"
)
suppressWarnings(suppressMessages(print(plot)))

Histograms

2017

hist <- suppressWarnings(suppressMessages(ggplot(
  defoliation_df_relative[[1]],
  aes(x = defoliation)
) +
  geom_histogram() +
  labs(x = "Relative defoliation of trees") +
  theme_pubr()))
suppressMessages(print(hist))

2018

hist <- suppressWarnings(suppressMessages(ggplot(
  defoliation_df_relative[[2]],
  aes(x = defoliation)
) +
  geom_histogram() +
  labs(x = "Relative defoliation of trees") +
  theme_pubr()))
suppressMessages(print(hist))
#system("rsync -rlptDivzog --chown=*:www-data --chmod=g+r,o+r /home/patrick/papers/2019-feature-selection/docs/figure/report-defoliation.Rmd/defol* patrick@jupiter.geogr.uni-jena.de:/home/www/life-healthy-forest/action-B1-spatial-mapping/defoliation-maps/")


pat-s/2019-feature-selection documentation built on Dec. 24, 2021, 8:40 a.m.