Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of data normalization in Python

Shulou Source: shulou.com Published: 2022-06-03 15:34:09 09月20日 Update

This article mainly introduces the example analysis of data normalization in Python. The introduction in this article is very detailed and has certain reference value. Interested friends must read it!

description

1. Map the data to (default is [0,1]) by transforming the original data.

2. It can accelerate the speed of gradient descent to find the optimal solution, and it is possible to improve the accuracy.

examples

def minmax_demo(): """ normalized :return: """ # 1. Get data data = pd.read_csv('dating.txt') data = data.iloc[:, :3] # print("data:\n", data) # 2. Instantiate a converter class transfer = MinMaxScaler() # 3. Call fit_transform data_new = transfer.fit_transform(data) print("data_new:\n", data_new) return None

Note: Maximum and minimum values vary. In addition, the maxima and minima are easily affected by outliers, so this method is less robust and only suitable for traditional accurate small data scenarios.

That's all for "Example Analysis of Data Normalization in Python." Thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Tags: Data examples analysis maximum minimum content instance maximum article robust original accurate poor between value tradition interest scene boy buddy Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Linux MariaDB NVidia OPPO Reno