示例#1
0
        private RecoResult combineResults(List <SymbolRank> topPolar, RecoResult screenResults, int numToReturn)
        {
            List <SymbolRank> fusionResults = new List <SymbolRank>();

            foreach (SymbolRank sr in topPolar)
            {
                SymbolRank part_haus          = screenResults.getSR(ResultType.PARTIAL_HAUSDORFF, sr.Symbol);
                double     part_haus_distance = screenResults.Normalize(ResultType.PARTIAL_HAUSDORFF, part_haus);

                SymbolRank mod_haus          = screenResults.getSR(ResultType.MOD_HAUSDORFF, sr.Symbol);
                double     mod_haus_distance = screenResults.Normalize(ResultType.MOD_HAUSDORFF, mod_haus);

                SymbolRank tanim          = screenResults.getSR(ResultType.TANIMOTO, sr.Symbol);
                double     tanim_distance = screenResults.Normalize(ResultType.TANIMOTO, tanim);

                SymbolRank yule          = screenResults.getSR(ResultType.YULE, sr.Symbol);
                double     yule_distance = 1 - screenResults.Normalize(ResultType.YULE, yule);

                double distance = part_haus_distance + mod_haus_distance + tanim_distance + yule_distance;

                fusionResults.Add(new SymbolRank(distance, sr.Symbol, sr.BestOrientation));
            }

            // sort
            var sortedResults = from result in fusionResults
                                orderby result.Distance ascending
                                select result;

            RecoResult combinedResults = new RecoResult();

            combinedResults.AddRange(ResultType.FUSION, sortedResults.Take(numToReturn));
            return(combinedResults);
        }
示例#2
0
        private void combineResults()
        {
            List <SymbolRank> topPolar = _results.BestN(ResultType.POLAR, NUM_TOP_POLAR_TO_KEEP);

            foreach (SymbolRank sr in topPolar)
            {
                double     distance  = 0.0;
                SymbolRank part_haus = _results.getSR(ResultType.PARTIAL_HAUSDORFF, sr.Symbol);
                distance += _results.Normalize(ResultType.PARTIAL_HAUSDORFF, part_haus);

                SymbolRank mod_haus = _results.getSR(ResultType.MOD_HAUSDORFF, sr.Symbol);
                distance += _results.Normalize(ResultType.MOD_HAUSDORFF, mod_haus);

                SymbolRank tanim = _results.getSR(ResultType.TANIMOTO, sr.Symbol);
                distance += 1 - _results.Normalize(ResultType.TANIMOTO, tanim);

                SymbolRank yule = _results.getSR(ResultType.YULE, sr.Symbol);
                distance += 1 - _results.Normalize(ResultType.YULE, yule);

                _results.Add(ResultType.FUSION, new SymbolRank(distance, sr.Symbol, sr.BestOrientation));
            }
        }