Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/16/21 10:23:29 (3 years ago)
Author:
chaider
Message:

#3140 merged branch into trunk

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/HeuristicLab.Problems.DataAnalysis

  • trunk/HeuristicLab.Problems.DataAnalysis/3.4

  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r18034 r18141  
    189189      if (variableRanges == null) {
    190190        variableRanges = Dataset.GetVariableRanges();
    191       }
     191      }else {
     192        foreach (var entry in variableRanges.GetVariableIntervals())
     193          VariableRanges.SetInterval(entry.Item1, entry.Item2);
     194      }
     195
    192196      Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, variableRanges));
    193197
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r18034 r18141  
    158158
    159159    public RegressionProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable,
    160       IEnumerable<ITransformation> transformations = null/*,
    161       IntervalCollection variableRanges = null*/)
    162       : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) {
     160      IEnumerable<ITransformation> transformations = null,  IntervalCollection variableRanges = null)
     161      : base(dataset, allowedInputVariables, transformations, variableRanges) {
    163162      var variables = InputVariables.Select(x => x.AsReadOnly()).ToList();
    164163      Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First()));
    165       /*if (variableRanges == null) {
    166         variableRanges = Dataset.GetVariableRanges();
    167       }
    168       Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, variableRanges));*/
     164     
    169165    }
    170166    private void RegisterParameterEvents() {
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ShapeConstrainedRegressionProblemData.cs

    r18111 r18141  
    144144    public ShapeConstrainedRegressionProblemData(IRegressionProblemData regressionProblemData)
    145145      : this(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable,
    146           regressionProblemData.TrainingPartition, regressionProblemData.TestPartition, regressionProblemData.Transformations,
    147           (regressionProblemData is ShapeConstrainedRegressionProblemData) ? ((ShapeConstrainedRegressionProblemData)regressionProblemData).ShapeConstraints : null,
    148           regressionProblemData.VariableRanges) {
     146          regressionProblemData.TrainingPartition, regressionProblemData.TestPartition, (regressionProblemData is ShapeConstrainedRegressionProblemData) ? ((ShapeConstrainedRegressionProblemData)regressionProblemData).ShapeConstraints : null,
     147          regressionProblemData.Transformations, regressionProblemData.VariableRanges) {
    149148    }
    150149
    151150    public ShapeConstrainedRegressionProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable,
    152                                                  IntRange trainingPartition, IntRange testPartition,
    153                                                  IEnumerable<ITransformation> transformations = null, ShapeConstraints sc = null, IntervalCollection variableRanges = null)
    154     : base(dataset, allowedInputVariables, targetVariable, transformations ?? Enumerable.Empty<ITransformation>()) {
     151                                                 IntRange trainingPartition, IntRange testPartition, ShapeConstraints sc = null,
     152                                                 IEnumerable<ITransformation> transformations = null, IntervalCollection variableRanges = null)
     153    : base(dataset, allowedInputVariables, targetVariable, transformations, variableRanges) {
    155154      TrainingPartition.Start = trainingPartition.Start;
    156155      TrainingPartition.End = trainingPartition.End;
     
    159158      if (sc == null) sc = new ShapeConstraints();
    160159      Parameters.Add(new FixedValueParameter<ShapeConstraints>(ShapeConstraintsParameterName, "Specifies the shape constraints for the regression problem.", (ShapeConstraints)sc.Clone()));
    161       if (variableRanges != null) {
    162         foreach (var entry in variableRanges.GetVariableIntervals())
    163           VariableRanges.SetInterval(entry.Item1, entry.Item2);
    164       }
    165160      RegisterEventHandlers();
    166161    }
Note: See TracChangeset for help on using the changeset viewer.