- Timestamp:
- 04/08/16 14:24:51 (9 years ago)
- Location:
- branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/HeuristicLab.OptimizationExpertSystem.Common-3.3.csproj
r13722 r13750 132 132 <Private>False</Private> 133 133 </Reference> 134 <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 135 <SpecificVersion>False</SpecificVersion> 136 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath> 137 <Private>False</Private> 138 </Reference> 134 139 <Reference Include="System" /> 135 140 <Reference Include="System.Core" /> -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/KnowledgeCenter.cs
r13748 r13750 21 21 22 22 using HeuristicLab.Analysis; 23 using HeuristicLab.Analysis.SelfOrganizingMaps; 23 24 using HeuristicLab.Collections; 24 25 using HeuristicLab.Common; … … 29 30 using HeuristicLab.Optimization; 30 31 using HeuristicLab.Persistence.Default.Xml; 32 using HeuristicLab.Random; 31 33 using System; 32 34 using System.Collections.Generic; … … 232 234 alglib.pcabuildbasis(ds, ds.GetLength(0), ds.GetLength(1), out info, out s2, out v); 233 235 #endregion 236 #region SOM 237 var features = new DoubleMatrix(commonCharacteristics.Count, instances.Count); 238 foreach (var instance in instances) { 239 var arr = instance.Value; 240 for (var feature = 0; feature < arr.Length; feature++) 241 features[feature, key2Idx.GetByFirst(instance.Key)] = arr[feature]; 242 } 243 var somCoords = SOM.Map(features, new MersenneTwister(42), somSize: 20, learningRadius: 20, jittering: true); 244 #endregion 234 245 235 246 ProblemInstances.UpdateOfRunsInProgress = true; … … 256 267 ((DoubleValue)item).Value = coords[key2Idx.GetByFirst(instance.Name), 1]; 257 268 } else instance.Results.Add("Projection.MDS.Y", new DoubleValue(coords[key2Idx.GetByFirst(instance.Name), 1])); 269 270 if (instance.Results.TryGetValue("Projection.SOM.X", out item)) { 271 ((DoubleValue)item).Value = somCoords[key2Idx.GetByFirst(instance.Name), 0]; 272 } else instance.Results.Add("Projection.SOM.X", new DoubleValue(somCoords[key2Idx.GetByFirst(instance.Name), 0])); 273 if (instance.Results.TryGetValue("Projection.SOM.Y", out item)) { 274 ((DoubleValue)item).Value = somCoords[key2Idx.GetByFirst(instance.Name), 1]; 275 } else instance.Results.Add("Projection.SOM.Y", new DoubleValue(somCoords[key2Idx.GetByFirst(instance.Name), 1])); 258 276 } 259 277 } finally { ProblemInstances.UpdateOfRunsInProgress = false; }
Note: See TracChangeset
for help on using the changeset viewer.