Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/30/12 13:33:10 (12 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/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation
Files:
4 edited

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      }
Note: See TracChangeset for help on using the changeset viewer.