Skip to content

implicit normalization behavior in weightedSum #32

@dominikandreas

Description

@dominikandreas

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions