Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[COST] Normalize the return value of ClusterCost from HasClusterCost#of #1465

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

garyparrot
Copy link
Collaborator

確保 HasClusterCost#of 回傳的 Cost 值被依照權重標準化到 [0, 1] 的區間。

目前的 HasClusterCost#of 回傳的權重組合 cost function 是直接將數值乘上權重後相加,最後值會介於 [0, TotalWeight] 之間。這個數字在觀察上不太方便,如我們看到值是 3,我們可能因為不確定上限而無法直接聯想到這個值在整體的好壞狀況。這個 PR 多一個步驟把值壓在 [0, 1] 之間,這樣做的好處:

  1. 符合 Cost Function 的設計。
  2. HasClusterCost#of 可以串 HasClusterCost#of
  3. 我們知道上限是 1,如果看到 0.3 可以直接聯想到他在整個值域的位置。

@garyparrot garyparrot self-assigned this Jan 28, 2023
Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@garyparrot garyparrot merged commit 9faa0da into opensource4you:main Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants