Exemplo n.º 1
0
        public Result(
            T[] items,
            IDistance <T> distance,
            int k,
            int[] medoidIndices,
            int[] clusterNums)
        {
            _items         = items;
            _distance      = distance;
            _n             = _items.Length;
            _k             = k;
            _medoidIndices = medoidIndices;
            _clusterNums   = clusterNums;

            Records = EnumerateRecordResults().ToArray();

            Indicators = new Indicators(
                totalClusterDistance: Records.Sum(r => r.ClusterDistance),
                globalSilhuetteIndex: Records.Average(r => r.SilhouetteIndex));
        }