新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
創(chuàng)新互聯(lián)Python教程:Python數(shù)據(jù)歸一化如何理解
說(shuō)明

1、通過(guò)對(duì)原始數(shù)據(jù)進(jìn)行變換把數(shù)據(jù)映射到(默認(rèn)為[0,1])之間。
2、能夠加快梯度下降求最優(yōu)解的速度,并有可能提高精度。
實(shí)例
def minmax_demo():
"""
歸一化
:return:
"""
# 1.獲取數(shù)據(jù)
data = pd.read_csv('dating.txt')
data = data.iloc[:, :3]
# print("data:\n", data)
# 2.實(shí)例化一個(gè)轉(zhuǎn)換器類(lèi)
transfer = MinMaxScaler()
# 3.調(diào)用fit_transform
data_new = transfer.fit_transform(data)
print("data_new:\n", data_new)
return None注意:值和最小值是變化的。另外,值和最小值很容易受到異常點(diǎn)的影響,所以這種方法魯棒性健壯性)較差,只適用于傳統(tǒng)精確的小數(shù)據(jù)場(chǎng)景。
以上就是Python數(shù)據(jù)歸一化的理解,希望對(duì)大家有所幫助。更多Python學(xué)習(xí)指路:創(chuàng)新互聯(lián)python教程
本文教程操作環(huán)境:windows7系統(tǒng)、Python 3.9.1,DELL G3電腦。
文章標(biāo)題:創(chuàng)新互聯(lián)Python教程:Python數(shù)據(jù)歸一化如何理解
分享地址:http://fisionsoft.com.cn/article/codhdhj.html


咨詢(xún)
建站咨詢(xún)
