regression_path_word#
- pymovements.measure.reading.regression_path_word(word_idx: str | Expr = 'word_idx') Expr[source]#
Get the word whose regression path each fixation belongs to.
The regression-path window of a word starts when the word is first entered in first pass (which is exactly the moment it becomes the running maximum of fixated word indices, as first-pass entry requires that no higher word has been fixated before) and ends when a fixation lands right of it (which is exactly when the running maximum increases past it). The windows of different words are therefore disjoint and partition the sequence, and every fixation belongs to the regression path of exactly one word: the current running maximum.
Apply
.over(group_columns)to partition into independent reading sequences.Warning
Requires onset-sorted input within each sequence.
- Parameters:
word_idx (str | pl.Expr) – Column name or expression of the fixated word index. (default:
'word_idx')- Returns:
Expression producing the
regression_path_wordcolumn.- Return type:
pl.Expr