classify ¶
classify(
criteria,
rules,
*,
default="unclassified",
domains=None,
domain_column=None,
) -> ndarray
Labels each block with the first rule whose conditions all hold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
criteria
|
Table or dict of str to array_like
|
Per-block metrics, e.g. |
required |
rules
|
sequence of (str, dict), or dict of domain to such a sequence
|
|
required |
default
|
str
|
Label where no rule holds. |
'unclassified'
|
domains
|
array_like
|
Domain of each block, the keys of |
None
|
domain_column
|
str
|
The column of |
None
|
Examples:
>>> classify(d, [("measured", {"slope": (">=", 0.8), "n_holes": (">=", 3)}),
... ("indicated", {"slope": (">=", 0.5)})], default="inferred")
used in