Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8861


Ignore:
Timestamp:
10/30/12 13:33:10 (10 years ago)
Author:
sforsten
Message:

#1292:

  • put IDependencyCalculators in own directory
  • changed DoubleRange Interval to double Minimum\Maximum in IDependencyCalculator
  • AbstractFeatureCorrelationView now uses DoubleMatrix instead of HeatMap
Location:
trunk/sources
Files:
1 added
6 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs

    r8833 r8861  
    2323using System.Linq;
    2424using System.Windows.Forms;
    25 using HeuristicLab.Analysis;
     25using HeuristicLab.Data;
    2626using HeuristicLab.MainForm;
    2727using HeuristicLab.MainForm.WindowsForms;
     
    3333  public abstract partial class AbstractFeatureCorrelationView : AsynchronousContentView {
    3434    protected FeatureCorrelationCalculator fcc;
    35     protected HeatMap currentCorrelation;
     35    protected DoubleMatrix currentCorrelation;
    3636
    3737    public new DataAnalysisProblemData Content {
     
    7272        CalculateCorrelation();
    7373      } else {
     74        dataView.Maximum = 0;
     75        dataView.Minimum = 0;
    7476        dataView.Content = null;
    7577        dataView.ResetVisibility();
     
    98100
    99101    protected void UpdateDataView() {
    100       maximumLabel.Text = currentCorrelation.Maximum.ToString();
    101       minimumLabel.Text = currentCorrelation.Minimum.ToString();
     102      IDependencyCalculator calc = (IDependencyCalculator)CorrelationCalcComboBox.SelectedValue;
     103      maximumLabel.Text = calc.Maximum.ToString();
     104      minimumLabel.Text = calc.Minimum.ToString();
    102105
    103106      currentCorrelation.SortableView = true;
     107      dataView.Maximum = calc.Maximum;
     108      dataView.Minimum = calc.Minimum;
    104109      dataView.Content = currentCorrelation;
    105110      dataView.Enabled = true;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/EnhancedStringConvertibleMatrixView.cs

    r8833 r8861  
    2525using System.Linq;
    2626using System.Windows.Forms;
    27 using HeuristicLab.Analysis;
    2827using HeuristicLab.Common;
     28using HeuristicLab.Data;
    2929using HeuristicLab.Data.Views;
    3030
     
    3939    public IEnumerable<bool> RowVisibility { set { rowVisibility = value; } }
    4040
    41     public new HeatMap Content {
    42       get { return (HeatMap)base.Content; }
     41    public double Maximum { get; set; }
     42    public double Minimum { get; set; }
     43
     44    public new DoubleMatrix Content {
     45      get { return (DoubleMatrix)base.Content; }
    4346      set { base.Content = value; }
    4447    }
     
    9497
    9598      int rowIndex = virtualRowIndices[e.RowIndex];
    96       Color backColor = GetDataPointColor(Content[rowIndex, e.ColumnIndex], Content.Minimum, Content.Maximum);
     99      Color backColor = GetDataPointColor(Content[rowIndex, e.ColumnIndex], Minimum, Maximum);
    97100      using (Brush backColorBrush = new SolidBrush(backColor)) {
    98101        e.Graphics.FillRectangle(backColorBrush, e.CellBounds);
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationView.cs

    r8833 r8861  
    2323using System.Collections.Generic;
    2424using System.Windows.Forms;
    25 using HeuristicLab.Analysis;
    2625using HeuristicLab.Data;
    2726using HeuristicLab.MainForm;
     
    6160        } else {
    6261          fcc.TryCancelCalculation();
    63           SetNewCorrelation(corr, calc);
     62          SetNewCorrelation(corr);
    6463          UpdateDataView();
    6564        }
     
    6766    }
    6867
    69     private void SetNewCorrelation(double[,] elements, IDependencyCalculator calc) {
    70       DoubleRange range = calc.Interval;
    71       HeatMap hm = new HeatMap(elements, "", range.End, range.Start);
    72       hm.RowNames = Content.Dataset.DoubleVariables;
    73       hm.ColumnNames = Content.Dataset.DoubleVariables;
    74       currentCorrelation = hm;
     68    private void SetNewCorrelation(double[,] elements) {
     69      currentCorrelation = new DoubleMatrix(elements,
     70                                            Content.Dataset.DoubleVariables,
     71                                            Content.Dataset.DoubleVariables);
    7572    }
    7673
     
    8077      } else {
    8178        correlationCache.SetCorrelation(e.Calculcator, e.Partition, e.Correlation);
    82         SetNewCorrelation(e.Correlation, e.Calculcator);
     79        SetNewCorrelation(e.Correlation);
    8380        UpdateDataView();
    8481      }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/TimeframeFeatureCorrelationView.cs

    r8833 r8861  
    2424using System.Linq;
    2525using System.Windows.Forms;
    26 using HeuristicLab.Analysis;
    2726using HeuristicLab.Data;
    2827using HeuristicLab.MainForm;
     
    101100        Array.Copy(elements, i * elements.GetLength(1), neededValues, i * neededValues.GetLength(1), frames + 1);
    102101      }
    103       SetNewCorrelation(neededValues, calc);
     102      SetNewCorrelation(neededValues);
    104103    }
    105104
    106     private void SetNewCorrelation(double[,] elements, IDependencyCalculator calc) {
    107       DoubleRange range = calc.Interval;
    108       HeatMap hm = new HeatMap(elements, "", range.End, range.Start);
    109       hm.RowNames = Content.Dataset.DoubleVariables;
    110       hm.ColumnNames = Enumerable.Range(0, elements.GetLength(1)).Select(x => x.ToString());
    111       currentCorrelation = hm;
     105    private void SetNewCorrelation(double[,] elements) {
     106      currentCorrelation = new DoubleMatrix(elements,
     107                                            Enumerable.Range(0, elements.GetLength(1)).Select(x => x.ToString()),
     108                                            Content.Dataset.DoubleVariables);
    112109    }
    113110
     
    117114      } else {
    118115        correlationTimeframCache.SetTimeframeCorrelation(e.Calculcator, e.Partition, e.Variable, e.Correlation);
    119         SetNewCorrelation(e.Correlation, e.Calculcator);
     116        SetNewCorrelation(e.Correlation);
    120117        UpdateDataView();
    121118      }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r8833 r8861  
    164164    <Compile Include="Interfaces\TimeSeriesPrognosis\ITimeSeriesPrognosisSolution.cs" />
    165165    <Compile Include="OnlineCalculators\AutoCorrelationCalculator.cs" />
     166    <Compile Include="OnlineCalculators\DependencyCalculator\HoeffdingsDependenceCalculator.cs" />
     167    <Compile Include="OnlineCalculators\DependencyCalculator\PearsonsRDependenceCalculator.cs" />
     168    <Compile Include="OnlineCalculators\DependencyCalculator\PearsonsRSquaredDependenceCalculator.cs" />
     169    <Compile Include="OnlineCalculators\DependencyCalculator\SpearmansRankCorrelationCoefficientCalculator.cs" />
    166170    <Compile Include="OnlineCalculators\OnlineBoundedMeanSquaredErrorCalculator.cs" />
    167     <Compile Include="OnlineCalculators\HoeffdingsDependenceCalculator.cs" />
    168171    <Compile Include="OnlineCalculators\OnlineDirectionalSymmetryCalculator.cs" />
    169172    <Compile Include="OnlineCalculators\OnlineMaxAbsoluteErrorCalculator.cs" />
     
    207210    <Compile Include="OnlineCalculators\OnlineTheilsUStatisticCalculator.cs" />
    208211    <Compile Include="OnlineCalculators\OnlineWeightedDirectionalSymmetryCalculator.cs" />
    209     <Compile Include="OnlineCalculators\PearsonsRDependenceCalculator.cs" />
    210     <Compile Include="OnlineCalculators\PearsonsRSquaredDependenceCalculator.cs" />
    211     <Compile Include="OnlineCalculators\SpearmansRankCorrelationCoefficientCalculator.cs" />
    212212    <Compile Include="Plugin.cs" />
    213213    <Compile Include="Implementation\Classification\ThresholdCalculators\AccuracyMaximizationThresholdCalculator.cs" />
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDependencyCalculator.cs

    r8833 r8861  
    2121
    2222using System.Collections.Generic;
    23 using HeuristicLab.Data;
    2423
    2524namespace HeuristicLab.Problems.DataAnalysis {
    2625  public interface IDependencyCalculator {
    27     DoubleRange Interval { get; }
     26    double Maximum { get; }
     27    double Minimum { get; }
    2828    string Name { get; }
    2929
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/HoeffdingsDependenceCalculator.cs

    r8853 r8861  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using HeuristicLab.Data;
    2625
    2726namespace HeuristicLab.Problems.DataAnalysis {
    2827  public class HoeffdingsDependenceCalculator : IDependencyCalculator {
    2928
    30     public DoubleRange Interval { get { return new DoubleRange(1.0, -0.5); } }
     29    public double Maximum { get { return 1.0; } }
     30
     31    public double Minimum { get { return -0.5; } }
    3132
    3233    public string Name { get { return "Hoeffdings Dependence"; } }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/PearsonsRDependenceCalculator.cs

    r8853 r8861  
    2222using System;
    2323using System.Collections.Generic;
    24 using HeuristicLab.Data;
    2524
    2625namespace HeuristicLab.Problems.DataAnalysis {
    2726  public class PearsonsRDependenceCalculator : IDependencyCalculator {
    2827
    29     public DoubleRange Interval { get { return new DoubleRange(1.0, -1.0); } }
     28    public double Maximum { get { return 1.0; } }
     29
     30    public double Minimum { get { return -1.0; } }
    3031
    3132    public string Name { get { return "Pearsons R"; } }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/PearsonsRSquaredDependenceCalculator.cs

    r8853 r8861  
    2121
    2222using System.Collections.Generic;
    23 using HeuristicLab.Data;
    2423
    2524namespace HeuristicLab.Problems.DataAnalysis {
    2625  public class PearsonsRSquaredDependenceCalculator : IDependencyCalculator {
    2726
    28     public DoubleRange Interval { get { return new DoubleRange(1.0, 0.0); } }
     27    public double Maximum { get { return 1.0; } }
     28
     29    public double Minimum { get { return 0.0; } }
    2930
    3031    public string Name { get { return "Pearsons R Squared"; } }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/SpearmansRankCorrelationCoefficientCalculator.cs

    r8853 r8861  
    2222using System.Collections.Generic;
    2323using System.Linq;
    24 using HeuristicLab.Data;
    2524
    2625namespace HeuristicLab.Problems.DataAnalysis {
    2726  public class SpearmansRankCorrelationCoefficientCalculator : IDependencyCalculator {
    2827
    29     public DoubleRange Interval { get { return new DoubleRange(1.0, -1.0); } }
     28    public double Maximum { get { return 1.0; } }
     29
     30    public double Minimum { get { return -1.0; } }
    3031
    3132    public string Name { get { return "Spearmans Rank"; } }
Note: See TracChangeset for help on using the changeset viewer.