Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/19/19 15:45:45 (6 years ago)
Author:
gkronber
Message:

#2847: fixed some issues that produced errors when testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/M5Utilities/RegressionTreeAnalyzer.cs

    r16847 r16852  
    104104      var training = pd.TrainingIndices.Where(x => !regressionRuleModel.Covers(pd.Dataset, x)).ToArray();
    105105      var test = pd.TestIndices.Where(x => !regressionRuleModel.Covers(pd.Dataset, x)).ToArray();
    106       var data = new Dataset(pd.Dataset.DoubleVariables, pd.Dataset.DoubleVariables.Select(v => pd.Dataset.GetDoubleValues(v, training.Concat(test)).ToArray()));
    107       notCovered = new RegressionProblemData(data, pd.AllowedInputVariables, pd.TargetVariable);
    108       notCovered.TestPartition.Start = notCovered.TrainingPartition.End = training.Length;
    109       notCovered.TestPartition.End = training.Length + test.Length;
     106      if (training.Length > 0 || test.Length > 0) {
     107        var data = new Dataset(pd.Dataset.DoubleVariables, pd.Dataset.DoubleVariables.Select(v => pd.Dataset.GetDoubleValues(v, training.Concat(test)).ToArray()));
     108        notCovered = new RegressionProblemData(data, pd.AllowedInputVariables, pd.TargetVariable);
     109        notCovered.TestPartition.Start = notCovered.TrainingPartition.End = training.Length;
     110        notCovered.TestPartition.End = training.Length + test.Length;
     111      } else notCovered = null;
    110112
    111113      var training2 = pd.TrainingIndices.Where(x => regressionRuleModel.Covers(pd.Dataset, x)).ToArray();
Note: See TracChangeset for help on using the changeset viewer.