为了找到帕累托锋的代际距离、倒置代际距离、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之间的近似锋进行规范化吗?
发布于 2021-10-28 09:31:50
应用fit_transform之后,您可以简单地使用transform。这将使用fit_transform调用中的“fit”。在你的情况下
reference_front_norm = min_max_scaler.fit_transform(reference_front)
approximation_front_norm = min_max_scaler.transform(approximation_front)https://stackoverflow.com/questions/69751332
复制相似问题