Changeset 15140 for stable/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 07/06/17 11:06:27 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs
r15131 r15140 41 41 42 42 #region parameter properites 43 //mkommend: inserted parameter caching due to performance reasons 44 private IFixedValueParameter<Dataset> datasetParameter; 43 45 public IFixedValueParameter<Dataset> DatasetParameter { 44 get { return (IFixedValueParameter<Dataset>)Parameters[DatasetParameterName]; } 45 } 46 get { 47 if (datasetParameter == null) datasetParameter = (IFixedValueParameter<Dataset>)Parameters[DatasetParameterName]; 48 return datasetParameter; 49 } 50 } 51 52 private IFixedValueParameter<ReadOnlyCheckedItemList<StringValue>> inputVariablesParameter; 46 53 public IFixedValueParameter<ReadOnlyCheckedItemList<StringValue>> InputVariablesParameter { 47 get { return (IFixedValueParameter<ReadOnlyCheckedItemList<StringValue>>)Parameters[InputVariablesParameterName]; } 48 } 54 get { 55 if (inputVariablesParameter == null) inputVariablesParameter = (IFixedValueParameter<ReadOnlyCheckedItemList<StringValue>>)Parameters[InputVariablesParameterName]; 56 return inputVariablesParameter; 57 } 58 } 59 60 private IFixedValueParameter<IntRange> trainingPartitionParameter; 49 61 public IFixedValueParameter<IntRange> TrainingPartitionParameter { 50 get { return (IFixedValueParameter<IntRange>)Parameters[TrainingPartitionParameterName]; } 51 } 62 get { 63 if (trainingPartitionParameter == null) trainingPartitionParameter = (IFixedValueParameter<IntRange>)Parameters[TrainingPartitionParameterName]; 64 return trainingPartitionParameter; 65 } 66 } 67 68 private IFixedValueParameter<IntRange> testPartitionParameter; 52 69 public IFixedValueParameter<IntRange> TestPartitionParameter { 53 get { return (IFixedValueParameter<IntRange>)Parameters[TestPartitionParameterName]; } 54 } 70 get { 71 if (testPartitionParameter == null) testPartitionParameter = (IFixedValueParameter<IntRange>)Parameters[TestPartitionParameterName]; 72 return testPartitionParameter; 73 } 74 } 75 55 76 public IFixedValueParameter<ReadOnlyItemList<ITransformation>> TransformationsParameter { 56 77 get { return (IFixedValueParameter<ReadOnlyItemList<ITransformation>>)Parameters[TransformationsParameterName]; } … … 102 123 public virtual bool IsTrainingSample(int index) { 103 124 return index >= 0 && index < Dataset.Rows && 104 TrainingPartition.Start <= index && index < TrainingPartition.End &&105 (index < TestPartition.Start || TestPartition.End <= index);125 TrainingPartition.Start <= index && index < TrainingPartition.End && 126 (index < TestPartition.Start || TestPartition.End <= index); 106 127 } 107 128 … … 215 236 InputVariables.SetItemCheckedState(inputVariable, variable != null && data.InputVariables.ItemChecked(variable)); 216 237 } 217 218 TrainingPartition.Start = TrainingPartition.End = 0;219 TestPartition.Start = 0;220 TestPartition.End = Dataset.Rows;221 238 } 222 239 }
Note: See TracChangeset
for help on using the changeset viewer.