Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/28/14 15:09:26 (10 years ago)
Author:
mleitner
Message:

Add Feature correlation matrix, Add limit for distinct values in histogramm classification.

Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj

    r10882 r10908  
    8181    <Compile Include="Implementations\PreprocessingDataTable.cs" />
    8282    <Compile Include="Interfaces\IFilteredPreprocessingData.cs" />
     83    <Compile Include="Implementations\CorrelationMatrixContent.cs" />
    8384    <Compile Include="PreprocessingTransformator.cs" />
    8485    <Compile Include="Utils\DataPreprocessingChangedEvent.cs" />
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs

    r10882 r10908  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3232
    3333  public class ChartLogic : IChartLogic {
    34  
     34    private const int MAX_DISTINCT_VALUES_FOR_CLASSIFCATION = 20;
    3535    private ITransactionalPreprocessingData preprocessingData;
    3636
     
    6363    }
    6464
    65     public List<double> GetVariableValues(string variableName) {
    66       return preprocessingData.GetValues<double>(preprocessingData.GetColumnIndex(variableName)).ToList();
     65    public IEnumerable<double> GetVariableValues(string variableName) {
     66      return preprocessingData.GetValues<double>(preprocessingData.GetColumnIndex(variableName));
    6767    }
    6868
     
    7474        if (preprocessingData.IsType<double>(preprocessingData.GetColumnIndex(variableName)))
    7575          doubleVariableNames.Add(variableName);
     76      }
     77
     78      return doubleVariableNames;
     79    }
     80
     81    public IEnumerable<string> GetVariableNamesForHistogramClassification() {
     82      List<string> doubleVariableNames = new List<string>();
     83
     84      //only return variable names from type double
     85      foreach (string variableName in preprocessingData.VariableNames)
     86      {
     87        int columnIndex           = preprocessingData.GetColumnIndex(variableName);
     88        bool isDouble             = preprocessingData.IsType<double>(columnIndex);
     89        double distinctValueCount = preprocessingData.GetValues<double>(columnIndex).GroupBy(x => x).Count();
     90        bool distinctValuesOk     = distinctValueCount <= MAX_DISTINCT_VALUES_FOR_CLASSIFCATION;
     91
     92        if (isDouble && distinctValuesOk)
     93              doubleVariableNames.Add(variableName);
    7694      }
    7795
     
    146164     
    147165
    148       List<double> xValues = GetVariableValues(variableNameX);
    149       List<double> yValues = GetVariableValues(variableNameY);
     166      List<double> xValues = GetVariableValues(variableNameX).ToList();
     167      List<double> yValues = GetVariableValues(variableNameY).ToList();
    150168
    151169      List<Point2D<double>> points = new List<Point2D<double>>();
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/CorrelationMatrixContent.cs

    r10870 r10908  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
     25using HeuristicLab.Problems.DataAnalysis;
    2526
    2627namespace HeuristicLab.DataPreprocessing {
    2728
    28   [Item("LineChart", "Represents the line chart grid.")]
    29   public class LineChartContent : PreprocessingChartContent {
     29  [Item("Feature Correlation Matrix", "Represents the feature correlation matrix.")]
     30  public class CorrelationMatrixContent : Item, IViewShortcut
     31  {
     32    public DataAnalysisProblemData ProblemData { get; set; }
    3033
    31     public LineChartContent(IChartLogic chartlogic)
    32       : base(chartlogic) {
     34    public CorrelationMatrixContent(DataAnalysisProblemData data) {
     35      ProblemData = data;
    3336    }
    3437
    35     public LineChartContent(LineChartContent content, Cloner cloner)
    36       : base(content, cloner) {
    37 
     38    public CorrelationMatrixContent(CorrelationMatrixContent original, Cloner cloner)
     39      : base(original, cloner) {
     40 
    3841    }
    39 
     42 
    4043    public static new Image StaticItemImage {
    41       get { return HeuristicLab.Common.Resources.VSImageLibrary.Performance; }
     44      get { return HeuristicLab.Common.Resources.VSImageLibrary.Gradient; }
    4245    }
    4346
    4447    public override IDeepCloneable Clone(Cloner cloner) {
    45       return new LineChartContent(this, cloner);
     48      return new CorrelationMatrixContent(this, cloner);
    4649    }
    47 
    4850  }
    4951}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilterLogic.cs

    r10900 r10908  
    2727namespace HeuristicLab.DataPreprocessing {
    2828  public class FilterLogic : IFilterLogic {
    29 
    3029    private IFilteredPreprocessingData preprocessingData;
    3130
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/HistogramContent.cs

    r10871 r10908  
    3636    public HistogramContent(HistogramContent content, Cloner cloner)
    3737      : base(content, cloner) {
    38 
    3938    }
    4039
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IChartLogic.cs

    r10882 r10908  
    5050
    5151    IEnumerable<string> GetVariableNames();
    52     List<double> GetVariableValues(string variableName);
     52    IEnumerable<string> GetVariableNamesForHistogramClassification();
     53
     54    IEnumerable<double> GetVariableValues(string variableName);
    5355  }
    5456}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/ProblemDataCreator.cs

    r10772 r10908  
    2626
    2727namespace HeuristicLab.DataPreprocessing {
    28   internal class ProblemDataCreator {
     28  public class ProblemDataCreator {
    2929
    3030    private readonly IPreprocessingContext context;
Note: See TracChangeset for help on using the changeset viewer.