Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/09/14 10:37:01 (10 years ago)
Author:
gkronber
Message:

#2206: made several changes / improvements to the data-preprocessing code while reviewing the code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r11114 r11156  
    126126    }
    127127
    128     protected DataAnalysisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<ITransformation> transformations) {
     128    protected DataAnalysisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<ITransformation> transformations = null) {
    129129      if (dataset == null) throw new ArgumentNullException("The dataset must not be null.");
    130130      if (allowedInputVariables == null) throw new ArgumentNullException("The allowedInputVariables must not be null.");
     
    132132      if (allowedInputVariables.Except(dataset.DoubleVariables).Any())
    133133        throw new ArgumentException("All allowed input variables must be present in the dataset and of type double.");
    134 
    135       if (transformations == null) throw new ArgumentNullException("The transformations must not be null.");
    136134
    137135      var inputVariables = new CheckedItemList<StringValue>(dataset.DoubleVariables.Select(x => new StringValue(x)));
     
    144142      int testPartitionEnd = dataset.Rows;
    145143
    146       var transformationsList = new ItemList<ITransformation>(transformations);
     144      var transformationsList = new ItemList<ITransformation>(transformations ?? Enumerable.Empty<ITransformation>());
    147145
    148146      Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", dataset));
Note: See TracChangeset for help on using the changeset viewer.