Changeset 15551
- Timestamp:
- 12/20/17 10:06:25 (7 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/WeightedEuclideanDistance.cs
r15532 r15551 50 50 [StorableConstructor] 51 51 protected WeightedEuclideanDistance(bool deserializing) : base(deserializing) { } 52 [StorableHook(HookType.AfterDeserialization)] 52 53 private void AfterDeserialization() { 53 54 RegisterParameterEvents(); -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAlgorithm.cs
r15548 r15551 230 230 state = cloner.Clone(original.state); 231 231 iter = original.iter; 232 RegisterParameterEvents(); 232 233 } 233 234 public override IDeepCloneable Clone(Cloner cloner) { … … 322 323 protected override void RegisterProblemEvents() { 323 324 base.RegisterProblemEvents(); 325 if (Problem == null) return; 326 Problem.ProblemDataChanged -= OnProblemDataChanged; 324 327 Problem.ProblemDataChanged += OnProblemDataChanged; 328 if (Problem.ProblemData == null) return; 329 Problem.ProblemData.Changed -= OnPerplexityChanged; 330 Problem.ProblemData.Changed -= OnColumnsChanged; 331 Problem.ProblemData.Changed += OnPerplexityChanged; 332 Problem.ProblemData.Changed += OnColumnsChanged; 333 if (Problem.ProblemData.Dataset == null) return; 334 Problem.ProblemData.Dataset.RowsChanged -= OnPerplexityChanged; 335 Problem.ProblemData.Dataset.ColumnsChanged -= OnColumnsChanged; 336 Problem.ProblemData.Dataset.RowsChanged += OnPerplexityChanged; 337 Problem.ProblemData.Dataset.ColumnsChanged += OnColumnsChanged; 325 338 } 326 339 … … 341 354 OnPerplexityChanged(this, null); 342 355 OnColumnsChanged(this, null); 356 Problem.ProblemData.Changed -= OnPerplexityChanged; 343 357 Problem.ProblemData.Changed += OnPerplexityChanged; 358 Problem.ProblemData.Changed -= OnColumnsChanged; 344 359 Problem.ProblemData.Changed += OnColumnsChanged; 360 if (Problem.ProblemData.Dataset == null) return; 361 Problem.ProblemData.Dataset.RowsChanged -= OnPerplexityChanged; 362 Problem.ProblemData.Dataset.ColumnsChanged -= OnColumnsChanged; 345 363 Problem.ProblemData.Dataset.RowsChanged += OnPerplexityChanged; 346 364 Problem.ProblemData.Dataset.ColumnsChanged += OnColumnsChanged; … … 401 419 var classificationData = problemData as ClassificationProblemData; 402 420 if (classificationData != null && classificationData.TargetVariable.Equals(ClassesName)) { 403 var classNames = classificationData.ClassValues.Zip(classificationData.ClassNames, (v, n) => new { v, n}).ToDictionary(x => x.v, x => x.n);421 var classNames = classificationData.ClassValues.Zip(classificationData.ClassNames, (v, n) => new {v, n}).ToDictionary(x => x.v, x => x.n); 404 422 var classes = classificationData.Dataset.GetDoubleValues(classificationData.TargetVariable, allIndices).Select(v => classNames[v]).ToArray(); 405 423 for (var i = 0; i < classes.Length; i++) { … … 420 438 double[][] borders; 421 439 CreateClusters(clusterdata, ClassesName, contours, out clusterModel, out contourMap, out borders); 422 var contourorder = borders.Select((x, i) => new { x, i}).OrderBy(x => x.x[0]).Select(x => x.i).ToArray();440 var contourorder = borders.Select((x, i) => new {x, i}).OrderBy(x => x.x[0]).Select(x => x.i).ToArray(); 423 441 for (var i = 0; i < contours; i++) { 424 442 var c = contourorder[i]; … … 437 455 double[][] borders; 438 456 CreateClusters(clusterdata, ClassesName, contours, out clusterModel, out contourMap, out borders); 439 var contourorder = borders.Select((x, i) => new { x, i}).OrderBy(x => x.x[0]).Select(x => x.i).ToArray();457 var contourorder = borders.Select((x, i) => new {x, i}).OrderBy(x => x.x[0]).Select(x => x.i).ToArray(); 440 458 for (var i = 0; i < contours; i++) { 441 459 var c = contourorder[i];
Note: See TracChangeset
for help on using the changeset viewer.