- Timestamp:
- 05/07/19 12:09:34 (6 years ago)
- Location:
- branches/2971_named_intervals
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs
r16851 r16904 98 98 } 99 99 100 public NamedIntervalsIntervalEvaluationCollection {101 get { return ( NamedIntervals)this[IntervalEvaluationResultName].Value; }100 public IntervalCollection IntervalEvaluationCollection { 101 get { return (IntervalCollection)this[IntervalEvaluationResultName].Value; } 102 102 private set { this[IntervalEvaluationResultName].Value = value; } 103 103 } … … 127 127 estimationLimitResults.Add(new Result(TestNaNEvaluationsResultName, "", new IntValue())); 128 128 Add(new Result(EstimationLimitsResultsResultName, "Results concerning the estimation limits of symbolic regression solution", estimationLimitResults)); 129 Add(new Result(IntervalEvaluationResultName, "Results concerning the derivation of symbolic regression solution", new NamedIntervals()));129 Add(new Result(IntervalEvaluationResultName, "Results concerning the derivation of symbolic regression solution", new IntervalCollection())); 130 130 RecalculateResults(); 131 131 } … … 147 147 estimationLimitResults.Add(new Result(TestNaNEvaluationsResultName, "", new IntValue())); 148 148 Add(new Result(EstimationLimitsResultsResultName, "Results concerning the estimation limits of symbolic regression solution", estimationLimitResults)); 149 Add(new Result(IntervalEvaluationResultName, "Results concerning the derivation of symbolic regression solution", new NamedIntervals()));149 Add(new Result(IntervalEvaluationResultName, "Results concerning the derivation of symbolic regression solution", new IntervalCollection())); 150 150 CalculateResults(); 151 151 } … … 174 174 } 175 175 176 private static NamedIntervalsCalculateModelIntervals(ISymbolicRegressionSolution solution) {177 var intervalEvaluation = new NamedIntervals();176 private static IntervalCollection CalculateModelIntervals(ISymbolicRegressionSolution solution) { 177 var intervalEvaluation = new IntervalCollection(); 178 178 var interpreter = new IntervalInterpreter(); 179 179 var problemData = solution.ProblemData; -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalCollectionView.Designer.cs
r16896 r16904 21 21 22 22 namespace HeuristicLab.Problems.DataAnalysis.Views { 23 partial class NamedIntervalsView {23 partial class IntervalCollectionView { 24 24 /// <summary> 25 25 /// Required designer variable. -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalCollectionView.cs
r16896 r16904 29 29 30 30 [View("NamedIntervals View")] 31 [Content(typeof( NamedIntervals), true)]32 public sealed partial class NamedIntervalsView : AsynchronousContentView {31 [Content(typeof(IntervalCollection), true)] 32 public sealed partial class IntervalCollectionView : AsynchronousContentView { 33 33 34 public new NamedIntervalsContent {35 get => ( NamedIntervals)base.Content;34 public new IntervalCollection Content { 35 get => (IntervalCollection)base.Content; 36 36 set => base.Content = value; 37 37 } … … 41 41 } 42 42 43 public NamedIntervalsView() {43 public IntervalCollectionView() { 44 44 InitializeComponent(); 45 45 dataGridView.AutoGenerateColumns = false; -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/IntervalCollection.cs
r16896 r16904 28 28 [Item("NamedIntervals", "Represents variables with their interval ranges.")] 29 29 [StorableType("230B4E4B-41E5-4D33-9BC3-E2DAADDCA5AE")] 30 public class NamedIntervals: Item {30 public class IntervalCollection : Item { 31 31 public static new System.Drawing.Image StaticItemImage { 32 32 get => HeuristicLab.Common.Resources.VSImageLibrary.Object; … … 51 51 } 52 52 53 public NamedIntervals() : base() { }53 public IntervalCollection() : base() { } 54 54 [StorableConstructor] 55 protected NamedIntervals(StorableConstructorFlag _) : base(_) { }55 protected IntervalCollection(StorableConstructorFlag _) : base(_) { } 56 56 57 protected NamedIntervals(NamedIntervalsoriginal, Cloner cloner) : base(original, cloner) {57 protected IntervalCollection(IntervalCollection original, Cloner cloner) : base(original, cloner) { 58 58 foreach (var keyValuePair in original.VariableIntervals) { 59 59 VariableIntervals.Add(keyValuePair.Key, new Interval(keyValuePair.Value.LowerBound, keyValuePair.Value.UpperBound)); … … 62 62 63 63 public override IDeepCloneable Clone(Cloner cloner) { 64 return new NamedIntervals(this, cloner);64 return new IntervalCollection(this, cloner); 65 65 } 66 66 -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r16896 r16904 93 93 problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly())); 94 94 problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>())); 95 problemData.Parameters.Add(new FixedValueParameter< NamedIntervals>(VariableRangesParameterName, "", new NamedIntervals()));95 problemData.Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, "", new IntervalCollection())); 96 96 problemData.Parameters.Add(new FixedValueParameter<ProblemDataConstraint>(IntervalConstraintsParameterName, "", new ProblemDataConstraint())); 97 97 emptyProblemData = problemData; … … 103 103 } 104 104 105 public IFixedValueParameter< NamedIntervals> VariableRangesParameter => (IFixedValueParameter<NamedIntervals>)Parameters[VariableRangesParameterName];106 107 public NamedIntervalsVariableRanges {105 public IFixedValueParameter<IntervalCollection> VariableRangesParameter => (IFixedValueParameter<IntervalCollection>)Parameters[VariableRangesParameterName]; 106 107 public IntervalCollection VariableRanges { 108 108 get => VariableRangesParameter.Value; 109 109 set => VariableRanges = value ?? throw new ArgumentNullException("Variable Ranges", "The given variable ranges are null"); … … 148 148 if (!Parameters.ContainsKey(VariableRangesParameterName)) { 149 149 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); 150 NamedIntervals namedIntervals = new NamedIntervals();150 IntervalCollection intervalCollection = new IntervalCollection(); 151 151 foreach (var variable in variables) { 152 152 if (!this.Dataset.DoubleVariables.Contains(variable.Value)) continue; // intervals are only possible for double variables 153 153 var variableInterval = Interval.GetInterval(this.Dataset.GetDoubleValues(variable.Value)); 154 namedIntervals.VariableIntervals.Add(variable.Value, variableInterval);154 intervalCollection.VariableIntervals.Add(variable.Value, variableInterval); 155 155 } 156 156 157 Parameters.Add(new FixedValueParameter< NamedIntervals>(VariableRangesParameterName, namedIntervals));157 Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, intervalCollection)); 158 158 } 159 159 if (!Parameters.ContainsKey(IntervalConstraintsParameterName)) { … … 187 187 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); 188 188 Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First())); 189 190 NamedIntervals namedIntervals = new NamedIntervals();189 190 IntervalCollection intervalCollection = new IntervalCollection(); 191 191 foreach (var variable in variables) { 192 192 if (!dataset.DoubleVariables.Contains(variable.Value)) continue; // intervals are only possible for double variables 193 193 var variableInterval = Interval.GetInterval(dataset.GetDoubleValues(variable.Value)); 194 namedIntervals.VariableIntervals.Add(variable.Value, variableInterval);194 intervalCollection.VariableIntervals.Add(variable.Value, variableInterval); 195 195 } 196 196 197 Parameters.Add(new FixedValueParameter< NamedIntervals>(VariableRangesParameterName, namedIntervals));197 Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, intervalCollection)); 198 198 Parameters.Add(new FixedValueParameter<ProblemDataConstraint>(IntervalConstraintsParameterName, new ProblemDataConstraint(this))); 199 199 RegisterParameterEvents(); -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionProblemData.cs
r16896 r16904 28 28 string TargetVariable { get; set; } 29 29 30 NamedIntervalsVariableRanges { get; set; }30 IntervalCollection VariableRanges { get; set; } 31 31 ProblemDataConstraint IntervalConstraints { get; set; } 32 32
Note: See TracChangeset
for help on using the changeset viewer.