- Timestamp:
- 07/09/14 13:15:37 (11 years ago)
- Location:
- stable
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources reverse-merged: 11114,11116,11156 /branches/DataPreprocessing removed
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis reverse-merged: 11114,11156 /branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis removed
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
r11157 r11158 300 300 } 301 301 302 public ClassificationProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable , IEnumerable<ITransformation> transformations = null)303 : base(dataset, allowedInputVariables , transformations ?? Enumerable.Empty<ITransformation>()) {302 public ClassificationProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable) 303 : base(dataset, allowedInputVariables) { 304 304 var validTargetVariableValues = CheckVariablesForPossibleTargetVariables(dataset).Select(x => new StringValue(x).AsReadOnly()).ToList(); 305 305 var target = validTargetVariableValues.Where(x => x.Value == targetVariable).DefaultIfEmpty(validTargetVariableValues.First()).First(); -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblemData.cs
r11157 r11158 21 21 22 22 using System.Collections.Generic; 23 using System.Linq;24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Core; … … 87 86 } 88 87 89 public ClusteringProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables , IEnumerable<ITransformation> transformations = null)90 : base(dataset, allowedInputVariables , transformations ?? Enumerable.Empty<ITransformation>()) {88 public ClusteringProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables) 89 : base(dataset, allowedInputVariables) { 91 90 } 92 91 } -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs
r11157 r11158 38 38 protected const string TrainingPartitionParameterName = "TrainingPartition"; 39 39 protected const string TestPartitionParameterName = "TestPartition"; 40 protected const string TransformationsParameterName = "Transformations";41 40 42 41 #region parameter properites … … 52 51 public IFixedValueParameter<IntRange> TestPartitionParameter { 53 52 get { return (IFixedValueParameter<IntRange>)Parameters[TestPartitionParameterName]; } 54 }55 public IFixedValueParameter<ReadOnlyItemList<ITransformation>> TransformationsParameter {56 get { return (IFixedValueParameter<ReadOnlyItemList<ITransformation>>)Parameters[TransformationsParameterName]; }57 53 } 58 54 #endregion … … 93 89 } 94 90 95 public IEnumerable<ITransformation> Transformations {96 get { return TransformationsParameter.Value; }97 }98 99 91 public virtual bool IsTrainingSample(int index) { 100 92 return index >= 0 && index < Dataset.Rows && … … 119 111 [StorableHook(HookType.AfterDeserialization)] 120 112 private void AfterDeserialization() { 121 if (!Parameters.ContainsKey(TransformationsParameterName)) {122 Parameters.Add(new FixedValueParameter<ReadOnlyItemList<ITransformation>>(TransformationsParameterName, "", new ItemList<ITransformation>().AsReadOnly()));123 TransformationsParameter.Hidden = true;124 }125 113 RegisterEventHandlers(); 126 114 } 127 115 128 protected DataAnalysisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables , IEnumerable<ITransformation> transformations = null) {116 protected DataAnalysisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables) { 129 117 if (dataset == null) throw new ArgumentNullException("The dataset must not be null."); 130 118 if (allowedInputVariables == null) throw new ArgumentNullException("The allowedInputVariables must not be null."); … … 142 130 int testPartitionEnd = dataset.Rows; 143 131 144 var transformationsList = new ItemList<ITransformation>(transformations ?? Enumerable.Empty<ITransformation>());145 146 132 Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", dataset)); 147 133 Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, "", inputVariables.AsReadOnly())); 148 134 Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", new IntRange(trainingPartitionStart, trainingPartitionEnd))); 149 135 Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", new IntRange(testPartitionStart, testPartitionEnd))); 150 Parameters.Add(new FixedValueParameter<ReadOnlyItemList<ITransformation>>(TransformationsParameterName, "", transformationsList.AsReadOnly()));151 152 TransformationsParameter.Hidden = true;153 136 154 137 ((ValueParameter<Dataset>)DatasetParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false; … … 161 144 TrainingPartition.ValueChanged += new EventHandler(Parameter_ValueChanged); 162 145 TestPartition.ValueChanged += new EventHandler(Parameter_ValueChanged); 163 TransformationsParameter.ValueChanged += new EventHandler(Parameter_ValueChanged);164 146 } 165 147 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r11157 r11158 137 137 } 138 138 139 public RegressionProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable , IEnumerable<ITransformation> transformations = null)140 : base(dataset, allowedInputVariables , transformations ?? Enumerable.Empty<ITransformation>()) {139 public RegressionProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable) 140 : base(dataset, allowedInputVariables) { 141 141 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); 142 142 Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First())); -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisProblemData.cs
r11157 r11158 1582 1582 TrainingPartition.Start = 50; 1583 1583 } 1584 public TimeSeriesPrognosisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable , IEnumerable<ITransformation> transformations = null)1585 : base(dataset, allowedInputVariables, targetVariable , transformations ?? Enumerable.Empty<ITransformation>()) {1584 public TimeSeriesPrognosisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable) 1585 : base(dataset, allowedInputVariables, targetVariable) { 1586 1586 Parameters.Add(new FixedValueParameter<IntValue>(TrainingHorizonParameterName, "Specifies the horizon (how far the prognosis reaches in the future) for each training sample.", new IntValue(1))); 1587 1587 Parameters.Add(new FixedValueParameter<IntValue>(TestHorizonParameterName, "Specifies the horizon (how far the prognosis reaches in the future) for each test sample.", new IntValue(1))); … … 1643 1643 1644 1644 var trainingDataStart = TrainingIndices.First(); 1645 1645 1646 1646 base.AdjustProblemDataProperties(problemData); 1647 1647 1648 1648 TestPartition.Start = trainingDataStart; 1649 1649
Note: See TracChangeset
for help on using the changeset viewer.