Opened 6 years ago

Closed 3 years ago

#890 closed request (fixed)

normalize to unity

Reported by: Peter Owned by: Peter
Priority: minor Milestone: yat 0.18
Component: normalizer Version:
Keywords: Cc:

Description

A new normalizer class that multiplies all values in the range with a value such that the sum of values is 1.0 afterwards.

Change History (5)

comment:1 Changed 3 years ago by Peter

Milestone: yat 0.x+yat 0.18
Priority: majorminor
Status: newaccepted

comment:2 Changed 3 years ago by Peter

This is very similar to Centralizer, but instead of subtracting a value from each element, each element is divided by a value. A copy-n-paste with replacing std::Minus with std::Divide would do it, but would prefer avoiding the the duplicated code, if possible.

comment:3 Changed 3 years ago by Peter

In C++11 it's possible to have something like

template<typename T = statistics::Average>
using Centralizer = RangeNormalizer<std::minus<double>, T>;

In C++98 one seems to forced into inheritance

template<typename T = statistics::Average>
class Centralizer : public RangeNormalizer<std::minus<double>, T>
{};

and I'm hesitant whether that's a good idea.

comment:4 Changed 3 years ago by Peter

In 3953:

refs #890. Implement RangeNormalizer?, a generalization of Centralizer and implement Centralizer as an alias of a specialization.

comment:5 Changed 3 years ago by Peter

Resolution: fixed
Status: acceptedclosed

In 3957:

closes #890. Implement normalizer::UnityScaler?.

Note: See TracTickets for help on using tickets.