Changeset 17980 for branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisModel.cs
- Timestamp:
- 05/10/21 09:48:16 (3 years ago)
- Location:
- branches/2719_HeuristicLab.DatastreamAnalysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2719_HeuristicLab.DatastreamAnalysis
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis merged eligible /branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis merged eligible /trunk/HeuristicLab.Problems.DataAnalysis merged eligible /branches/3073_IA_constraint_splitting_reintegration/HeuristicLab.Problems.DataAnalysis 17885-17900 /branches/3105_PythonFormatter/HeuristicLab.Problems.DataAnalysis 17842-17921
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisModel.cs
r15866 r17980 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 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 HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;26 using HEAL.Attic; 26 27 27 28 namespace HeuristicLab.Problems.DataAnalysis { 28 [Storable Class]29 [StorableType("EF0EF64F-392A-448A-B30F-1AE113C6CC88")] 29 30 [Item("DataAnalysisModel", "Base class for data analysis models.")] 30 31 public abstract class DataAnalysisModel : NamedItem, IDataAnalysisModel { 31 32 [StorableConstructor] 32 protected DataAnalysisModel( bool deserializing) : base(deserializing) { }33 protected DataAnalysisModel(StorableConstructorFlag _) : base(_) { } 33 34 protected DataAnalysisModel(DataAnalysisModel original, Cloner cloner) 34 35 : base(original, cloner) { } … … 38 39 39 40 public abstract IEnumerable<string> VariablesUsedForPrediction { get; } 41 42 public virtual bool IsDatasetCompatible(IDataset dataset, out string errorMessage) { 43 if (dataset == null) throw new ArgumentNullException("dataset", "The provided dataset is null."); 44 return IsDatasetCompatible(this, dataset, out errorMessage); 45 } 46 47 public abstract bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage); 48 49 public static bool IsDatasetCompatible(IDataAnalysisModel model, IDataset dataset, out string errorMessage) { 50 if(model == null) throw new ArgumentNullException("model", "The provided model is null."); 51 if (dataset == null) throw new ArgumentNullException("dataset", "The provided dataset is null."); 52 errorMessage = string.Empty; 53 54 foreach (var variable in model.VariablesUsedForPrediction) { 55 if (!dataset.ContainsVariable(variable)) { 56 if (string.IsNullOrEmpty(errorMessage)) { 57 errorMessage = "The following variables must be present in the dataset for model evaluation:"; 58 } 59 errorMessage += System.Environment.NewLine + " " + variable; 60 } 61 } 62 63 return string.IsNullOrEmpty(errorMessage); 64 } 40 65 } 41 66 }
Note: See TracChangeset
for help on using the changeset viewer.