Cookbook¶
Short recipes for common eyeprocesspy tasks. These snippets are intentionally small; use the linked worked examples and articles when the analysis decision itself needs justification.
Import a vendor export¶
import eyeprocesspy as ep
eye = ep.read_eye_export("participant_001.csv", vendor="auto")
issues = ep.validate_eye_dataset(eye)
Discover supported adapters¶
Inspect one canonical table¶
Validate before analysis¶
issues = ep.validate_eye_dataset(eye)
errors = issues.loc[issues["severity"].eq("error")]
if not errors.empty:
raise RuntimeError(errors.to_string(index=False))
Extract a scanpath¶
Build a normalized AOI transition matrix¶
Compute gaze entropy¶
Plot a gaze trace¶
Retrieve the data behind a plot¶
For matrix plots:
Plot fixations¶
Plot a scanpath¶
Plot a gaze heatmap¶
Plot pupil time series¶
Estimate effective sampling frequency¶
quality = ep.effective_sampling_frequency(
samples,
time="timestamp_ms",
unit="ms",
by="recording_id",
)
Audit sampling irregularity¶
audit = ep.audit_sampling_irregularity(
samples,
time="timestamp_ms",
unit="ms",
by="recording_id",
cv_threshold=0.05,
)
Fit an empirical calibration-error model¶
model = ep.calibration_error_model(calibration_validation_data)
ellipse = ep.gaze_uncertainty_ellipse(model, level=0.95)
Propagate calibration uncertainty to AOIs¶
Estimate repeated-measure reliability¶
profile = ep.process_reliability_profile(
repeated,
person="person",
session="session",
measure="dwell_score",
)
Inspect the process-measure registry¶
registry = ep.process_measure_registry()
gaze_measures = ep.find_process_measures(registry, channel="gaze")
Read a measure's guardrail card¶
Plot an IRT information profile¶
Plot item fit¶
Plot a DIF curve¶
Capture provenance¶
Verify the bundled benchmark¶
study = ep.eyeprocess_benchmark_study()
audit = ep.validate_benchmark_study(study)
print(audit["valid"])