Changeset 9539 for branches/HivePerformance/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/LdaInitializer.cs
- Timestamp:
- 05/27/13 12:44:27 (12 years ago)
- Location:
- branches/HivePerformance/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HivePerformance/sources
- Property svn:mergeinfo changed
/trunk/sources merged: 9445,9447-9459,9462-9466,9471-9472,9474,9476-9479,9493,9496,9498,9504-9506,9515-9517,9520-9521,9523,9530-9531,9534-9537
- Property svn:mergeinfo changed
-
branches/HivePerformance/sources/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Algorithms.DataAnalysis (added) merged: 9451,9456,9462,9493,9504,9515-9517,9534-9537
- Property svn:mergeinfo changed
-
branches/HivePerformance/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/LdaInitializer.cs
r9272 r9539 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 48 48 data.TrainingIndices); 49 49 50 var uniqueClasses = data.Dataset.GetDoubleValues(data.TargetVariable, data.TrainingIndices).Distinct().Count(); 50 // map class values to sequential natural numbers (required by alglib) 51 var uniqueClasses = data.Dataset.GetDoubleValues(data.TargetVariable, data.TrainingIndices) 52 .Distinct() 53 .Select((v, i) => new { v, i }) 54 .ToDictionary(x => x.v, x => x.i); 55 56 for (int row = 0; row < instances; row++) 57 ldaDs[row, attributes] = uniqueClasses[ldaDs[row, attributes]]; 51 58 52 59 int info; 53 60 double[,] matrix; 54 alglib.fisherldan(ldaDs, instances, attributes, uniqueClasses , out info, out matrix);61 alglib.fisherldan(ldaDs, instances, attributes, uniqueClasses.Count, out info, out matrix); 55 62 56 63 return matrix;
Note: See TracChangeset
for help on using the changeset viewer.