Changeset 13794 for branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/Recommenders/KNearestNeighborModel.cs
- Timestamp:
- 04/26/16 00:02:05 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/Recommenders/KNearestNeighborModel.cs
r13791 r13794 22 22 using HeuristicLab.Collections; 23 23 using HeuristicLab.Optimization; 24 using System;25 24 using System.Collections.Generic; 26 25 using System.Linq; … … 46 45 } 47 46 48 public IEnumerable< Tuple<IAlgorithm, double>> GetRanking(IRun problemInstance) {47 public IEnumerable<KeyValuePair<IAlgorithm, double>> GetRanking(IRun problemInstance) { 49 48 var features = KnowledgeCenter.GetFeatures(performance.Keys.OrderBy(problemInstanceMap.GetBySecond).ToArray(), characteristics, medianValues); 50 49 var feature = KnowledgeCenter.GetFeatures(new [] { problemInstance }, characteristics, medianValues)[0]; … … 70 69 return performances.Select(x => new { Alg = x.Key, Perf = x.Value.Average() }) 71 70 .OrderBy(x => x.Perf) 72 .Select(x => Tuple.Create(x.Alg, x.Perf));71 .Select(x => new KeyValuePair<IAlgorithm, double>(x.Alg, x.Perf)); 73 72 } 74 73 }
Note: See TracChangeset
for help on using the changeset viewer.