Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/08/12 16:46:53 (12 years ago)
Author:
abeham
Message:

#1913:

  • Improved speed of NCA
  • Reorganized things
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NCA/HeuristicLab.Algorithms.NCA/3.3/NCAModel.cs

    r8420 r8437  
    129129      return CreateClassificationSolution(problemData);
    130130    }
     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    }
    131147  }
    132148}
Note: See TracChangeset for help on using the changeset viewer.