create_cooc_matrix: Creates co-occurrence matrix from training trials

View source: R/helper.R

create_cooc_matrixR Documentation

Creates co-occurrence matrix from training trials

Description

Given a training order (list of words and objects per trial), this function returns a matrix tallying word-object co-occurrences across the trials. This matrix can be used to analyze the frequency with which certain words and objects appear together during the training phase.

Usage

create_cooc_matrix(train)

Arguments

train

A list representing the training data, where each element is a trial that includes both words and objects. The structure is expected to have sub-elements words and objects for each trial.

Value

A matrix where each element represents the count of co-occurrences between a word (rows) and an object (columns). The row and column names correspond to the unique words and objects found in the training data, respectively.

Examples

create_cooc_matrix(xsl_datasets[[1]]$train)

XSLmodels documentation built on Oct. 18, 2026, 5:08 p.m.