Changeset 11571 for branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans
- Timestamp:
- 11/24/14 15:16:59 (10 years ago)
- 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 83 83 84 84 public static KMeansClusteringSolution CreateKMeansSolution(IClusteringProblemData problemData, int k, int restarts) { 85 Datasetdataset = problemData.Dataset;85 var dataset = problemData.Dataset; 86 86 IEnumerable<string> allowedInputVariables = problemData.AllowedInputVariables; 87 87 IEnumerable<int> rows = problemData.TrainingIndices; -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringModel.cs
r11171 r11571 81 81 82 82 83 public IEnumerable<int> GetClusterValues( Dataset dataset, IEnumerable<int> rows) {83 public IEnumerable<int> GetClusterValues(IDataset dataset, IEnumerable<int> rows) { 84 84 return KMeansClusteringUtil.FindClosestCenters(centers, dataset, allowedInputVariables, rows); 85 85 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringUtil.cs
r11171 r11571 27 27 namespace HeuristicLab.Algorithms.DataAnalysis { 28 28 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) { 30 30 int nRows = rows.Count(); 31 31 int nCols = allowedInputVariables.Count(); … … 58 58 } 59 59 60 public static double CalculateIntraClusterSumOfSquares(KMeansClusteringModel model, Dataset dataset, IEnumerable<int> rows) {60 public static double CalculateIntraClusterSumOfSquares(KMeansClusteringModel model, IDataset dataset, IEnumerable<int> rows) { 61 61 List<int> clusterValues = model.GetClusterValues(dataset, rows).ToList(); 62 62 List<string> allowedInputVariables = model.AllowedInputVariables.ToList();
Note: See TracChangeset
for help on using the changeset viewer.