gpt4 book ai didi

python - PYTHON 中的 tanh 估计器归一化

转载 作者:行者123 更新时间:2023-11-28 22:29:21 25 4
gpt4 key购买 nike

有人知道如何在 python 中实现 tanh-estimator 吗?我有一个不遵循高斯分布的数字列表。我想使用 tanh-estimator 作为预处理步骤,但我不知道如何在 python 中实现它,因为它没有像 MinMaxScaler() 这样的定义函数。

提前致谢

最佳答案

@UrbanoFonsecaanswer 有一个例子:

import numpy as np

unnormalizedData = np.array([[15, 60], [5, 15], [45, 0], [0, 30]], dtype=np.float64)

m = np.mean(unnormalizedData, axis=0) # array([16.25, 26.25])
std = np.std(unnormalizedData, axis=0) # array([17.45530005, 22.18529919])

data = 0.5 * (np.tanh(0.01 * ((unnormalizedData - m) / std)) + 1)
#array([[0.49712291, 0.5076058 ],
# [0.49711136, 0.49746456],
# [0.50865938, 0.4940842 ],
# [0.49710558, 0.50084515]])

请注意,此代码实现了Efficient approach to Normalization of Multimodal Biometric Sc​​ores,2011 年提出的修改后的 tanh 估计器

在原始版本中,均值和标准差是由 Hampel 估计器估计的(Robust Statistics: The Approach Based on Influence Functions, 1986)

关于python - PYTHON 中的 tanh 估计器归一化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43061120/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com