為了找到質量指標,如 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 之間。
uj5u.com熱心網友回復:
申請后fit_transform
,您可以簡單地使用transform
。這將使用fit_transform
呼叫中的“適合” 。在你的情況下
reference_front_norm = min_max_scaler.fit_transform(reference_front)
approximation_front_norm = min_max_scaler.transform(approximation_front)
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/340811.html
上一篇:PHP檔案處理讀寫