Commit 8f5b4371 authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Use the same name in both functions to be consistent

parent 41b5ebbb
......@@ -106,7 +106,7 @@ sample_nb <- function(raster,
mc.cores = cores
)
for (k in 1:nb_mean) {
points[[k]] <- res[["k" = k]][["points_list"]]
points[[k]] <- res[["k" = k]][["points"]]
models[[k]] <- res[["k" = k]][["models"]]
oobe[, k] <- res[["k" = k]][["oobe"]][, 1]
}
......@@ -130,7 +130,7 @@ sample_nb <- function(raster,
ras_vx = ras.vx,
max_samples_per_class = max_samples_per_class
)
points[[k]] <- res$points_list
points[[k]] <- res$points
models[[k]] <- res$models
oobe[, k] <- res$oobe[, 1]
setTxtProgressBar(pb, k)
......
......@@ -22,7 +22,7 @@
#' @return a list with 4 elements:
#' 1) k To identify the used model \cr
#' 2) model The model - mmax \cr
#' 3) points_list List of points used part of the sample. \cr
#' 3) points List of points used part of the sample. \cr
#' 4) oobe The accuracy achieved by the model \cr
#' @keywords internal
model_opt_r <- function(k,
......@@ -41,7 +41,7 @@ model_opt_r <- function(k,
pbtn2,
ras_vx,
max_samples_per_class) {
points_list <- NULL
points <- NULL
models <- NULL
oobe <- matrix(NA, nrow = n, ncol = 1)
for (j in 1:n) {
......@@ -104,19 +104,19 @@ model_opt_r <- function(k,
if (j > 1) {
if (oobe[j, 1] < 0.02) {
models <- model1
points_list <- rbind(pbtn1, pbtn2)
points <- rbind(pbtn1, pbtn2)
break
}
if (oobe[(j - 1), 1] <= oobe[j, 1]) {
models <- model_pre
points_list <- rbind(pbtn1_pre, pbtn2_pre)
points <- rbind(pbtn1_pre, pbtn2_pre)
break
}
if (j == n & oobe[j, 1] >= 0.02) {
models <- NULL
points_list <- NULL
points <- NULL
break
}
}
......@@ -301,7 +301,7 @@ model_opt_r <- function(k,
return(list(
"k" = k,
"models" = models,
"points_list" = points_list,
"points" = points,
"oobe" = oobe,
))
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment