Skip to content

Commit

Permalink
update calls to leafem
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertocamara committed Nov 20, 2024
1 parent 7eadde8 commit f2a60ae
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/api_view.R
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@
x = st_obj_new,
opacity = opacity,
colors = colors,
method = "ngb",
method = "near",
group = "classification",
project = FALSE,
maxBytes = max_bytes
Expand Down
19 changes: 19 additions & 0 deletions inst/extdata/scripts/bayes_smooth.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
samples <- "~/Downloads/Amostras_Valida_Bayes_0711.gpkg"
samples.sf <- sf::st_read(samples)
samples.sf

# Create factor vectors for caret
unique_ref <- unique(samples.sf$label)
pred_fac <- factor(pred, levels = unique_ref)

ref_fac <- factor(samples.sf$label, levels = unique_ref)
no_smooth_fac <- factor(samples.sf[["no_smooth"]], levels = unique_ref)
bayes_fac <- factor(samples.sf$bayes, levels = unique_ref)
gauss_fac <- factor(samples.sf$gauss, levels = unique_ref)
# Call caret package to the classification statistics

acc_bayes <- caret::confusionMatrix(bayes_fac, ref_fac)
acc_gauss <- caret::confusionMatrix(gauss_fac, ref_fac)
acc_no_smooth <- caret::confusionMatrix(no_smooth_fac, ref_fac)


0 comments on commit f2a60ae

Please sign in to comment.