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 objs 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.


kachergis/XSLmodels documentation built on Feb. 25, 2024, 10:43 p.m.