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

implicit normalization behavior in weightedSum #32

Open
dominikandreas opened this issue Oct 16, 2020 · 1 comment
Open

implicit normalization behavior in weightedSum #32

dominikandreas opened this issue Oct 16, 2020 · 1 comment

Comments

@dominikandreas
Copy link

dominikandreas commented Oct 16, 2020

I would like to have a weighted sum without any normalization, but that doesn't seem to be possible.

As can be seen here, normalization is still applied to the weighted sum range at the end:

// normalize all values against total weight and assign values
const extents = arr.extents(row_totals);
data.forEach((d, i) => {
config.data[i]['weighted sum'] = (
(d.score - extents[0]) /
(extents[1] - extents[0])
).toString();
});

Whereas the norm parameter only controls normalization of the input data normalization.

In my opinion the default behavior should be to normalize neither, because it isn't something that I as a user would expect when I call a "weightedSum" operation. At the very least there should be an option to disable both forms of normalization

Edit: Just noticed there's the additional "score" property that isn't normalized. I guess that does what I want, but still think this behavior is strange

@joshhjacobson
Copy link
Member

Thanks for your request! It's been awhile since I've worked on this project and I don't have much time to maintain it at this point. However, if you'd like to submit a quick pull request, I'd be happy to review it and get something merged.

Hopefully the "score" property has been working for you in the meantime!

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

2 participants