Changeset 16723 for branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans
- Timestamp:
- 03/28/19 16:54:20 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClustering.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 29 29 using HeuristicLab.Optimization; 30 30 using HeuristicLab.Parameters; 31 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;31 using HEAL.Attic; 32 32 using HeuristicLab.Problems.DataAnalysis; 33 33 … … 38 38 [Item("k-Means", "The k-Means clustering algorithm (wrapper for ALGLIB).")] 39 39 [Creatable(CreatableAttribute.Categories.DataAnalysis, Priority = 10)] 40 [Storable Class]40 [StorableType("84FAF4ED-0679-40BA-B3DD-83809095F8CF")] 41 41 public sealed class KMeansClustering : FixedDataAnalysisAlgorithm<IClusteringProblem> { 42 42 private const string KParameterName = "k"; … … 60 60 #endregion 61 61 [StorableConstructor] 62 private KMeansClustering( bool deserializing) : base(deserializing) { }62 private KMeansClustering(StorableConstructorFlag _) : base(_) { } 63 63 private KMeansClustering(KMeansClustering original, Cloner cloner) 64 64 : base(original, cloner) { … … 91 91 int[] xyc; 92 92 double[,] inputMatrix = dataset.ToArray(allowedInputVariables, rows); 93 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))93 if (inputMatrix.ContainsNanOrInfinity()) 94 94 throw new NotSupportedException("k-Means clustering does not support NaN or infinity values in the input dataset."); 95 95 -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringModel.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Drawing; … … 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;28 using HEAL.Attic; 28 29 using HeuristicLab.Problems.DataAnalysis; 29 30 … … 32 33 /// Represents a k-Means clustering model. 33 34 /// </summary> 34 [Storable Class]35 [StorableType("61D987AC-A142-433B-901C-B124E12A1C55")] 35 36 [Item("KMeansClusteringModel", "Represents a k-Means clustering model.")] 36 public sealed class KMeansClusteringModel : NamedItem, IClusteringModel {37 public sealed class KMeansClusteringModel : DataAnalysisModel, IClusteringModel { 37 38 public static new Image StaticItemImage { 38 39 get { return HeuristicLab.Common.Resources.VSImageLibrary.Function; } 39 40 } 40 41 41 public IEnumerable<string> VariablesUsedForPrediction {42 public override IEnumerable<string> VariablesUsedForPrediction { 42 43 get { return allowedInputVariables; } 43 44 } … … 56 57 } 57 58 [StorableConstructor] 58 private KMeansClusteringModel( bool deserializing) : base(deserializing) { }59 private KMeansClusteringModel(StorableConstructorFlag _) : base(_) { } 59 60 private KMeansClusteringModel(KMeansClusteringModel original, Cloner cloner) 60 61 : base(original, cloner) { … … 84 85 } 85 86 87 public override bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) { 88 if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null."); 89 return IsDatasetCompatible(problemData.Dataset, out errorMessage); 90 } 91 86 92 87 93 public IEnumerable<int> GetClusterValues(IDataset dataset, IEnumerable<int> rows) { -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringSolution.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Drawing;25 using System.Linq;26 22 using HeuristicLab.Common; 27 23 using HeuristicLab.Core; 28 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;24 using HEAL.Attic; 29 25 using HeuristicLab.Problems.DataAnalysis; 30 26 using HeuristicLab.Optimization; … … 36 32 /// </summary> 37 33 [Item("k-Means clustering solution", "Represents a k-Means solution for a clustering problem which can be visualized in the GUI.")] 38 [Storable Class]34 [StorableType("E46AD906-04C4-4BEB-977D-BBC80E97C874")] 39 35 public sealed class KMeansClusteringSolution : ClusteringSolution { 40 36 private const string TrainingIntraClusterSumOfSquaresResultName = "Intra-cluster sum of squares (training)"; … … 46 42 47 43 [StorableConstructor] 48 private KMeansClusteringSolution( bool deserializing) : base(deserializing) { }44 private KMeansClusteringSolution(StorableConstructorFlag _) : base(_) { } 49 45 private KMeansClusteringSolution(KMeansClusteringSolution original, Cloner cloner) 50 46 : base(original, cloner) { -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringUtil.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.