Changeset 8437 for branches/NCA/HeuristicLab.Algorithms.NCA/3.3/NCAModel.cs
- Timestamp:
- 08/08/12 16:46:53 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/NCA/HeuristicLab.Algorithms.NCA/3.3/NCAModel.cs
r8420 r8437 129 129 return CreateClassificationSolution(problemData); 130 130 } 131 132 public double[,] Reduce(Dataset dataset, IEnumerable<int> rows) { 133 var result = new double[rows.Count(), transformationMatrix.GetLength(1)]; 134 int v = 0; 135 foreach (var r in rows) { 136 int i = 0; 137 foreach (var variable in allowedInputVariables) { 138 double val = dataset.GetDoubleValue(variable, r); 139 for (int j = 0; j < result.GetLength(1); j++) 140 result[v, j] += val * transformationMatrix[i, j]; 141 i++; 142 } 143 v++; 144 } 145 return result; 146 } 131 147 } 132 148 }
Note: See TracChangeset
for help on using the changeset viewer.