Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/01/14 15:49:31 (11 years ago)
Author:
mkommend
Message:

#2206: Removed seperate plugin for transformations and integrated them in HeuristicLab.Problems.DataAnalysis.

Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4
Files:
9 edited

Legend:

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

    r11002 r11068  
    179179      <Private>False</Private>
    180180    </ProjectReference>
    181     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Transformations\3.4\HeuristicLab.Problems.DataAnalysis.Transformations-3.4.csproj">
    182       <Project>{2e257a94-d1af-435c-99b4-5ac00eadfd6a}</Project>
    183       <Name>HeuristicLab.Problems.DataAnalysis.Transformations-3.4</Name>
    184       <Private>False</Private>
    185     </ProjectReference>
    186181    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    187182      <Project>{df87c13e-a889-46ff-8153-66dcaa8c5674}</Project>
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/FilteredPreprocessingData.cs

    r11003 r11068  
    66using HeuristicLab.DataPreprocessing.Interfaces;
    77using HeuristicLab.Problems.DataAnalysis;
    8 using HeuristicLab.Problems.DataAnalysis.Transformations;
    98
    109namespace HeuristicLab.DataPreprocessing.Implementations {
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/PreprocessingData.cs

    r11002 r11068  
    2323using System.Collections;
    2424using System.Collections.Generic;
    25 using System.Globalization;
    2625using System.Linq;
    2726using HeuristicLab.Common;
     
    2928using HeuristicLab.Data;
    3029using HeuristicLab.Problems.DataAnalysis;
    31 using HeuristicLab.Problems.DataAnalysis.Transformations;
    3230
    3331namespace HeuristicLab.DataPreprocessing {
     
    116114      TrainingPartition = new IntRange(problemData.TrainingPartition.Start, problemData.TrainingPartition.End);
    117115      TestPartition = new IntRange(problemData.TestPartition.Start, problemData.TestPartition.End);
    118      
     116
    119117      RegisterEventHandler();
    120118    }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/TransactionalPreprocessingData.cs

    r11002 r11068  
    2929using HeuristicLab.Data;
    3030using HeuristicLab.Problems.DataAnalysis;
    31 using HeuristicLab.Problems.DataAnalysis.Transformations;
    3231
    3332namespace HeuristicLab.DataPreprocessing {
     
    6261    private TransactionalPreprocessingData(TransactionalPreprocessingData original, Cloner cloner)
    6362      : base(original, cloner) {
    64      }
     63    }
    6564
    6665    private void SaveSnapshot(DataPreprocessingChangedEventType changedType, int column, int row) {
     
    9493    #region Overridden IPreprocessingData Members
    9594
    96     public override T GetCell<T>(int columnIndex, int rowIndex)
    97     {
     95    public override T GetCell<T>(int columnIndex, int rowIndex) {
    9896      return (T)variableValues[columnIndex][rowIndex];
    9997    }
     
    106104    }
    107105
    108     public override string GetCellAsString(int columnIndex, int rowIndex)
    109     {
     106    public override string GetCellAsString(int columnIndex, int rowIndex) {
    110107      return variableValues[columnIndex][rowIndex].ToString();
    111108    }
    112109
    113     public override string GetVariableName(int columnIndex)
    114     {
     110    public override string GetVariableName(int columnIndex) {
    115111      return variableNames[columnIndex];
    116112    }
    117113
    118     public override int GetColumnIndex(string variableName)
    119     {
     114    public override int GetColumnIndex(string variableName) {
    120115      return variableNames.IndexOf(variableName);
    121116    }
    122117
    123     public override bool IsType<T>(int columnIndex)
    124     {
     118    public override bool IsType<T>(int columnIndex) {
    125119      return variableValues[columnIndex] is List<T>;
    126120    }
    127121
    128122    [Obsolete("use the index based variant, is faster")]
    129     public override IList<T> GetValues<T>(string variableName, bool considerSelection)
    130     {
     123    public override IList<T> GetValues<T>(string variableName, bool considerSelection) {
    131124      return GetValues<T>(GetColumnIndex(variableName), considerSelection);
    132125    }
    133126
    134     public override IList<T> GetValues<T>(int columnIndex, bool considerSelection)
    135     {
    136       if (considerSelection)
    137       {
     127    public override IList<T> GetValues<T>(int columnIndex, bool considerSelection) {
     128      if (considerSelection) {
    138129        var list = new List<T>();
    139         foreach (var rowIdx in selection[columnIndex])
    140         {
     130        foreach (var rowIdx in selection[columnIndex]) {
    141131          list.Add((T)variableValues[columnIndex][rowIdx]);
    142132        }
    143133        return list;
    144       }
    145       else
    146       {
     134      } else {
    147135        return (IList<T>)variableValues[columnIndex];
    148136      }
     
    151139    public override void SetValues<T>(int columnIndex, IList<T> values) {
    152140      SaveSnapshot(DataPreprocessingChangedEventType.ChangeColumn, columnIndex, -1);
    153       if (IsType<T>(columnIndex))
    154       {
     141      if (IsType<T>(columnIndex)) {
    155142        variableValues[columnIndex] = (IList)values;
    156       }
    157       else
    158       {
     143      } else {
    159144        throw new ArgumentException("The datatype of column " + columnIndex + " must be of type " + variableValues[columnIndex].GetType().Name + " but was " + typeof(T).Name);
    160145      }
     
    185170      return valid;
    186171    }
    187    
    188     public override bool Validate(string value, out string errorMessage, int columnIndex){
    189      if (columnIndex < 0 || columnIndex > VariableNames.Count()) {
     172
     173    public override bool Validate(string value, out string errorMessage, int columnIndex) {
     174      if (columnIndex < 0 || columnIndex > VariableNames.Count()) {
    190175        throw new ArgumentOutOfRangeException("column index is out of range");
    191176      }
     
    234219    public override void InsertRow(int rowIndex) {
    235220      SaveSnapshot(DataPreprocessingChangedEventType.DeleteRow, -1, rowIndex);
    236       foreach (IList column in variableValues)
    237       {
     221      foreach (IList column in variableValues) {
    238222        Type type = column.GetType().GetGenericArguments()[0];
    239223        column.Insert(rowIndex, type.IsValueType ? Activator.CreateInstance(type) : null);
     
    245229    public override void DeleteRow(int rowIndex) {
    246230      SaveSnapshot(DataPreprocessingChangedEventType.AddRow, -1, rowIndex);
    247       foreach (IList column in variableValues)
    248       {
     231      foreach (IList column in variableValues) {
    249232        column.RemoveAt(rowIndex);
    250233      }
     
    269252    }
    270253
    271     public override Dataset ExportToDataset()
    272     {
     254    public override Dataset ExportToDataset() {
    273255      IList<IList> values = new List<IList>();
    274256
    275       for (int i = 0; i < Columns; ++i)
    276       {
     257      for (int i = 0; i < Columns; ++i) {
    277258        values.Add(variableValues[i]);
    278259      }
     
    282263    }
    283264
    284     public override void ClearSelection()
    285     {
     265    public override void ClearSelection() {
    286266      Selection = new Dictionary<int, IList<int>>();
    287267    }
     
    289269    public override event EventHandler SelectionChanged;
    290270
    291     protected override void OnSelectionChanged()
    292     {
     271    protected override void OnSelectionChanged() {
    293272      var listeners = SelectionChanged;
    294273      if (listeners != null) listeners(this, EventArgs.Empty);
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/TransformationContent.cs

    r11001 r11068  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
    25 using HeuristicLab.Problems.DataAnalysis.Transformations;
     25using HeuristicLab.Problems.DataAnalysis;
    2626
    2727namespace HeuristicLab.DataPreprocessing {
     
    3636    public static new Image StaticItemImage {
    3737      get { return HeuristicLab.Common.Resources.VSImageLibrary.Method; }
    38     } 
     38    }
    3939
    4040    public TransformationContent(IPreprocessingData data, IFilterLogic filterLogic) {
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Interfaces/IPreprocessingData.cs

    r11002 r11068  
    2525using HeuristicLab.Data;
    2626using HeuristicLab.Problems.DataAnalysis;
    27 using HeuristicLab.Problems.DataAnalysis.Transformations;
    2827
    2928namespace HeuristicLab.DataPreprocessing {
     
    5251    bool AreAllStringColumns(IEnumerable<int> columnIndices);
    5352    bool Validate(string value, out string errorMessage, int columnIndex);
    54    
    55       IntRange TrainingPartition { get; }
     53
     54    IntRange TrainingPartition { get; }
    5655    IntRange TestPartition { get; }
    5756
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Plugin.cs.frame

    r10925 r11068  
    4444  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
    4545  [PluginDependency("HeuristicLab.Parameters","3.3")]
    46   [PluginDependency("HeuristicLab.Persistence","3.3")]
    47   [PluginDependency("HeuristicLab.Problems.DataAnalysis.Transformations", "3.4")]
     46  [PluginDependency("HeuristicLab.Persistence","3.3")]
    4847  public class HeuristicLabDataPreprocessingPlugin : PluginBase {
    4948  }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/PreprocessingTransformator.cs

    r10980 r11068  
    2525using System.Text;
    2626using HeuristicLab.Data;
    27 using HeuristicLab.Problems.DataAnalysis.Transformations;
     27using HeuristicLab.Problems.DataAnalysis;
    2828
    2929namespace HeuristicLab.DataPreprocessing {
     
    6464          renamedColumns.Clear();
    6565        }
    66       } finally {
     66      }
     67      finally {
    6768        preprocessingData.EndTransaction();
    6869      }
     
    7172    }
    7273
    73     private void PreserveColumns(IList<Transformation<double>> transformations) {
     74    private void PreserveColumns(IEnumerable<Transformation<double>> transformations) {
    7475      foreach (var transformation in transformations) {
    7576        if (!originalColumns.ContainsKey(transformation.Column)) {
     
    8182    }
    8283
    83     private void ApplyDoubleTranformationsInplace(IList<Transformation<double>> transformations, bool preserveColumns, out bool success, out string errorMsg) {
     84    private void ApplyDoubleTranformationsInplace(IEnumerable<Transformation<double>> transformations, bool preserveColumns, out bool success, out string errorMsg) {
    8485      errorMsg = string.Empty;
    8586      success = true;
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs

    r10990 r11068  
    2424using HeuristicLab.Common;
    2525using HeuristicLab.Problems.DataAnalysis;
    26 using HeuristicLab.Problems.DataAnalysis.Transformations;
    2726
    2827namespace HeuristicLab.DataPreprocessing {
Note: See TracChangeset for help on using the changeset viewer.