Skip to content

Comments

Fix single fixation bug and entropy NaN handling#72

Merged
oscararenas12 merged 1 commit intomainfrom
bug-fixes-2-oa
Dec 19, 2025
Merged

Fix single fixation bug and entropy NaN handling#72
oscararenas12 merged 1 commit intomainfrom
bug-fixes-2-oa

Conversation

@oscararenas12
Copy link
Contributor

Bug Fixes: Fixation Filtering & Entropy NaN Handling

Fix 1: Single Fixation Not Saved

File: DataFilter.java
Problem: When a dataset has only one fixation, zero fixations were saved.
Cause: Edge case check required filtered.rowCount() != 0, which fails for single fixation.
Solution: Check lastValidFixation != null instead.

Before (1 fixation):

  • Row 1: fixation 1 → nothing saved
  • End of file → check fails (rowCount == 0)

After (1 fixation):

  • Row 1: fixation 1 → nothing saved
  • End of file → lastValidFixation exists, save it

Fix 2: Entropy Returns NaN Instead of 0

File: GazeEntropy.java
Problem: stationary_entropy and transition_entropy returned 0.0 when data was empty or invalid.
Solution: Return NaN when:

  • aoiProbability is empty (no fixations)
  • transitionProbability is empty (no transitions)

Before (empty data):

  • stationary_entropy: 0.0

After (empty data):

  • stationary_entropy: NaN
  • transition_entropy: NaN

- DataFilter: Save last fixation even when it's the only one
- GazeEntropy: Return NaN instead of 0 when no data exists
@oscararenas12 oscararenas12 merged commit 9d58296 into main Dec 19, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant