Changeset 11070


Ignore:
Timestamp:
07/01/14 17:42:44 (5 years ago)
Author:
mkommend
Message:

#2206: Clean up of data preprocessing code (removed unused code, used more appropriate collections, hiding of the backtransform button of symreg models).

Location:
branches/DataPreprocessing
Files:
1 deleted
15 edited

Legend:

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

    r10925 r11070  
    279279    <ProjectReference Include="..\..\HeuristicLab.Algorithms.GradientDescent\3.3\HeuristicLab.Algorithms.GradientDescent-3.3.csproj">
    280280      <Project>{1256B945-EEA9-4BE4-9880-76B5B113F089}</Project>
    281       <Name>HeuristicLab.Algorithms.GradientDescent-3.3</Name>
     281      <Name>HeuristicLab.Algorithms.GradientDescent</Name>
    282282      <Private>False</Private>
    283283    </ProjectReference>
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs

    r11042 r11070  
    3737    private bool notOwnEvent = true;
    3838    private bool isSearching = false;
    39     private bool isReplacing = false;
    4039    private bool updateOnMouseUp = false;
    4140    private SearchAndReplaceDialog findAndReplaceDialog;
     
    570569
    571570    private void StartReplacing() {
    572       isReplacing = true;
    573571      SuspendRepaint();
    574572    }
    575573
    576574    private void StopReplacing() {
    577       isReplacing = false;
    578575      ResumeRepaint(true);
    579576    }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/ManipulationView.cs

    r11045 r11070  
    7878    protected override void RegisterContentEvents() {
    7979      base.RegisterContentEvents();
    80       Content.ManipulationLogic.Changed += Content_Changed;
    8180      Content.FilterLogic.FilterChanged += FilterLogic_FilterChanged;
    8281    }
    8382
    8483    protected override void DeregisterContentEvents() {
     84      Content.FilterLogic.FilterChanged -= FilterLogic_FilterChanged;
    8585      base.DeregisterContentEvents();
    86       Content.ManipulationLogic.Changed -= Content_Changed;
    87       Content.FilterLogic.FilterChanged -= FilterLogic_FilterChanged;
    8886    }
    8987
     
    219217        var allIndices = Content.SearchLogic.GetMissingValueIndices();
    220218        int count = allIndices[columnIndex].Count;
    221         int cellCount = Content.FilterLogic.PreprocessingData.Rows*Content.FilterLogic.PreprocessingData.Columns;
     219        int cellCount = Content.FilterLogic.PreprocessingData.Rows * Content.FilterLogic.PreprocessingData.Columns;
    222220        lblPreviewReplaceMissingValues.Text = count + " cell" + (count > 1 || count == 0 ? "s" : "")
    223221          + " of " + cellCount + " (" + string.Format("{0:F2}%", 100d / cellCount * count) + ") were detected with missing values which would be replaced with " + replaceWith;
     
    292290    }
    293291
    294     void Content_Changed(object sender, DataPreprocessingChangedEventArgs e) {
    295       switch (lstMethods.SelectedIndex) {
    296         case 0:
    297           validateDeleteColumnsInfo();
    298           break;
    299         case 1:
    300           validateDeleteColumnsVariance();
    301           break;
    302         case 2:
    303           validateDeleteRowsInfo();
    304           break;
    305       }
    306     }
    307 
    308292    private void cmbReplaceWith_SelectedIndexChanged(object sender, EventArgs e) {
    309293      bool isReplaceWithValueSelected = cmbReplaceWith.SelectedIndex == 0;
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/DataCompletenessChartContent.cs

    r11004 r11070  
    66  [Item("DataCompletenessChart", "Represents a datacompleteness chart.")]
    77
    8   public class DataCompletenessChartContent : Item, IViewChartShortcut
    9   {
     8  public class DataCompletenessChartContent : Item, IViewChartShortcut {
    109    public static new Image StaticItemImage {
    1110      get { return HeuristicLab.Common.Resources.VSImageLibrary.EditBrightnessContrast; }
    1211    }
    1312
    14     private readonly SearchLogic searchLogic;
    15 
    1613    public IDataGridLogic DataGridLogic { get; private set; }
    1714    public ISearchLogic SearchLogic { get; private set; }
    1815
    19     public DataCompletenessChartContent(SearchLogic searchLogic)
    20     {
     16    public DataCompletenessChartContent(SearchLogic searchLogic) {
    2117      SearchLogic = searchLogic;
    2218    }
    23    
     19
    2420    public DataCompletenessChartContent(DataCompletenessChartContent content, Cloner cloner)
    25       : base(content, cloner)
    26     {
    27       SearchLogic = content.searchLogic;
     21      : base(content, cloner) {
     22      SearchLogic = content.SearchLogic;
    2823    }
    2924
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/DataGridContent.cs

    r11002 r11070  
    2323using System.Collections.Generic;
    2424using System.Drawing;
    25 using System.Globalization;
    2625using System.Linq;
    2726using HeuristicLab.Common;
    2827using HeuristicLab.Core;
    29 using HeuristicLab.Data;
    3028
    3129namespace HeuristicLab.DataPreprocessing {
     
    9593
    9694
    97     private IDictionary<int, IList<int>> selection;
    9895    public IDictionary<int, IList<int>> Selection {
    9996      get { return PreProcessingData.Selection; }
     
    145142
    146143    #region unused stuff/not implemented but necessary due to IStringConvertibleMatrix
    147 
     144#pragma warning disable 0067
    148145    // Is not used since DataGridContentView overrides dataGridView_CellValidating and uses
    149146    // DataGridLogic#Validate(string value, out string errorMessage, int columnIndex)
     
    160157    public event EventHandler<EventArgs<int, int>> ItemChanged;
    161158    public event EventHandler Reset;
     159
     160#pragma warning restore 0067
    162161    #endregion
    163162
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/ManipulationLogic.cs

    r11002 r11070  
    2727namespace HeuristicLab.DataPreprocessing {
    2828  public class ManipulationLogic : IManipulationLogic {
    29     private ITransactionalPreprocessingData preprocessingData;
    30     private IStatisticsLogic statisticsLogic;
    31     private ISearchLogic searchLogic;
     29    private readonly ITransactionalPreprocessingData preprocessingData;
     30    private readonly IStatisticsLogic statisticsLogic;
     31    private readonly ISearchLogic searchLogic;
    3232
    3333    public IEnumerable<string> VariableNames {
     
    402402    }
    403403
    404     public event DataPreprocessingChangedEventHandler Changed;
    405404  }
    406405}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Interfaces/IManipulationLogic.cs

    r11002 r11070  
    4646    void DeleteColumnsWithMissingValuesGreater(double percent);
    4747    void DeleteColumnsWithVarianceSmaller(double variance);
    48 
    49     event DataPreprocessingChangedEventHandler Changed;
    50 
    51 
    5248  }
    5349}
  • branches/DataPreprocessing/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj

    r10589 r11070  
    392392    </ProjectReference>
    393393  </ItemGroup>
    394   <ItemGroup>
    395     <EmbeddedResource Include="RunCollectionConstraintViews\RunCollectionComparisonConstraintView.resx">
    396       <DependentUpon>RunCollectionComparisonConstraintView.cs</DependentUpon>
    397     </EmbeddedResource>
    398   </ItemGroup>
    399394  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    400395  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/DataPreprocessing/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintViews/RunCollectionComparisonConstraintView.Designer.cs

    r10589 r11070  
    4848      this.txtConstraintData = new System.Windows.Forms.TextBox();
    4949      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
    50       this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
    5150      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5251      this.SuspendLayout();
     
    5453      // txtConstraintData
    5554      //
    56       this.txtConstraintData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     55      this.txtConstraintData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    5756            | System.Windows.Forms.AnchorStyles.Right)));
    5857      this.errorProvider.SetIconAlignment(this.txtConstraintData, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     
    6867      //
    6968      this.errorProvider.ContainerControl = this;
    70       //
    71       // contextMenuStrip1
    72       //
    73       this.contextMenuStrip1.Name = "contextMenuStrip1";
    7469      //
    7570      // RunCollectionComparisonConstraintView
     
    9287    private System.Windows.Forms.TextBox txtConstraintData;
    9388    private System.Windows.Forms.ErrorProvider errorProvider;
    94     private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
    9589  }
    9690}
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs

    r11011 r11070  
    4444      btnSimplify.Enabled = Content != null && !Locked;
    4545      exportButton.Enabled = Content != null && !Locked;
     46      transformModelButton.Visible = false;
    4647      transformModelButton.Enabled = Content != null && !Locked;
    4748    }
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Trading/3.4/ProblemData.cs

    r11068 r11070  
    16271627    }
    16281628
    1629     public ProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IList<ITransformation> transformations = null)
    1630       : base(dataset, allowedInputVariables, transformations ?? new List<ITransformation>()) {
     1629    public ProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)
     1630      : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) {
    16311631      var variables = InputVariables.Select(x => x.AsReadOnly()).ToList();
    16321632      Parameters.Add(new ConstrainedValueParameter<StringValue>(PriceChangeVariableParameterName, new ItemSet<StringValue>(variables), variables.First(x => x.Value == targetVariable)));
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs

    r11068 r11070  
    300300    }
    301301
    302     public ClassificationProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IList<ITransformation> transformations = null)
    303       : base(dataset, allowedInputVariables, transformations ?? new List<ITransformation>()) {
     302    public ClassificationProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)
     303      : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) {
    304304      var validTargetVariableValues = CheckVariablesForPossibleTargetVariables(dataset).Select(x => new StringValue(x).AsReadOnly()).ToList();
    305305      var target = validTargetVariableValues.Where(x => x.Value == targetVariable).DefaultIfEmpty(validTargetVariableValues.First()).First();
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblemData.cs

    r11068 r11070  
    2121
    2222using System.Collections.Generic;
     23using System.Linq;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    8687    }
    8788
    88     public ClusteringProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, IList<ITransformation> transformations = null)
    89       : base(dataset, allowedInputVariables, transformations ?? new List<ITransformation>()) {
     89    public ClusteringProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<ITransformation> transformations = null)
     90      : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) {
    9091    }
    9192  }
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r11068 r11070  
    137137    }
    138138
    139     public RegressionProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IList<ITransformation> transformations = null)
    140       : base(dataset, allowedInputVariables, transformations ?? new List<ITransformation>()) {
     139    public RegressionProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)
     140      : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) {
    141141      var variables = InputVariables.Select(x => x.AsReadOnly()).ToList();
    142142      Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First()));
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisProblemData.cs

    r11064 r11070  
    15821582      TrainingPartition.Start = 50;
    15831583    }
    1584     public TimeSeriesPrognosisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable)
    1585       : base(dataset, allowedInputVariables, targetVariable) {
     1584    public TimeSeriesPrognosisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)
     1585      : base(dataset, allowedInputVariables, targetVariable, transformations ?? Enumerable.Empty<ITransformation>()) {
    15861586      Parameters.Add(new FixedValueParameter<IntValue>(TrainingHorizonParameterName, "Specifies the horizon (how far the prognosis reaches in the future) for each training sample.", new IntValue(1)));
    15871587      Parameters.Add(new FixedValueParameter<IntValue>(TestHorizonParameterName, "Specifies the horizon (how far the prognosis reaches in the future) for each test sample.", new IntValue(1)));
     
    16431643
    16441644      var trainingDataStart = TrainingIndices.First();
    1645      
     1645
    16461646      base.AdjustProblemDataProperties(problemData);
    1647      
     1647
    16481648      TestPartition.Start = trainingDataStart;
    16491649
Note: See TracChangeset for help on using the changeset viewer.