Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/14 15:16:59 (10 years ago)
Author:
bburlacu
Message:

#2276: Commit initial version of IDataset interface and code refactoring.

Location:
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClustering.cs

    r11171 r11571  
    8383
    8484    public static KMeansClusteringSolution CreateKMeansSolution(IClusteringProblemData problemData, int k, int restarts) {
    85       Dataset dataset = problemData.Dataset;
     85      var dataset = problemData.Dataset;
    8686      IEnumerable<string> allowedInputVariables = problemData.AllowedInputVariables;
    8787      IEnumerable<int> rows = problemData.TrainingIndices;
  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringModel.cs

    r11171 r11571  
    8181
    8282
    83     public IEnumerable<int> GetClusterValues(Dataset dataset, IEnumerable<int> rows) {
     83    public IEnumerable<int> GetClusterValues(IDataset dataset, IEnumerable<int> rows) {
    8484      return KMeansClusteringUtil.FindClosestCenters(centers, dataset, allowedInputVariables, rows);
    8585    }
  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringUtil.cs

    r11171 r11571  
    2727namespace HeuristicLab.Algorithms.DataAnalysis {
    2828  public static class KMeansClusteringUtil {
    29     public static IEnumerable<int> FindClosestCenters(IEnumerable<double[]> centers, Dataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<int> rows) {
     29    public static IEnumerable<int> FindClosestCenters(IEnumerable<double[]> centers, IDataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<int> rows) {
    3030      int nRows = rows.Count();
    3131      int nCols = allowedInputVariables.Count();
     
    5858    }
    5959
    60     public static double CalculateIntraClusterSumOfSquares(KMeansClusteringModel model, Dataset dataset, IEnumerable<int> rows) {
     60    public static double CalculateIntraClusterSumOfSquares(KMeansClusteringModel model, IDataset dataset, IEnumerable<int> rows) {
    6161      List<int> clusterValues = model.GetClusterValues(dataset, rows).ToList();
    6262      List<string> allowedInputVariables = model.AllowedInputVariables.ToList();
Note: See TracChangeset for help on using the changeset viewer.