Changeset 13156


Ignore:
Timestamp:
11/13/15 21:19:15 (3 years ago)
Author:
gkronber
Message:

#1998: merged changes from trunk to stable branch

Location:
stable
Files:
20 edited
10 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Algorithms.DataAnalysis

  • stable/HeuristicLab.Algorithms.DataAnalysis.Views

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/HLScript/HeuristicLab.Algorithms.DataAnalysis.Viewsmergedeligible
      /branches/HiveStatistics/sources/HeuristicLab.Algorithms.DataAnalysis.Viewsmergedeligible
      /branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis.Viewsmergedeligible
      /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Viewsmergedeligible
      /branches/1721-RandomForestPersistence/HeuristicLab.Algorithms.DataAnalysis.Views10321-10322
      /branches/Algorithms.GradientDescent/HeuristicLab.Algorithms.DataAnalysis.Views5516-5520
      /branches/Benchmarking/sources/HeuristicLab.Algorithms.DataAnalysis.Views6917-7005
      /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis.Views9117-13099
      /branches/CloningRefactoring/HeuristicLab.Algorithms.DataAnalysis.Views4656-4721
      /branches/CodeEditor/HeuristicLab.Algorithms.DataAnalysis.Views11700-11806
      /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis.Views5471-5808
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Algorithms.DataAnalysis.Views5815-6180
      /branches/DataAnalysis/HeuristicLab.Algorithms.DataAnalysis.Views4458-4459,​4462,​4464
      /branches/DataPreprocessing/HeuristicLab.Algorithms.DataAnalysis.Views10085-11101
      /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis.Views6284-6795
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Algorithms.DataAnalysis.Views5060
      /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Algorithms.DataAnalysis.Views11570-12508
      /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Algorithms.DataAnalysis.Views6123-9799
      /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Algorithms.DataAnalysis.Views11130-12721
      /branches/LogResidualEvaluator/HeuristicLab.Algorithms.DataAnalysis.Views10202-10483
      /branches/NET40/sources/HeuristicLab.Algorithms.DataAnalysis.Views5138-5162
      /branches/NSGA-II Changes/HeuristicLab.Algorithms.DataAnalysis.Views12033-12122
      /branches/ParallelEngine/HeuristicLab.Algorithms.DataAnalysis.Views5175-5192
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Algorithms.DataAnalysis.Views7568-7810
      /branches/QAPAlgorithms/HeuristicLab.Algorithms.DataAnalysis.Views6350-6627
      /branches/Restructure trunk solution/HeuristicLab.Algorithms.DataAnalysis.Views6828
      /branches/RuntimeOptimizer/HeuristicLab.Algorithms.DataAnalysis.Views8943-9078
      /branches/ScatterSearch (trunk integration)/HeuristicLab.Algorithms.DataAnalysis.Views7787-8333
      /branches/SlaveShutdown/HeuristicLab.Algorithms.DataAnalysis.Views8944-8956
      /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Algorithms.DataAnalysis.Views10204-10479
      /branches/SuccessProgressAnalysis/HeuristicLab.Algorithms.DataAnalysis.Views5370-5682
      /branches/Trunk/HeuristicLab.Algorithms.DataAnalysis.Views6829-6865
      /branches/UnloadJobs/HeuristicLab.Algorithms.DataAnalysis.Views9168-9215
      /branches/VNS/HeuristicLab.Algorithms.DataAnalysis.Views5594-5752
      /branches/histogram/HeuristicLab.Algorithms.DataAnalysis.Views5959-6341
  • stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj

    r11920 r13156  
    166166    <Compile Include="NcaDimensionReductionView.Designer.cs">
    167167      <DependentUpon>NcaDimensionReductionView.cs</DependentUpon>
     168    </Compile>
     169    <Compile Include="OneRClassificationModelView.cs" />
     170    <Compile Include="OneRClassificationModelView.Designer.cs">
     171      <DependentUpon>OneRClassificationModelView.cs</DependentUpon>
    168172    </Compile>
    169173    <Compile Include="Plugin.cs" />
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithmStatic.cs

    r12711 r13156  
    9494        weights = new List<double>();
    9595        // add constant model
    96         models.Add(new ConstantRegressionModel(f0));
     96        models.Add(new ConstantModel(f0));
    9797        weights.Add(1.0);
    9898      }
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj

    r13148 r13156  
    122122  </ItemGroup>
    123123  <ItemGroup>
     124    <Compile Include="BaselineClassifiers\OneR.cs" />
     125    <Compile Include="BaselineClassifiers\OneRClassificationModel.cs" />
     126    <Compile Include="BaselineClassifiers\OneRClassificationSolution.cs" />
     127    <Compile Include="BaselineClassifiers\ZeroR.cs" />
    124128    <Compile Include="CrossValidation.cs">
    125129      <SubType>Code</SubType>
  • stable/HeuristicLab.Problems.DataAnalysis

  • stable/HeuristicLab.Problems.DataAnalysis.Views

  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs

    r12009 r13156  
    4646
    4747    private Dictionary<double, Series> classValueSeriesMapping;
    48     private Random random;
     48    private System.Random random;
    4949    private bool updateInProgress;
    5050
     
    5454
    5555      classValueSeriesMapping = new Dictionary<double, Series>();
    56       random = new Random();
     56      random = new System.Random();
    5757      updateInProgress = false;
    5858
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r13062 r13156  
    137137    <Compile Include="Classification\ClassificationFeatureCorrelationView.Designer.cs">
    138138      <DependentUpon>ClassificationFeatureCorrelationView.cs</DependentUpon>
     139    </Compile>
     140    <Compile Include="Classification\ClassificationSolutionComparisonView.cs">
     141      <SubType>UserControl</SubType>
     142    </Compile>
     143    <Compile Include="Classification\ClassificationSolutionComparisonView.Designer.cs">
     144      <DependentUpon>ClassificationSolutionComparisonView.cs</DependentUpon>
    139145    </Compile>
    140146    <Compile Include="Classification\ClassificationTimeframeFeatureCorrelationView.cs">
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs

    r13062 r13156  
    292292    private IRegressionSolution CreateConstantSolution() {
    293293      double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average();
    294       var model = new ConstantRegressionModel(averageTrainingTarget);
    295       var solution = new ConstantRegressionSolution(model, (IRegressionProblemData)ProblemData.Clone());
     294      var model = new ConstantModel(averageTrainingTarget);
     295      var solution = model.CreateRegressionSolution(ProblemData);
    296296      solution.Name = "Baseline (constant)";
    297297      return solution;
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r12702 r13156  
    130130    <Compile Include="Implementation\Classification\ClassificationEnsembleProblemData.cs" />
    131131    <Compile Include="Implementation\Classification\ClassificationSolutionBase.cs" />
     132    <Compile Include="Implementation\Classification\ConstantClassificationSolution.cs" />
    132133    <Compile Include="Implementation\Classification\DiscriminantFunctionClassificationSolutionBase.cs" />
    133134    <Compile Include="Implementation\Clustering\ClusteringProblem.cs" />
    134135    <Compile Include="Implementation\Clustering\ClusteringProblemData.cs" />
    135136    <Compile Include="Implementation\Clustering\ClusteringSolution.cs" />
     137    <Compile Include="Implementation\ConstantModel.cs" />
    136138    <Compile Include="Implementation\Regression\ConstantRegressionModel.cs" />
    137139    <Compile Include="Implementation\Regression\ConstantRegressionSolution.cs" />
     
    182184    <Compile Include="OnlineCalculators\AutoCorrelationCalculator.cs" />
    183185    <Compile Include="OnlineCalculators\ClassificationPerformanceMeasuresCalculator.cs" />
     186    <Compile Include="OnlineCalculators\ConfusionMatrixCalculator.cs" />
    184187    <Compile Include="OnlineCalculators\DependencyCalculator\HoeffdingsDependenceCalculator.cs" />
    185188    <Compile Include="OnlineCalculators\DependencyCalculator\PearsonsRDependenceCalculator.cs" />
    186189    <Compile Include="OnlineCalculators\DependencyCalculator\PearsonsRSquaredDependenceCalculator.cs" />
    187190    <Compile Include="OnlineCalculators\DependencyCalculator\SpearmansRankCorrelationCoefficientCalculator.cs" />
     191    <Compile Include="OnlineCalculators\FOneScoreCalculator.cs" />
     192    <Compile Include="OnlineCalculators\MatthewsCorrelationCoefficientCalculator.cs" />
    188193    <Compile Include="OnlineCalculators\OnlineBoundedMeanSquaredErrorCalculator.cs" />
    189194    <Compile Include="OnlineCalculators\OnlineCovarianceCalculator.cs" />
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationPerformanceMeasures.cs

    r12009 r13156  
    3737    protected const string TrainingFalsePositiveRateResultName = "False positive rate (training)";
    3838    protected const string TrainingFalseDiscoveryRateResultName = "False discovery rate (training)";
     39    protected const string TrainingF1ScoreResultName = "F1 score (training)";
     40    protected const string TrainingMatthewsCorrelationResultName = "Matthews Correlation (training)";
    3941    protected const string TestTruePositiveRateResultName = "True positive rate (test)";
    4042    protected const string TestTrueNegativeRateResultName = "True negative rate (test)";
     
    4345    protected const string TestFalsePositiveRateResultName = "False positive rate (test)";
    4446    protected const string TestFalseDiscoveryRateResultName = "False discovery rate (test)";
     47    protected const string TestF1ScoreResultName = "F1 score (test)";
     48    protected const string TestMatthewsCorrelationResultName = "Matthews Correlation (test)";
    4549    #endregion
    4650
     
    8993      set { ((DoubleValue)this[TrainingFalseDiscoveryRateResultName].Value).Value = value; }
    9094    }
     95    public double TrainingF1Score {
     96      get { return ((DoubleValue)this[TrainingF1ScoreResultName].Value).Value; }
     97      set { ((DoubleValue)this[TrainingF1ScoreResultName].Value).Value = value; }
     98    }
     99    public double TrainingMatthewsCorrelation {
     100      get { return ((DoubleValue)this[TrainingMatthewsCorrelationResultName].Value).Value; }
     101      set { ((DoubleValue)this[TrainingMatthewsCorrelationResultName].Value).Value = value; }
     102    }
    91103    public double TestTruePositiveRate {
    92104      get { return ((DoubleValue)this[TestTruePositiveRateResultName].Value).Value; }
     
    113125      set { ((DoubleValue)this[TestFalseDiscoveryRateResultName].Value).Value = value; }
    114126    }
     127    public double TestF1Score {
     128      get { return ((DoubleValue)this[TestF1ScoreResultName].Value).Value; }
     129      set { ((DoubleValue)this[TestF1ScoreResultName].Value).Value = value; }
     130    }
     131    public double TestMatthewsCorrelation {
     132      get { return ((DoubleValue)this[TestMatthewsCorrelationResultName].Value).Value; }
     133      set { ((DoubleValue)this[TestMatthewsCorrelationResultName].Value).Value = value; }
     134    }
    115135    #endregion
    116136
     
    123143      Add(new Result(TrainingFalsePositiveRateResultName, "The false positive rate is the complement of the true negative rate of the model on the training partition.", new PercentValue()));
    124144      Add(new Result(TrainingFalseDiscoveryRateResultName, "The false discovery rate is the complement of the positive predictive value of the model on the training partition.", new PercentValue()));
     145      Add(new Result(TrainingF1ScoreResultName, "The F1 score of the model on the training partition.", new DoubleValue()));
     146      Add(new Result(TrainingMatthewsCorrelationResultName, "The Matthews correlation value of the model on the training partition.", new DoubleValue()));
    125147      Add(new Result(TestTruePositiveRateResultName, "Sensitivity/True positive rate of the model on the test partition\n(TP/(TP+FN)).", new PercentValue()));
    126148      Add(new Result(TestTrueNegativeRateResultName, "Specificity/True negative rate of the model on the test partition\n(TN/(FP+TN)).", new PercentValue()));
     
    129151      Add(new Result(TestFalsePositiveRateResultName, "The false positive rate is the complement of the true negative rate of the model on the test partition.", new PercentValue()));
    130152      Add(new Result(TestFalseDiscoveryRateResultName, "The false discovery rate is the complement of the positive predictive value of the model on the test partition.", new PercentValue()));
     153      Add(new Result(TestF1ScoreResultName, "The F1 score of the model on the test partition.", new DoubleValue()));
     154      Add(new Result(TestMatthewsCorrelationResultName, "The Matthews correlation value of the model on the test partition.", new DoubleValue()));
    131155      TrainingTruePositiveRate = double.NaN;
    132156      TrainingTrueNegativeRate = double.NaN;
     
    135159      TrainingFalsePositiveRate = double.NaN;
    136160      TrainingFalseDiscoveryRate = double.NaN;
     161      TrainingF1Score = double.NaN;
     162      TrainingMatthewsCorrelation = double.NaN;
    137163      TestTruePositiveRate = double.NaN;
    138164      TestTrueNegativeRate = double.NaN;
     
    141167      TestFalsePositiveRate = double.NaN;
    142168      TestFalseDiscoveryRate = double.NaN;
     169      TestF1Score = double.NaN;
     170      TestMatthewsCorrelation = double.NaN;
    143171    }
    144172
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionBase.cs

    r12009 r13156  
    2626using HeuristicLab.Optimization;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Problems.DataAnalysis.OnlineCalculators;
    2829
    2930namespace HeuristicLab.Problems.DataAnalysis {
     
    135136      if (testPerformanceCalculator.ErrorState == OnlineCalculatorError.None)
    136137        ClassificationPerformanceMeasures.SetTestResults(testPerformanceCalculator);
     138
     139      if (ProblemData.Classes == 2) {
     140        var f1Training = FOneScoreCalculator.Calculate(originalTrainingClassValues, estimatedTrainingClassValues, out errorState);
     141        if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TrainingF1Score = f1Training;
     142        var f1Test = FOneScoreCalculator.Calculate(originalTestClassValues, estimatedTestClassValues, out errorState);
     143        if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TestF1Score = f1Test;
     144      }
     145
     146      var mccTraining = MatthewsCorrelationCoefficientCalculator.Calculate(originalTrainingClassValues, estimatedTrainingClassValues, out errorState);
     147      if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TrainingMatthewsCorrelation = mccTraining;
     148      var mccTest = MatthewsCorrelationCoefficientCalculator.Calculate(originalTestClassValues, estimatedTestClassValues, out errorState);
     149      if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TestMatthewsCorrelation = mccTest;
    137150    }
    138151
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs

    r13048 r13156  
    3131  [StorableClass]
    3232  [Item("Constant Regression Model", "A model that always returns the same constant value regardless of the presented input data.")]
     33  [Obsolete]
    3334  public class ConstantRegressionModel : NamedItem, IRegressionModel, IStringConvertibleValue {
    3435    [Storable]
     
    6061
    6162    public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
    62       return new ConstantRegressionSolution(this, new RegressionProblemData(problemData));
     63      return new ConstantRegressionSolution(new ConstantModel(constant), new RegressionProblemData(problemData));
    6364    }
    6465
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionSolution.cs

    r12009 r13156  
    2828  [Item(Name = "Constant Regression Solution", Description = "Represents a constant regression solution (model + data).")]
    2929  public class ConstantRegressionSolution : RegressionSolution {
    30     public new ConstantRegressionModel Model {
    31       get { return (ConstantRegressionModel)base.Model; }
     30    public new ConstantModel Model {
     31      get { return (ConstantModel)base.Model; }
    3232      set { base.Model = value; }
    3333    }
     
    3636    protected ConstantRegressionSolution(bool deserializing) : base(deserializing) { }
    3737    protected ConstantRegressionSolution(ConstantRegressionSolution original, Cloner cloner) : base(original, cloner) { }
    38     public ConstantRegressionSolution(ConstantRegressionModel model, IRegressionProblemData problemData)
     38    public ConstantRegressionSolution(ConstantModel model, IRegressionProblemData problemData)
    3939      : base(model, problemData) {
    4040      RecalculateResults();
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/ConstantTimeSeriesPrognosisModel.cs

    r12702 r13156  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    2930  [StorableClass]
    3031  [Item("Constant TimeSeries Model", "A time series model that returns for all prediciton the same constant value.")]
     32  [Obsolete]
    3133  public class ConstantTimeSeriesPrognosisModel : ConstantRegressionModel, ITimeSeriesPrognosisModel {
    3234    [StorableConstructor]
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisResults.cs

    r12669 r13156  
    373373      //mean model
    374374      double trainingMean = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).Average();
    375       var meanModel = new ConstantTimeSeriesPrognosisModel(trainingMean);
     375      var meanModel = new ConstantModel(trainingMean);
    376376
    377377      //AR1 model
     
    448448        //mean model
    449449        double trainingMean = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).Average();
    450         var meanModel = new ConstantTimeSeriesPrognosisModel(trainingMean);
     450        var meanModel = new ConstantModel(trainingMean);
    451451
    452452        //AR1 model
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionBase.cs

    r12009 r13156  
    150150      OnlineCalculatorError errorState;
    151151      double trainingMean = ProblemData.TrainingIndices.Any() ? ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average() : double.NaN;
    152       var meanModel = new ConstantTimeSeriesPrognosisModel(trainingMean);
     152      var meanModel = new ConstantModel(trainingMean);
    153153
    154154      double alpha, beta;
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/ClassificationPerformanceMeasuresCalculator.cs

    r12009 r13156  
    2323using System.Collections.Generic;
    2424using HeuristicLab.Common;
     25using HeuristicLab.Problems.DataAnalysis.OnlineCalculators;
    2526
    2627namespace HeuristicLab.Problems.DataAnalysis {
Note: See TracChangeset for help on using the changeset viewer.