Пример #1
0
        /// <summary>
        /// Same as max_min_norm, but it performs the operation inplace, without allocating further memory.
        /// </summary>
        /// <param name="tss">Expects an input array whose dimension zero is the length of the time series (all the same) and dimension
        /// one indicates the number of time series.</param>
        /// <param name="high">Maximum final value (Defaults to 1.0).</param>
        /// <param name="low">Minimum final value (Defaults to 0.0).</param>
        /// <param name="epsilon">Safeguard for constant (or near constant) time series as the operation implies a unit scale operation
        /// between min and max values in the tss.</param>
        public static void MaxMinNorm(ref KhivaArray tss, double high, double low, double epsilon = 0.00000001)
        {
            var reference = tss.Reference;

            DLLNormalization.max_min_norm_in_place(ref reference, ref high, ref low, ref epsilon);
            tss.Reference = reference;
        }
Пример #2
0
        /// <summary>
        /// Adjusts the time series in the given input and performs z-norm inplace(without allocating further memory).
        /// </summary>
        /// <param name="tss"> Expects an input array whose dimension zero is the length of the time
        /// series(all the same) and dimension one indicates the number of time series.</param>
        /// <param name="epsilon">Minimum standard deviation to consider. It acts as a gatekeeper for
        /// those time series that may be constant or near constant.</param>
        public static void ZNorm(ref KhivaArray tss, double epsilon)
        {
            var reference = tss.Reference;

            DLLNormalization.znorm_in_place(ref reference, ref epsilon);
            tss.Reference = reference;
        }
Пример #3
0
        /// <summary>
        /// Same as decimal_scaling_norm, but it performs the operation inplace, without allocating further memory.
        /// </summary>
        /// <param name="tss">Expects an input array whose dimension zero is the length of the time series (all the same) and dimension
        /// one indicates the number of time series.</param>
        public static void DecimalScalingNorm(ref KhivaArray tss)
        {
            var reference = tss.Reference;

            DLLNormalization.decimal_scaling_norm_in_place(ref reference);
            tss.Reference = reference;
        }
Пример #4
0
        /// <summary>
        /// Normalizes the given time series according to its maximum-minimum value and its mean. It follows the following
        /// formulae:
        /// \f[
        /// \acute{x} = \frac{x - mean(x)}{max(x) - min(x)}.
        /// \f]
        /// </summary>
        /// <param name="tss">Expects an input array whose dimension zero is the length of the time series (all the same) and dimension
        /// one indicates the number of time series.</param>
        public static void MeanNorm(ref KhivaArray tss)
        {
            var reference = tss.Reference;

            DLLNormalization.mean_norm_in_place(ref reference);
            tss.Reference = reference;
        }