featuremapper/distribution.py
def vector_sum(self):
        """
        Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).

        Each feature_bin contributes a vector of length equal to its value, at
        a direction corresponding to the feature_bin number.  Specifically,
        the total feature_bin number range is mapped into a direction range
        [0,2pi].

        For a cyclic distribution, the avgbinnum will be a continuous
        measure analogous to the max_value_bin() of the distribution.
        But this quantity has more precision than max_value_bin()
        because it is computed from the entire distribution instead of
        just the peak feature_bin.  However, it is likely to be useful only
        for uniform or very dense sampling; with sparse, non-uniform
        sampling the estimates will be biased significantly by the
        particular samples chosen.

        The avgbinnum is not meaningful when the magnitude is 0,
        because a zero-length vector has no direction.  To find out
        whether such cases occurred, you can compare the value of
        undefined_vals before and after a series of calls to this
        function.
        
        This tries to use cached values of this.

        """
        if self._vector_sum is None:
            # There is a non cyclic distribution that is using this.
            # Calculate and then cache it
            
            # First check if there is a cached theta. If not derive it.
            if self._theta is None:          
                self._theta =  calc_theta(np.array(self._keys), self.axis_range)

            self._vector_sum = self._fast_vector_sum(self._values, self._theta)
            
        return self._vector_sum

        Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).

        Each feature_bin contributes a vector of length equal to its value, at
        a direction corresponding to the feature_bin number.  Specifically,
        the total feature_bin number range is mapped into a direction range
        [0,2pi].

        For a cyclic distribution, the avgbinnum will be a continuous
        measure analogous to the max_value_bin() of the distribution.
        But this quantity has more precision than max_value_bin()
        because it is computed from the entire distribution instead of
        just the peak feature_bin.  However, it is likely to be useful only
        for uniform or very dense sampling; with sparse, non-uniform
        sampling the estimates will be biased significantly by the
        particular samples chosen.

        The avgbinnum is not meaningful when the magnitude is 0,
        because a zero-length vector has no direction.  To find out
        whether such cases occurred, you can compare the value of
        undefined_vals before and after a series of calls to this
        function.
        
        This tries to use cached values of this.

        
Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).
Each feature_bin contributes a vector of length equal to its value, at
a direction corresponding to the feature_bin number.  Specifically,
the total feature_bin number range is mapped into a direction range
[0,2pi].

For a cyclic distribution, the avgbinnum will be a continuous
measure analogous to the max_value_bin() of the distribution.
But this quantity has more precision than max_value_bin()
because it is computed from the entire distribution instead of
just the peak feature_bin.  However, it is likely to be useful only
for uniform or very dense sampling; with sparse, non-uniform
sampling the estimates will be biased significantly by the
particular samples chosen.

The avgbinnum is not meaningful when the magnitude is 0,
because a zero-length vector has no direction.  To find out
whether such cases occurred, you can compare the value of
undefined_vals before and after a series of calls to this
function.

This tries to use cached values of this.
Return the vector sum of the distribution as a tuple ( magnitude avgbinnum ) . Each feature_bin contributes a vector of length equal to its value at a direction corresponding to the feature_bin number . Specifically the total feature_bin number range is mapped into a direction range [ 0 2pi ] . For a cyclic distribution the avgbinnum will be a continuous measure analogous to the max_value_bin () of the distribution . But this quantity has more precision than max_value_bin () because it is computed from the entire distribution instead of just the peak feature_bin . However it is likely to be useful only for uniform or very dense sampling ; with sparse non - uniform sampling the estimates will be biased significantly by the particular samples chosen . The avgbinnum is not meaningful when the magnitude is 0 because a zero - length vector has no direction . To find out whether such cases occurred you can compare the value of undefined_vals before and after a series of calls to this function . This tries to use cached values of this .
def vector_sum(self):
        if self._vector_sum is None:
            if self._theta is None:          
                self._theta =  calc_theta(np.array(self._keys), self.axis_range)
            self._vector_sum = self._fast_vector_sum(self._values, self._theta)
        return self._vector_sum
def vector_sum ( self ) : if self . _vector_sum is None : if self . _theta is None : self . _theta = calc_theta ( np . array ( self . _keys ) , self . axis_range ) self . _vector_sum = self . _fast_vector_sum ( self . _values , self . _theta ) return self . _vector_sum
Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).
Return the vector sum of the distribution as a tuple ( magnitude avgbinnum ) .
"""
        Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).

        Each feature_bin contributes a vector of length equal to its value, at
        a direction corresponding to the feature_bin number.  Specifically,
        the total feature_bin number range is mapped into a direction range
        [0,2pi].

        For a cyclic distribution, the avgbinnum will be a continuous
        measure analogous to the max_value_bin() of the distribution.
        But this quantity has more precision than max_value_bin()
        because it is computed from the entire distribution instead of
        just the peak feature_bin.  However, it is likely to be useful only
        for uniform or very dense sampling; with sparse, non-uniform
        sampling the estimates will be biased significantly by the
        particular samples chosen.

        The avgbinnum is not meaningful when the magnitude is 0,
        because a zero-length vector has no direction.  To find out
        whether such cases occurred, you can compare the value of
        undefined_vals before and after a series of calls to this
        function.
        
        This tries to use cached values of this.

        """ # There is a non cyclic distribution that is using this. # Calculate and then cache it # First check if there is a cached theta. If not derive it.
self