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

cyberPercent generally should not be more than 100 or less than zero #1

Open
Amirali-Amirifar opened this issue Nov 4, 2022 · 0 comments

Comments

@Amirali-Amirifar
Copy link

Amirali-Amirifar commented Nov 4, 2022

cyberPercent < 0 ? 0 : cyberPercent > 100 ? 100 : cyberPercent

a solution to this problem could be this:
lets rename cyberPercent to cyberScore, calculate maximum possible cyberScore and call it const maxScore, do it for minimum possible and call it const minScore.
now you can find a percentage using following formula:

const cyberPercent = (cyberScore - minScore) / (maxScore - minScore) * 100

For further reading check out https://en.wikipedia.org/wiki/Feature_scaling#Rescaling_(min-max_normalization)

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

No branches or pull requests

1 participant