简体   繁体   English

如何在 MinMaxScaler 中反向归一化

[英]How to Reversed Normalization in MinMaxScaler

i have a data that range between 0 - 2,9.我有一个介于 0 - 2,9 之间的数据。

I need it to be normalized with MinMaxScaler with 0 - 1 range.我需要用 0 - 1 范围的 MinMaxScaler 对其进行标准化。

I need to transform 2.9 into 0 and 0 into 1. My solution is to subtract all numbers with 2.9 and make it absolute.我需要将 2.9 转换为 0,将 0 转换为 1。我的解决方案是用 2.9 减去所有数字并使其成为绝对值。 But is there any other way more efficient than that?但是还有比这更有效的方法吗? I'm using sklearn for normalization我正在使用 sklearn 进行标准化

All you have to do is to multiply your data by -1 prior to normalization.您所要做的就是在标准化之前将您的数据乘以 -1。 With that your max value (2.9) becomes the new min value (-2.9) that gets normalized to 0 and your min (0) becomea the new max that gets normalized to 1.这样,您的最大值 (2.9) 变成了新的最小值 (-2.9),它被标准化为 0,而您的最小值 (0) 变成了新的最大值,它被标准化为 1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM