- Timestamp:
- 01/27/21 14:10:56 (4 years ago)
- Location:
- branches/3040_VectorBasedGP
- Files:
-
- 1 deleted
- 12 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP
- Property svn:mergeinfo changed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4
- Property svn:mergeinfo changed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r17475 r17825 145 145 <Compile Include="Implementation\ConstantModel.cs" /> 146 146 <Compile Include="Implementation\DataAnalysisModel.cs" /> 147 <Compile Include="Implementation\Interval.cs" /> 147 <Compile Include="Implementation\Interval\Interval.cs" /> 148 <Compile Include="Implementation\Interval\IntervalCollection.cs" /> 148 149 <Compile Include="Implementation\Regression\ConfidenceBoundRegressionSolution.cs" /> 149 150 <Compile Include="Implementation\Regression\ConstantRegressionModel.cs" /> -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/Interval.cs
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r17180 r17825 1 #region License Information1 #region License Information 2 2 /* HeuristicLab 3 3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) … … 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 28 using HeuristicLab.Data; 28 29 using HeuristicLab.Parameters; 29 using HEAL.Attic;30 30 31 31 namespace HeuristicLab.Problems.DataAnalysis { … … 34 34 public class RegressionProblemData : DataAnalysisProblemData, IRegressionProblemData, IStorableContent { 35 35 protected const string TargetVariableParameterName = "TargetVariable"; 36 protected const string VariableRangesParameterName = "VariableRanges"; 37 protected const string IntervalConstraintsParameterName = "IntervalConstraints"; 36 38 public string Filename { get; set; } 37 39 … … 91 93 problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly())); 92 94 problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>())); 95 problemData.Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, "", new IntervalCollection())); 93 96 emptyProblemData = problemData; 94 97 } … … 98 101 get { return (IConstrainedValueParameter<StringValue>)Parameters[TargetVariableParameterName]; } 99 102 } 103 104 public IFixedValueParameter<IntervalCollection> VariableRangesParameter => (IFixedValueParameter<IntervalCollection>)Parameters[VariableRangesParameterName]; 105 106 public IntervalCollection VariableRanges { 107 get => VariableRangesParameter.Value; 108 } 109 110 100 111 public string TargetVariable { 101 112 get { return TargetVariableParameter.Value.Value; } … … 125 136 [StorableHook(HookType.AfterDeserialization)] 126 137 private void AfterDeserialization() { 138 if (!Parameters.ContainsKey(VariableRangesParameterName)) { 139 var intervalCollection = CalculateDatasetIntervals(this.Dataset); 140 Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, intervalCollection)); 141 } 127 142 RegisterParameterEvents(); 128 143 } … … 152 167 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); 153 168 Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First())); 169 var intervalCollection = CalculateDatasetIntervals(this.Dataset); 170 Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, intervalCollection)); 154 171 RegisterParameterEvents(); 172 } 173 174 private static IntervalCollection CalculateDatasetIntervals(IDataset dataset) { 175 IntervalCollection intervalCollection = new IntervalCollection(); 176 foreach (var variable in dataset.DoubleVariables) {// intervals are only possible for double variables 177 var variableInterval = Interval.GetInterval(dataset.GetDoubleValues(variable)); 178 intervalCollection.AddInterval(variable, variableInterval); 179 } 180 181 return intervalCollection; 155 182 } 156 183 -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisModel.cs
r17180 r17825 25 25 26 26 namespace HeuristicLab.Problems.DataAnalysis { 27 [StorableType("f85ccf7a-7df5-431e-bc4d-be6f3c4c2338")]28 27 /// <summary> 29 28 /// Interface for all data-analysis models (regression/classification/clustering). 30 29 /// <remarks>All methods and properties in in this interface must be implemented thread safely</remarks> 31 30 /// </summary> 31 [StorableType("f85ccf7a-7df5-431e-bc4d-be6f3c4c2338")] 32 32 public interface IDataAnalysisModel : INamedItem { 33 33 IEnumerable<string> VariablesUsedForPrediction { get; } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs
r17180 r17825 35 35 [StorableType("c2f6fcdd-ab62-4423-be75-01aa694df411")] 36 36 public interface IDataAnalysisProblem<T> : IDataAnalysisProblem 37 where T : class, IDataAnalysisProblemData {37 where T : class, IDataAnalysisProblemData { 38 38 new IValueParameter<T> ProblemDataParameter { get; } 39 39 new T ProblemData { get; set; } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDependencyCalculator.cs
r17180 r17825 22 22 using System; 23 23 using System.Collections.Generic; 24 using HEAL.Attic; 24 25 25 26 namespace HeuristicLab.Problems.DataAnalysis { 27 [StorableType("3283B3FB-8467-4B99-9B6E-23BF3D1B8505")] 26 28 public interface IDependencyCalculator { 27 29 double Maximum { get; } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IOnlineCalculator.cs
r17180 r17825 22 22 23 23 using System; 24 using HEAL.Attic; 25 24 26 namespace HeuristicLab.Problems.DataAnalysis { 25 27 [Flags] 28 [StorableType("8A28DDA1-4814-4B77-9457-0EE930BE9C73")] 26 29 public enum OnlineCalculatorError { 27 30 /// <summary> … … 38 41 InsufficientElementsAdded = 2 39 42 } 43 44 [StorableType("119C8242-3EE7-4C34-A7AC-68ABF76EB11B")] 40 45 public interface IOnlineCalculator { 41 46 OnlineCalculatorError ErrorState { get; } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionProblemData.cs
r17180 r17825 28 28 string TargetVariable { get; set; } 29 29 30 IntervalCollection VariableRanges { get;} 31 30 32 IEnumerable<double> TargetVariableValues { get; } 31 33 IEnumerable<double> TargetVariableTrainingValues { get; } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/TimeSeriesPrognosis/IOnlineTimeSeriesCalculator.cs
r17180 r17825 22 22 23 23 using System.Collections.Generic; 24 using HEAL.Attic; 24 25 25 26 namespace HeuristicLab.Problems.DataAnalysis { 27 [StorableType("7461AC5D-9D9A-4DCD-B32F-602260E58FFC")] 26 28 public interface IOnlineTimeSeriesCalculator { 27 29 OnlineCalculatorError ErrorState { get; }
Note: See TracChangeset
for help on using the changeset viewer.