Changeset 10786


Ignore:
Timestamp:
04/23/14 15:56:31 (6 years ago)
Author:
pfleck
Message:
  • Implemented PreprocessingTransformator to apply Transformations.
Location:
branches/DataPreprocessing
Files:
1 added
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/CheckedTransformationCollectionView.cs

    r10778 r10786  
    5252      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
    5353        try {
    54           var columNames = new[] { "dummy", "target" }.AsEnumerable();
    55           return (ITransformation)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(new[] { columNames });
     54          // TODO:
     55          var columnNames = Enumerable.Range(0, 10).Select(i => "x" + i);
     56          //var columnNames = new[] { "dummy", "target" }.AsEnumerable();
     57          return (ITransformation)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(new[] { columnNames });
    5658        } catch (Exception ex) {
    5759          ErrorHandling.ShowErrorDialog(this, ex);
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/TransformationView.Designer.cs

    r10778 r10786  
    4747    /// </summary>
    4848    private void InitializeComponent() {
    49       components = new System.ComponentModel.Container();
    50       this.transformationCollectionView = new CheckedTransformationCollectionView();
     49      this.transformationCollectionView = new HeuristicLab.DataPreprocessing.Views.CheckedTransformationCollectionView();
     50      this.applyButton = new System.Windows.Forms.Button();
     51      this.SuspendLayout();
     52      //
    5153      // transformationCollectionView
    5254      //
     55      this.transformationCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     56            | System.Windows.Forms.AnchorStyles.Left)
     57            | System.Windows.Forms.AnchorStyles.Right)));
    5358      this.transformationCollectionView.Caption = "Transformations";
    5459      this.transformationCollectionView.Content = null;
    55       this.transformationCollectionView.Dock = System.Windows.Forms.DockStyle.Fill;
    5660      this.transformationCollectionView.Location = new System.Drawing.Point(0, 0);
    5761      this.transformationCollectionView.Name = "transformationCollectionView";
    58       this.transformationCollectionView.Size = new System.Drawing.Size(627, 528);
     62      this.transformationCollectionView.ReadOnly = false;
     63      this.transformationCollectionView.ShowDetails = true;
     64      this.transformationCollectionView.Size = new System.Drawing.Size(627, 482);
    5965      this.transformationCollectionView.TabIndex = 0;
     66      //
     67      // applyButton
     68      //
     69      this.applyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     70      this.applyButton.Location = new System.Drawing.Point(490, 488);
     71      this.applyButton.Name = "applyButton";
     72      this.applyButton.Size = new System.Drawing.Size(134, 23);
     73      this.applyButton.TabIndex = 1;
     74      this.applyButton.Text = "Apply Transformations";
     75      this.applyButton.UseVisualStyleBackColor = true;
     76      this.applyButton.Click += new System.EventHandler(this.applyButton_Click);
    6077      //
    6178      // TransformationView
     
    6380      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    6481      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     82      this.Controls.Add(this.applyButton);
    6583      this.Controls.Add(this.transformationCollectionView);
    6684      this.Name = "TransformationView";
    67       this.Size = new System.Drawing.Size(627, 528);
     85      this.Size = new System.Drawing.Size(627, 514);
    6886      this.ResumeLayout(false);
    6987
     
    7290    #endregion
    7391    private CheckedTransformationCollectionView transformationCollectionView;
     92    private System.Windows.Forms.Button applyButton;
    7493  }
    7594}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/TransformationView.cs

    r10772 r10786  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.MainForm;
    2324using HeuristicLab.MainForm.WindowsForms;
    24 using HeuristicLab.Problems.DataAnalysis.Transformations;
    2525
    2626namespace HeuristicLab.DataPreprocessing.Views {
     
    2929  [Content(typeof(TransformationContent), true)]
    3030  public partial class TransformationView : AsynchronousContentView {
     31
    3132    public TransformationView() {
    3233      InitializeComponent();
     
    4647      }
    4748    }
     49
     50    private void applyButton_Click(object sender, EventArgs e) {
     51      var transformations = Content.CheckedTransformationCollection.CheckedItems;
     52
     53      var transformator = new PreprocessingTransformator(Content.Data);
     54      bool success = transformator.ApplyTransformations(transformations);
     55      if (success) {
     56        Content.CheckedTransformationCollection.Clear();
     57      }
     58    }
    4859  }
    4960}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj

    r10783 r10786  
    7878    <Compile Include="Implementations\DataGridLogic.cs" />
    7979    <Compile Include="Interfaces\IFilteredPreprocessingData.cs" />
     80    <Compile Include="PreprocessingTransformator.cs" />
    8081    <Compile Include="Utils\DataPreprocessingChangedEvent.cs" />
    8182    <Compile Include="Implementations\Filter\ComparisonFilter.cs" />
     
    9192    <Compile Include="Implementations\StatisticsContent.cs" />
    9293    <Compile Include="Implementations\TransformationContent.cs" />
    93     <Compile Include="Implementations\TransformationLogic.cs" />
    9494    <Compile Include="Interfaces\IFilterLogic.cs" />
    9595    <Compile Include="Interfaces\IChartLogic.cs" />
     
    178178    </ProjectReference>
    179179  </ItemGroup>
    180   <ItemGroup>
    181     <Folder Include="Implementations\Transformations\" />
    182   </ItemGroup>
    183180  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    184181  <PropertyGroup>
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingContext.cs

    r10783 r10786  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
    25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2625using HeuristicLab.Optimization;
    2726using HeuristicLab.Problems.DataAnalysis;
    28 using HeuristicLab.Problems.DataAnalysis.Symbolic;
    29 using Variable = HeuristicLab.Problems.DataAnalysis.Symbolic.Variable;
    3027using HeuristicLab.DataPreprocessing.Implementations;
    3128using HeuristicLab.DataPreprocessing.Interfaces;
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs

    r10783 r10786  
    5252    public PreprocessingData(IDataAnalysisProblemData problemData)
    5353      : base() {
    54       Name = "-";
     54      Name = "Preprocessing Data";
     55
     56      transformations = new List<ITransformation>();
    5557
    5658      variableNames = new List<string>(problemData.Dataset.VariableNames);
Note: See TracChangeset for help on using the changeset viewer.