> For the complete documentation index, see [llms.txt](https://vinayin.gitbook.io/pyeta/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vinayin.gitbook.io/pyeta/description/validation.md).

# Validation

Upon clicking `Validate Eye Tracker`  button, the `window.py` script runs the validation paradigm. The user follows a moving dot, and `pyETA` crunches the gaze data against target positions. The `validate.py` script checks how well your tracker performed at time `t`  to target positions on a 3x3 grid.  The table generated provides with metrics for each grid position (0-8), plus percentiles and mean.&#x20;

### **Metrics**

The table lists 6 metrics per grid position (0-8), with a summary stat (25%, 50%, 75%, mean) below the separator denoted by `---`  that shows the cumulative description of grid 3x3 (group 0-8). Here’s what each of the 6 metric column means:

<figure><img src="/files/gCTcFPqHK1hWFYi2u8yb" alt=""><figcaption><p>validation metric</p></figcaption></figure>

<table><thead><tr><th width="271">Columns</th><th width="324.5">Description</th></tr></thead><tbody><tr><td>group</td><td>Grid, top-left is 0 and bottom-right is 8</td></tr><tr><td>target_position</td><td>Screen coordinate, in pixels</td></tr><tr><td>distance (target to gaze points)</td><td>Average distance from target to all gaze points (left + right eyes averaged).</td></tr><tr><td>spread (target to gaze points)</td><td>Standard deviation of those distances </td></tr><tr><td>mean gaze point</td><td>Average x/y of gaze points per group.</td></tr><tr><td>distance (mean to target)</td><td>Distance from mean gaze point to target <code>measures accuracy</code></td></tr><tr><td>distance (mean to gaze points)</td><td>Average distance from mean gaze point to individual gaze points. <code>measures precision</code></td></tr><tr><td>spread (mean to gaze points)</td><td>Standard deviation of distances from mean to gaze points</td></tr></tbody></table>

<details>

<summary>Metric Calculation Algorithm</summary>

The algorithm in `validate.py` does the following:

1. **Load Data**: Pull gaze and validation JSONs.
2. **Preprocess**: Filter gaze data to match validation timestamps, group by target position.
3. **Calculate Per Group**:
   * Compute mean gaze point (average x/y for left + right eyes).
   * Calculate distances: target to each gaze point, mean to target, mean to each gaze point.
   * Calculate spreads: standard deviations for target-to-gaze and mean-to-gaze distances.
4. **Summarize**: Compute percentiles (25%, 50%, 75%) and mean across groups.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://vinayin.gitbook.io/pyeta/description/validation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
