[R-sig-Geo] How to check which model of an ensemble algorithm has been selected to perform regression?

Nikolaos Tziokas n|ko@@tz|ok@@ @end|ng |rom gm@||@com
Mon Sep 26 19:59:13 CEST 2022


I am using the R package machisplin
<https://github.com/jasonleebrown/machisplin> (it's not on CRAN) to
downscale a satellite image. According to the description of the package:

*The machisplin.mltps function simultaneously evaluates different
combinations of the six algorithms to predict the input data. During model
tuning, each algorithm is systematically weighted from 0-1 and the fit of
the ensembled model is evaluated. The best performing model is determined
through k-fold cross validation (k=10) and the model that has the lowest
residual sum of squares of test data is chosen. After determining the best
model algorithms and weights, a final model is created using the full
training dataset.*

My question is how can I check which model out of the 6 has been selected
for the downscaling? To put it differently, when I export the downscaled
image, I would like to know which algorithm (out of the 6) has been used to
perform the downscaling.

Here is the code:

library(MACHISPLIN)
library(raster)
library(gbm)

evi = raster("path/evi.tif") # covariate
ntl = raster("path/ntl_1600.tif") # raster to be downscaled
##convert one of the rasters to a point dataframe to sample.  Use any
raster input.
ntl.points<-rasterToPoints(ntl,
fun = NULL,
spatial = FALSE)
##subset only the x and y data
ntl.points<- ntl.points[,1:2]
##Extract values to points from rasters
RAST_VAL<-data.frame(extract(ntl, ntl.points))
##merge sampled data to input
InInterp<-cbind(ntl.points, RAST_VAL)
#run an ensemble machine learning thin plate spline
interp.rast<-machisplin.mltps(int.values = InInterp,
                              covar.ras = evi,
                              smooth.outputs.only = T,
                              tps = T,
                              n.cores = 4)
#set negative values to 0
interp.rast[[1]]$final[interp.rast[[1]]$final <= 0] <- 0

writeRaster(interp.rast[[1]]$final,
            filename = "path/ntl_splines.tif")

I vied all the output parameters (please refer to *Example 2* in the
package description) but I couldn't find anything relevant to my question.

I have posted a question
<https://github.com/jasonleebrown/machisplin/issues/10> on GitHub as well.
>From here
<https://drive.google.com/drive/folders/17SnegdgZ0192nqtP-95O55ZNPLngNMQH?usp=sharing>
you
can download my images.

-- 
Tziokas Nikolaos
Cartographer

Tel:(+44)07561120302
LinkedIn <http://linkedin.com/in/nikolaos-tziokas-896081130>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list