美文网首页
Yeo-Johnson变换

Yeo-Johnson变换

作者: 山有木兮木有刺 | 来源:发表于2020-10-19 20:08 被阅读0次

    1 为什么要进行Yeo-Johnson变换

    To better meet the assumptions of normality and homogenous variances

    Yeo-Johnson transformation provides a powerful way of reducing skewness and can be applied to variables that include negative values【1】

    参考文献:【1】Global effects of soil and climate on leaf photosynthetic traits and rates 

    备注:

    help(preprocessing.scale)

    scale(X, axis=0, with_mean=True, with_std=True, copy=True)

    axis=0:默认是按照每一个特征(即按照列)进行标准化;

    axis=1:则为行,按照样本进本进行标准化

    代码:


    import numpyas np

    from sklearn.preprocessingimport PowerTransformer

    pt =PowerTransformer(method='yeo-johnson', standardize=True, copy=True)

    data = [[1, 2], [3, 2], [4, 5]]

    print(pt.fit(data))

    PowerTransformer()

    print(pt.lambdas_)

    print(pt.transform(data))

    相关文章

      网友评论

          本文标题:Yeo-Johnson变换

          本文链接:https://www.haomeiwen.com/subject/yjslmktx.html