Skip to content

transition_matrix builtin

transition_matrix(
    depth,
    categories,
    holes,
    *,
    lag,
    tolerance=0.0,
    scheme=None,
    data=None,
)

Along-hole category transition matrix: for every sample, the classes of samples lag ± tolerance deeper in the same hole.

Parameters:

Name Type Description Default
depth array_like or str

Depth down the hole of each sample, or its column in data.

required
categories array_like or str

Class of each sample, int or str, or its column; null leaves the sample out. With scheme, numbers are its codes and labels are encoded by it; without, labels in the order of Categories.from_values.

required
holes array_like or str

Hole id of each sample, or its column.

required
lag float

Along-hole distance searched for a deeper sample.

required
tolerance float

Half-width of the lag window.

0.0
scheme Categories

Names and order of the classes.

None
data (PointSet, BlockModel, Table or dict)

Where column names are looked up.

None

Returns:

Type Description
Table

One row per pair of classes, from (shallower) then to (deeper) in class order: from, to, count and frequency (count over its row's total, null when the row has none).

used in