Skip to main content

Module contingency_table

Module contingency_table 

Source

Functionsยง

build_global_category_map
Number every distinct value in arr (smallest gets 0, next gets 1, and so on). Pass the same map to several calls of contingency_table_with_categories to get tables that share the exact same rows and columns.
contingency_table
Count how often each pair (col1[i], col2[i]) occurs and return the counts as a 2D table. Rows and columns are ordered by value, so the result does not depend on the order of the inputs.
contingency_table_from_indices
contingency_table_with_categories
Like contingency_table, but the rows and columns are fixed by the maps you pass in. Use this when several tables need the same shape, even if some values are missing from a particular table.