【问题标题】:R: How to check which model of an ensemble algorithm has been selected to perform regression?R:如何检查选择了哪个集成算法模型来执行回归?
【发布时间】:2022-09-27 22:37:30
【问题描述】:

我正在使用Rmachisplin(它不在 CRAN 上)来缩小卫星图像。根据包装说明:

machisplin.mltps 函数同时评估六种算法的不同组合以预测输入数据。在模型调整期间,每个算法从 0-1 系统地加权,并评估集成模型的拟合度。通过 k 折交叉验证 (k=10) 确定性能最佳的模型,并选择测试数据的残差平方和最小的模型。在确定最佳模型算法和权重后,使用完整的训练数据集创建最终模型。

我的问题是如何检查 6 个模型中的哪个模型已被选择用于缩减?换句话说,当我导出缩小的图像时,我想知道使用哪种算法(在 6 种算法中)来执行缩小。

这是代码:

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\")

我测试了所有的输出参数(请参考示例 2在包装说明中),但我找不到与我的问题相关的任何内容。

我也在GitHub 上发布了question。从here 你可以下载我的图片。

    标签: r algorithm model raster


    【解决方案1】:

    我认为这是一种误解; mahcisplin,不测试 6 并给出一个。它尝试了许多 6 的合奏,它给出了一个合奏……或者换句话说 这是我将获得的最佳“6 种算法组合”,而不是选择的 6 种算法之一。

    它将得到类似“20% algo1、10% algo2 等的模型”,而不是“algo1 是最好的选择”

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-29
      • 1970-01-01
      • 1970-01-01
      • 2012-04-17
      • 2019-05-09
      • 1970-01-01
      • 1970-01-01
      • 2013-11-22
      相关资源
      最近更新 更多