Changeset 13085 for branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans
- Timestamp:
- 10/29/15 18:39:53 (9 years ago)
- Location:
- branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClustering.cs
r10556 r13085 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 36 36 /// </summary> 37 37 [Item("k-Means", "The k-Means clustering algorithm (wrapper for ALGLIB).")] 38 [Creatable( "Data Analysis")]38 [Creatable(CreatableAttribute.Categories.DataAnalysis, Priority = 10)] 39 39 [StorableClass] 40 40 public sealed class KMeansClustering : FixedDataAnalysisAlgorithm<IClusteringProblem> { … … 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/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringModel.cs
r10556 r13085 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 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/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringSolution.cs
r10556 r13085 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringUtil.cs
r10556 r13085 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 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.