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

classify_idt function results in NANs and can't continue #1

Open
thomasgoodge opened this issue Jul 5, 2023 · 2 comments
Open

classify_idt function results in NANs and can't continue #1

thomasgoodge opened this issue Jul 5, 2023 · 2 comments

Comments

@thomasgoodge
Copy link

thomasgoodge commented Jul 5, 2023

Hi,

I'm trying to classify fixations in some eye tracking data from the HoloLens using the classify_idt function but I'm running into an error.

Warning: NaNs producedError in if (idt_angleDeg > dispersion_threshold) { : missing value where TRUE/FALSE needed

with the warning

In addition: Warning message: In acos(idt_scalar/(idt_iVector_length * idt_jVector_length)) : NaNs produced

I am looping through a series of data frames and this only happens for some of my data files and not others. I have gone through the ones that worked and the ones that didn't and can't see where the difference is or why it would not be able to calculate the idt_angleDeg. Any help you could offer would be greatly appreciated!

@thomasgoodge
Copy link
Author

I can see it's specifically when adding new points to the classification window, lines 236-252 in the function code. It gets to row 9047 and then returns a Nan. I've checked the dataframe and the raw datafile and there doesn't seem to be anything different about this line, nor is it reaching the end as there is still ~7000 observations to run through. Any ideas?

@sekapp
Copy link

sekapp commented Jul 6, 2023

Hi,

sadly I can't really answer this question/report without access to the data and extensive detective work.

Based on your description I assume the issue is within the acos function and that this function does not produce a result for the given value(s).
Maybe you can look at your row 9047 and the ones before it, check the values for idt_scalar, idt_iVector_length and idt_jVector_length used in line 243 and manually calculate the acos result. This way it hopefully gets obvious where the issue is.
If you already have NaNs at this point, or the values are indeed invalid for the acos function, maybe you can follow the calculations back up the script and compare what differs in your row 9047 compared to the previous rows regarding the interim results used in the calculations.

Based on your observation you then might be able to either fix the raw data (e.g. ommiting lines where recording errors occurred) or add additional validity checks in the script which skip or fill in invalid cases.

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

No branches or pull requests

2 participants