【问题标题】:Normalize two arrays with second array the base for normalizing first array规范化两个数组,其中第二个数组是规范化第一个数组的基础
【发布时间】:2021-12-13 11:50:01
【问题描述】:

为了找到 Pareto 前沿的质量指标,如世代距离、倒置世代距离、Epsilon 指标和 HyperVolume,我想标准化在基于参考前沿求解算法时获得的近似前沿值,我假设包含近似前沿。

reference_front = np.array([[0.5, 2.0], [1, 1.0], [1.2, 0.833], [2.3, 0.435], [3, 0.333]])
approximation_front = np.array([[0.8, 2.5], [1.0, 2.0], [2.1, 0.952], [2.8, 0.714]])
reference_point = [max(approximation_front[:,0]),max(approximation_front[:,0])]

我已使用以下代码进行规范化。但是,一次只针对一个数组

from sklearn.preprocessing import MinMaxScaler
    min_max_scaler = MinMaxScaler()
reference_front_norm = min_max_scaler.fit_transform(reference_front)
approximation_front_norm = min_max_scaler.fit_transform(approximation_front)
reference_point = [max(approximation_front[:,0]),max(approximation_front[:,0])]

这里,近似前沿和参考前沿分别进行归一化。我们能否根据参考前沿的最大值和最小值将近似前沿归一化在 0 到 1 之间。

【问题讨论】:

  • 如果您更详细地描述期望的和实际的结果将会很有帮助。有实际输出和期望输出。

标签: python arrays optimization normalization pareto-optimality


【解决方案1】:

申请fit_transform后,您可以简单地使用transform。这将使用来自fit_transform 调用的“适合”。你的情况

reference_front_norm = min_max_scaler.fit_transform(reference_front)
approximation_front_norm = min_max_scaler.transform(approximation_front)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-06-04
    • 1970-01-01
    • 1970-01-01
    • 2014-09-21
    • 2016-05-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多