kInverse: Inverse Kendall transform

View source: R/transforms.R

kInverseR Documentation

Inverse Kendall transform

Description

This function attempts to reverse Kendall transformation using a simple ranking agreement method, which always restores original ranking if the input corresponds to one, or a reasonable best-effort guess if not. Namely, each objects gets a score based on its relation with each other object, 2 points for a win ('>') and 1 point for a tie ('='); these scores are used to calculate ranks. This function can also be directly given greater-than scores, for instance confidence scores from some classifier trained on Kendall-transformed data.

Usage

kInverse(x)

Arguments

x

A Kendall-transformed feature to be converted back into a ranking. To be interpreted as a such, it must be a factor with levels being a subset of '<', '>' or '='. Alternatively, it may be a numeric vector of greater-than scores.

Value

Vector of ranks corresponding to x.

Note

An order of elements in x is crucial; if it is not the same as generated by the kTransform, results will be wrong. This function cannot assert that the order is correct.

References

"Kendall transformation brings a robust categorical representation of ordinal data" M.B. Kursa. SciRep 12, 8341 (2022).

Examples

kInverse(kTransform(1:7))

praznik documentation built on May 20, 2022, 5:06 p.m.