Finalise per-response-row tensor connections (fold + weight model)
finalize_row_connections.RdThe per-line step of tma's aggregation, before any summing: unordered rows are folded to the upper triangle, then the weight model is applied; ordered rows keep the directed n*n layout with the weight applied per cell.
Usage
finalize_row_connections(
row_conn,
n_codes,
ordered = FALSE,
weight = NULL,
diagonal = FALSE
)Arguments
- row_conn
Numeric matrix (n_response_rows x n_codes^2) of per-row directed counts, i.e.
apply_tensor()$row_connection_counts- n_codes
Number of codes
- ordered
TRUE = keep directed n*n rows; FALSE = fold to choose(n, 2)
- weight
Weight model name (
"binary","product","sqrt","log1p"), or TRUE/FALSE for the legacy binary flag (TRUE ="binary", FALSE ="product"). NULL (default) ="binary".- diagonal
Unordered only: keep self-connections in the folded rows, as columns A & A, A & B, B & B, ... (ordered rows always carry them)