check_increasing#
- sklearn.isotonic.check_increasing(x, y)#
确定y是否与x单调相关。
基于Spearman相关性检验,发现y相对于x是增加还是减少。
- Parameters:
- x形状为(n_samples,)的类数组
训练数据。
- y形状为(n_samples,)的类数组
训练目标。
- Returns:
- increasing_bool布尔值
关系是增加还是减少。
References
Fisher变换。维基百科。 https://en.wikipedia.org/wiki/Fisher_transformation
Examples
>>> from sklearn.isotonic import check_increasing >>> x, y = [1, 2, 3, 4, 5], [2, 4, 6, 8, 10] >>> check_increasing(x, y) True >>> y = [10, 8, 6, 4, 2] >>> check_increasing(x, y) False