当前位置: 首页>>代码示例>>C#>>正文


C# Chain.CongenericChain方法代码示例

本文整理汇总了C#中Chain.CongenericChain方法的典型用法代码示例。如果您正苦于以下问题:C# Chain.CongenericChain方法的具体用法?C# Chain.CongenericChain怎么用?C# Chain.CongenericChain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Chain的用法示例。


在下文中一共展示了Chain.CongenericChain方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Calculate

        /// <summary>
        /// Calculation method.
        /// </summary>
        /// <param name="chain">
        /// Source sequence.
        /// </param>
        /// <param name="link">
        /// Link of intervals in chain.
        /// </param>
        /// <returns>
        /// Average remoteness dispersion <see cref="double"/> value.
        /// </returns>
        public double Calculate(Chain chain, Link link)
        {
            List<int> intervals = new List<int>();
            for (int i = 0; i < chain.Alphabet.Cardinality; i++)
            {
                intervals.AddRange(chain.CongenericChain(i).GetIntervals(link).ToList());
            }

            List<int> uniqueIntervals = intervals.Distinct().ToList();

            List<int> intervalsCounts = new List<int>();

            for (int i = 0; i < uniqueIntervals.Count; i++)
            {
                var currentInterval = uniqueIntervals[i];
                intervalsCounts.Add(intervals.Count(interval => interval == currentInterval));
            }

            double result = 0;
            double gDelta = geometricMean.Calculate(chain, link);
            int n = (int)intervalsCount.Calculate(chain, link);

            for (int i = 0; i < uniqueIntervals.Count; i++)
            {
                int nk = intervalsCounts[i];
                double kDelta = uniqueIntervals[i];
                double centeredRemoteness = Math.Log(kDelta, 2) - Math.Log(gDelta, 2);
                result += nk == 0 ? 0 : centeredRemoteness * centeredRemoteness * nk / n;
            }

            return result;
        }
开发者ID:intervals-mining-lab,项目名称:libiada-core,代码行数:44,代码来源:RemotenessDispersion.cs

示例2: Calculate

        /// <summary>
        /// Calculation method.
        /// </summary>
        /// <param name="chain">
        /// Source sequence.
        /// </param>
        /// <param name="link">
        /// Link of intervals in chain.
        /// </param>
        /// <returns>
        /// Average remoteness dispersion <see cref="double"/> value.
        /// </returns>
        public double Calculate(Chain chain, Link link)
        {
            double result = 0;
            double g = averageRemoteness.Calculate(chain, link);
            int n = (int)intervalsCount.Calculate(chain, link);

            for (int i = 0; i < chain.Alphabet.Cardinality; i++)
            {
                double nj = intervalsCount.Calculate(chain.CongenericChain(chain.Alphabet[i]), link);
                double gj = averageRemoteness.Calculate(chain.CongenericChain(chain.Alphabet[i]), link);
                double gDelta = gj - g;
                result += n == 0 ? 0 : gDelta * gDelta * nj / n;
            }

            return result;
        }
开发者ID:intervals-mining-lab,项目名称:libiada-core,代码行数:28,代码来源:AverageRemotenessDispersion.cs

示例3: Calculate

        /// <summary>
        /// Calculation method.
        /// </summary>
        /// <param name="chain">
        /// Source sequence.
        /// </param>
        /// <param name="link">
        /// Link of intervals in chain.
        /// </param>
        /// <returns>
        /// Entropy Kurtosis <see cref="double"/> value.
        /// </returns>
        public double Calculate(Chain chain, Link link)
        {
            double result = 0;
            double h = identificationInformation.Calculate(chain, link);
            int n = (int)intervalsCount.Calculate(chain, link);

            for (int i = 0; i < chain.Alphabet.Cardinality; i++)
            {
                double nj = intervalsCount.Calculate(chain.CongenericChain(chain.Alphabet[i]), link);
                double hj = identificationInformation.Calculate(chain.CongenericChain(chain.Alphabet[i]), link);
                double deltaH = hj - h;
                result += n == 0 ? 0 : deltaH * deltaH * deltaH * deltaH * nj / n;
            }

            return result;
        }
开发者ID:intervals-mining-lab,项目名称:libiada-core,代码行数:28,代码来源:EntropyKurtosis.cs

示例4: Calculate

        /// <summary>
        /// Calculated as base 2 logarithm of multiplication 
        /// of intervals between nearest elements 
        /// in congeneric sequence.
        /// </summary>
        /// <param name="chain">
        /// Source sequence.
        /// </param>
        /// <param name="link">
        /// Link of intervals in chain.
        /// </param>
        /// <returns>
        /// Average remoteness <see cref="double"/> value.
        /// </returns>
        public double Calculate(Chain chain, Link link)
        {
            double result = 0;
            for (int i = 0; i < chain.Alphabet.Cardinality; i++)
            {
                result += Calculate(chain.CongenericChain(i), link);
            }

            return result;
        }
开发者ID:intervals-mining-lab,项目名称:libiada-core,代码行数:24,代码来源:Depth.cs

示例5: Calculate

        /// <summary>
        /// Calculation method.
        /// </summary>
        /// <param name="chain">
        /// Source sequence.
        /// </param>
        /// <param name="link">
        /// Link of intervals in chain.
        /// </param>
        /// <returns>
        /// Intervals count in chain as <see cref="double"/>.
        /// </returns>
        public double Calculate(Chain chain, Link link)
        {
            double sum = 0;

            for (int i = 0; i < chain.Alphabet.Cardinality; i++)
            {
                sum += Calculate(chain.CongenericChain(i), link);
            }

            return (int)sum;
        }
开发者ID:intervals-mining-lab,项目名称:libiada-core,代码行数:23,代码来源:IntervalsCount.cs


注:本文中的Chain.CongenericChain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。