SaccadeUnlikelihood

class eyefeatures.features.measures.SaccadeUnlikelihood(mu_p=1.0, sigma_p1=0.5, sigma_p2=1.0, mu_r=1.0, sigma_r1=0.3, sigma_r2=0.7, psi=0.9, x=None, y=None, aoi=None, pk=None, return_df=True, ignore_errors=False)[source]

Bases: MeasureTransformer

Saccade Unlikelihood.

Calculates cumulative negative log-likelihood of all the saccades in a scanpath with respect to a probabilistic saccade transition model. This model assumes saccades are either progressive or regressive, each following an asymmetric Gaussian distribution. Default distribution parameters are derived from Potsdam Sentence Corpus. Higher NLL indicates a less typical (or more unusual) scanpath according to the model.

Parameters:
  • mu_p (float) – mean of the progression (forward saccade) distribution.

  • sigma_p1 (float) – left standard deviation of the progression distribution (for lengths < mu_p).

  • sigma_p2 (float) – right standard deviation of the progression distribution (for lengths >= mu_p).

  • mu_r (float) – mean of the regression (backward saccade) distribution.

  • sigma_r1 (float) – left standard deviation of the regression distribution.

  • sigma_r2 (float) – right standard deviation of the regression distribution.

  • psi (float) – probability of performing a progressive saccade (vs. a regression).

  • x (str) – X coordinate column name.

  • y (str) – Y coordinate column name.

  • aoi (str) – Area Of Interest column name(-s).

  • pk (list[str]) – primary key.

  • return_df (bool) – whether to return output as DataFrame or numpy array.

  • ignore_errors (bool) – If True, return NaN when feature computation fails; otherwise raise.

Returns:

the cumulative Negative Log-Likelihood (NLL) of the saccades.

static nassym(s, mu, sigma1, sigma2)[source]

Calculates assymetric Gaussian PDF at point s.

Parameters:
  • s (float) – saccade length

  • mu (float) – mean of the distribution

  • sigma1 (float) – standard deviation for the left part of the distribution (s < mu)

  • sigma2 (float) – standard deviation for the right part of the distribution (s >= mu)

Returns:

probability density value for the given saccade length s

Return type:

float

calculate_saccade_proba(s)[source]

Calculates saccade probability.

Parameters:

s (float) – saccade length

Returns:

The probability of the saccade length s.

Return type:

float