Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in sits_accuracy() #1245

Open
cs-caroline opened this issue Nov 26, 2024 · 1 comment
Open

Error in sits_accuracy() #1245

cs-caroline opened this issue Nov 26, 2024 · 1 comment
Labels

Comments

@cs-caroline
Copy link

I got this error when applying the sits_accuracy function:
Error: sits_accuracy_class_cube: NULL value not allowed for pred_ref - invalid validation data

I exported the validation samples that SITS generated and checked them in QGIS, after that, I exported the file and uploaded it to R again. I've tried the CSV, GPKG and SHP formats, but they all gave an error. The file has the columns label, start_date, end_date, longitude and latitude, and is in the EPSG:32722 projection. I checked if the labels are compatible, if the formats are correct, if the dates match, if there are any null values, but I didn't find anything that could lead to the error. Any idea what might be happening?

a2024_samples_sf <- sits_stratified_sampling(
  cube = a2024_map,
  sampling_design = a2024_sampling_design,
  alloc = "alloc_120",
  multicores = 4,
  shp_file = "D:/carol/Área de Trabalho/SER-411-Avançado/BDC/Cubo 2024/Classificação/validacao_2024.shp"
)

# Get ground truth points
valid_csv <- "D:/carol/Área de Trabalho/SER-411-Avançado/BDC/Cubo 2024/Classificação/r_2024.csv"
validation_data <- read.csv(valid_csv)

validation_data <- validation_data %>%
mutate(
start_date = as.Date("2024-01-01"),
end_date = as.Date("2024-10-01")
)

# Calculate accuracy according to Olofsson's method
area_acc <-
  sits_accuracy(
    a2024_map,
    validation = validation_data
    multicores = 4
)
@OldLipe
Copy link
Contributor

OldLipe commented Nov 26, 2024

Hi @cs-caroline, thank you for reporting the issue.

I could not reproduce your error. Could you please share your validation sample file with us? It can be just a few samples so we can run with them and try to reproduce the error. Also, it would be good if you shared the full script you are using so we can explore the previous steps as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants