1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

C#(.NET)で Min-Max 正規化

Posted at

Min-Max 正規化

正規化とはデータのスケール(単位)を扱いやすいものに整えることである。
Min-Max 正規化とは最小値0~最大値1にスケーリングする処理である。

x^i_{norm} = \frac{x^i - x_{min}}{x_{max} - x_{min}}
code.cs
List<double> MinMaxNormalization(List<double> data)
{
    double max = data.Max();
    double min = data.Min();

    List<double> result = new();
    foreach (double d in data)
    {
        result.Add((d - min) / (max - min));
    }

    return result;
}

参考

  • 正規化(Normalization)/標準化(Standardization)とは?

  • 正規化・標準化を徹底解説 (Python 前処理 サンプルコード付き)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?