Changeset 16407


Ignore:
Timestamp:
12/19/18 14:50:56 (6 months ago)
Author:
chaider
Message:

#2966: Merged branch changes into trunk.

Location:
trunk
Files:
2 added
6 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis

  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic

  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r16361 r16407  
    163163    <Compile Include="Interpreter\BatchInstruction.cs" />
    164164    <Compile Include="Interpreter\BatchOperations.cs" />
     165    <Compile Include="Interpreter\IntervalInterpreter.cs" />
    165166    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs" />
    166167    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs" />
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/DatasetUtil.cs

    r15583 r16407  
    9393    }
    9494
     95    public static Dictionary<string, Interval> GetVariableRanges(IDataset dataset, IEnumerable<int> rows = null) {
     96      Dictionary<string, Interval> variableRanges = new Dictionary<string, Interval>();
     97
     98      foreach (var variable in dataset.VariableNames) {
     99        IEnumerable<double> values = null;
     100
     101        if (rows == null) values = dataset.GetDoubleValues(variable);
     102        else values = dataset.GetDoubleValues(variable, rows);
     103
     104        var range = Interval.GetInterval(values);
     105        variableRanges.Add(variable, range);
     106      }
     107
     108      return variableRanges;
     109    }
     110
    95111    private static bool GetEqualValues(this Dictionary<ValuesType, ValuesType> variableValuesMapping, ValuesType originalValues, out ValuesType matchingValues) {
    96112      if (variableValuesMapping.ContainsKey(originalValues)) {
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r15638 r16407  
    140140    <Compile Include="Implementation\ConstantModel.cs" />
    141141    <Compile Include="Implementation\DataAnalysisModel.cs" />
     142    <Compile Include="Implementation\Interval.cs" />
    142143    <Compile Include="Implementation\Regression\ConfidenceBoundRegressionSolution.cs" />
    143144    <Compile Include="Implementation\Regression\ConstantRegressionModel.cs" />
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs

    r16405 r16407  
    5454
    5555    public static Interval GetInterval(IEnumerable<double> values) {
    56       if (values == null) throw new ArgumentNullException("The given value set is not defined.");
    57       if (!values.Any()) throw new ArgumentException($"No valid values are present.");
     56      if (values == null) throw new ArgumentNullException("values");
     57      if (!values.Any()) throw new ArgumentException($"No values are present.");
    5858
    5959      var min = double.MaxValue;
     
    7676        return false;
    7777
    78       return this.UpperBound.IsAlmost(other.UpperBound) && this.LowerBound.IsAlmost(other.LowerBound);
     78      return (UpperBound.IsAlmost(other.UpperBound) || (double.IsNaN(UpperBound) && double.IsNaN(other.UpperBound)))
     79        && (LowerBound.IsAlmost(other.LowerBound) || (double.IsNaN(LowerBound) && double.IsNaN(other.LowerBound)));
    7980    }
    8081
  • trunk/HeuristicLab.Tests/HeuristicLab.Tests.csproj

    r16207 r16407  
    583583    <Compile Include="HeuristicLab.Persistence-3.3\UseCases.cs" />
    584584    <Compile Include="HeuristicLab.PluginInfraStructure-3.3\TypeExtensionsTest.cs" />
     585    <Compile Include="HeuristicLab.Problems.DataAnalysis-3.4\IntervalTest.cs" />
    585586    <Compile Include="HeuristicLab.Problems.DataAnalysis-3.4\ThresholdCalculatorsTest.cs" />
    586587    <Compile Include="HeuristicLab.Problems.DataAnalysis-3.4\OnlineCalculatorPerformanceTest.cs" />
     
    589590    <Compile Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4\DeriveTest.cs" />
    590591    <Compile Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4\InfixExpressionParserTest.cs" />
     592    <Compile Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4\IntervalInterpreterTest.cs" />
    591593    <Compile Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4\SymbolicExpressionTreeBottomUpSimilarityCalculatorTest.cs" />
    592594    <Compile Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4\SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculatorTest.cs" />
Note: See TracChangeset for help on using the changeset viewer.