我正在使用R包马鞭素 (不是在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上发布了一个GitHub。您可以从这里下载我的图片。
发布于 2022-09-27 14:37:30
我认为这是一个误解,自恋,不是测试6,并给出一个。它尝试了许多6人的组合,并给出了一个合奏.换句话说,这是我将得到的6种算法的最佳组合,而不是6种算法中的一种。
它将得到“一个20% algo1,10% algo2等的模型”,而不是"algo1是最好的和选择的“。
https://stackoverflow.com/questions/73856069
复制相似问题