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

addBanterDetector suggested modification in cases with insufficient data in detector #3

Open
shannonrankin opened this issue Jan 27, 2023 · 7 comments

Comments

@shannonrankin
Copy link

Problem:
When adding multiple detectors to a banter modeling using addBanterDetector, if one or more of the detectors has insufficient data to build a detector model, Banter gives an error such as:
Error in .getSampsize(df$species, sampsize, paste0("Detector model (", :
Detector model (Click_Detector_1) has 1 species (need at least 2 for model)

This error results in a full-stop of the processing (no data is added to the model).

There will be cases where this happens, but a model can be built using the detectors with sufficient data.

Suggested modification:
Print a warning (instead of an error) identify the detector(s) with insufficient data
and
Populate the model with the detectors it CAN use

** There is a workaround by specifying the exact detectors to use; but since this will be a thing that happens not infrequently, the modification may make it more user friendly**

@EricArcher
Copy link
Owner

I've made a modification that changes these errors to warnings. It should run through now, but I don't have the data to test. Please give it a go and let me know if it's performing properly. If not, can you send me a minimal dataset that replicates the error and I'll work on it more.

@shannonrankin
Copy link
Author

Eric- It seems to work in general, but there might be a lingering dust mite? When I plot the summary of the banter model after adding the detector models, I now get an error: Error in getBanterModel(x, model) : trying to get slot "model" from an object of a basic class ("NULL") with no slots

When I try to runBanterModel I get the following error:
Error in is.data.frame(y) :
trying to get slot "ids" from an object of a basic class ("NULL") with no slots

I will send a test dataset separately (github would not support that file time)

@shannonrankin
Copy link
Author

shannonrankin commented Jan 31, 2023 via email

@EricArcher
Copy link
Owner

Can't see the attached data, but I think I could see what was causing the error. I've made a fix, so give it another go.

@shannonrankin
Copy link
Author

Eric-
Test dataset was attached to the email-- but it would not allow me to attach directly to the Issue (so I think the email did not attach it). I will send in a separate email.

I installed the latest banter from github (0.9.5) and I get the same errors. I went through the hoops of ensuring I had the latest update from Github, reloading my entire workstation & data in a fresh environment, etc.

I can run the addBanterDetector and it appears to be working, but again when I run the summary(banter_model) I get the following error: Error in getBanterModel(x, model) :
trying to get slot "model" from an object of a basic class ("NULL") with no slots

And when I try to run the runBanterModel (event level), I get the following error:
Error in is.data.frame(y) :
trying to get slot "ids" from an object of a basic class ("NULL") with no slots

FWIW, I am ok with reverting back to the original and dealing with it-- it will come up regularly, but it is something we can deal with. I will send the subsetted data separately via email.

@EricArcher
Copy link
Owner

Found the bug - small error in how I made an earlier update. I've tested it on your example data and so far it works - excluding Detectors 1 and 7 from the model, but proceeding normally. Give it a go and let me know if you see anything else funky.

@shannonrankin
Copy link
Author

Looks great to me-- I'll reach out if I see any other questionable behavior-- but thank you!!
:)

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

No branches or pull requests

2 participants