Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/21/18 09:33:30 (6 years ago)
Author:
chaider
Message:

#2971

  • Added NamedIntervals class
  • Set NamedIntervals Parameter in RegressionProblemData
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r16413 r16426  
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Problems.DataAnalysis.Implementation;
    3031
    3132namespace HeuristicLab.Problems.DataAnalysis {
     
    9293      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
    9394      problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>()));
    94       problemData.Parameters.Add(new FixedValueParameter<VariableRanges>(VariableRangesParameterName, new VariableRanges()));
     95      problemData.Parameters.Add(new FixedValueParameter<NamedIntervals>(VariableRangesParameterName, new NamedIntervals()));
    9596      emptyProblemData = problemData;
    9697    }
     
    101102    }
    102103
    103     public IFixedValueParameter<VariableRanges> VariableRangesParameter {
    104       get { return (IFixedValueParameter<VariableRanges>)Parameters[VariableRangesParameterName]; }
     104    public IFixedValueParameter<NamedIntervals> VariableRangesParameter {
     105      get { return (IFixedValueParameter<NamedIntervals>)Parameters[VariableRangesParameterName]; }
    105106    }
    106107
     
    159160      var variables = InputVariables.Select(x => x.AsReadOnly()).ToList();
    160161      Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First()));
    161       Parameters.Add(new FixedValueParameter<VariableRanges>(VariableRangesParameterName, new VariableRanges()));
     162
     163      NamedIntervals namedIntervals = new NamedIntervals();
     164      foreach (var variable in variables) {
     165        var variableInteval = Interval.GetInterval(dataset.GetDoubleValues(variable.Value));
     166        namedIntervals.Add(variable.Value, variableInteval);
     167      }
     168
     169      Parameters.Add(new FixedValueParameter<NamedIntervals>(VariableRangesParameterName, namedIntervals));
    162170      RegisterParameterEvents();
    163171    }
Note: See TracChangeset for help on using the changeset viewer.