Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10236


Ignore:
Timestamp:
12/18/13 13:21:20 (9 years ago)
Author:
sbreuer
Message:
  • moved missing value functionality to ISearchLogic
  • created IStringConvertibleMatrix implementation and DataGridContentView
Location:
branches/DataPreprocessing
Files:
6 added
8 edited

Legend:

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

    r10221 r10236  
    8484      <DependentUpon>DataPreprocessingView.cs</DependentUpon>
    8585    </Compile>
     86    <Compile Include="Implementations\DataGridContent.cs" />
    8687    <Compile Include="Implementations\PreprocessingContext.cs" />
    8788    <Compile Include="Implementations\PreprocessingData.cs" />
    8889    <Compile Include="Implementations\PreprocessingDataManipulation.cs" />
     90    <Compile Include="Implementations\SearchLogic.cs" />
    8991    <Compile Include="Implementations\StatisticInfo.cs" />
     92    <Compile Include="DataGridContentView.cs">
     93      <SubType>UserControl</SubType>
     94    </Compile>
     95    <Compile Include="DataGridContentView.Designer.cs">
     96      <DependentUpon>DataGridContentView.cs</DependentUpon>
     97    </Compile>
     98    <Compile Include="Interfaces\IDataGridContent.cs" />
    9099    <Compile Include="Interfaces\IPreprocessingContext.cs" />
     100    <Compile Include="Interfaces\ISearchLogic.cs" />
    91101    <Compile Include="Interfaces\IStatisticInfo.cs" />
    92102    <Compile Include="Interfaces\IPreprocessingData.cs" />
     
    122132      <Private>False</Private>
    123133    </ProjectReference>
     134    <ProjectReference Include="..\..\HeuristicLab.Data.Views\3.3\HeuristicLab.Data.Views-3.3.csproj">
     135      <Project>{72104a0b-90e7-42f3-9abe-9bbbadd4b943}</Project>
     136      <Name>HeuristicLab.Data.Views-3.3</Name>
     137    </ProjectReference>
    124138    <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    125139      <Project>{bbab9df5-5ef3-4ba8-ade9-b36e82114937}</Project>
     
    149163    </ProjectReference>
    150164  </ItemGroup>
    151   <ItemGroup />
     165  <ItemGroup>
     166    <EmbeddedResource Include="DataPreprocessingView.resx">
     167      <DependentUpon>DataPreprocessingView.cs</DependentUpon>
     168    </EmbeddedResource>
     169  </ItemGroup>
    152170  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    153171  <PropertyGroup>
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs

    r10235 r10236  
    102102    }
    103103
     104    public string GetCellAsString(string variableName, int row) {
     105      return variableValues[variableName][row].ToString();
     106    }
     107
    104108    public IEnumerable<T> GetValues<T>(string variableName) {
    105109      // TODO: test if cast is valid
     
    145149    }
    146150
    147     public IEnumerable<string> VariableNames {
     151    public IList<string> VariableNames {
    148152      get { return variableNames; }
    149153    }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingDataManipulation.cs

    r10234 r10236  
    1414        public PreprocessingDataManipulation(IPreprocessingData _prepocessingData) {
    1515            preprocessingData = _prepocessingData;
    16             statisticInfo = new StatisticInfo(preprocessingData);
     16          //todo
     17            statisticInfo = new StatisticInfo(preprocessingData, new SearchLogic(preprocessingData));
    1718        }
    1819
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticInfo.cs

    r10216 r10236  
    77  public class StatisticInfo : IStatisticInfo {
    88
    9     private IPreprocessingData preprocessingData;
     9    private readonly IPreprocessingData preprocessingData;
     10    private readonly ISearchLogic searchLogic;
    1011
    11     public StatisticInfo(IPreprocessingData thePreprocessingData) {
     12    public StatisticInfo(IPreprocessingData thePreprocessingData, ISearchLogic theSearchLogic) {
    1213      preprocessingData = thePreprocessingData;
     14      searchLogic = theSearchLogic;
    1315    }
    1416
     
    4446
    4547    public int GetMissingValueCount(string variableName) {
    46       return preprocessingData.GetMissingValueIndices(variableName).Count();
     48      return searchLogic.GetMissingValueIndices(variableName).Count();
    4749    }
    4850
     
    103105      int count = 0;
    104106      foreach (var variableName in preprocessingData.VariableNames) {
    105         if (preprocessingData.IsMissingValue(variableName, rowIndex)) {
     107        if (searchLogic.IsMissingValue(variableName, rowIndex)) {
    106108          ++count;
    107109        }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingData.cs

    r10221 r10236  
    3030    T GetCell<T>(string variableName, int row);
    3131    void SetCell<T>(string variableName, int row, T value);
     32    string GetCellAsString(string variableName, int row);
    3233
    3334    IEnumerable<T> GetValues<T>(string variableName);
     
    4344    IntRange TestPartition { get; }
    4445
    45     IEnumerable<string> VariableNames { get; }
     46    IList<string> VariableNames { get; }
    4647    bool IsType<T>(string variableName);
    4748
     
    4950    int Rows { get; }
    5051
    51     /// <summary>
    52     /// Return the indices of the missing values where the key
    53     /// correspdonds to the variable name and the values to the row indices
    54     /// </summary>
    55     /// <returns></returns>
    56     IDictionary<string, IEnumerable<int>> GetMissingValueIndices();
    57 
    58     /// <summary>
    59     /// Return the row indices of the cells which contain a missing value
    60     /// </summary>
    61     /// <returns></returns>
    62     IEnumerable<int> GetMissingValueIndices(string variableName);
    63 
    64     bool IsMissingValue(string variableName, int rowIndex);
    65 
    6652    Dataset ExportToDataset();
    6753  }
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Views/3.4/ProblemDataView.Designer.cs

    r10134 r10236  
    4747      this.FeatureCorrelationButton = new System.Windows.Forms.Button();
    4848      this.DataPreprocessingButton = new System.Windows.Forms.Button();
     49      this.button1 = new System.Windows.Forms.Button();
    4950      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5051      this.SuspendLayout();
     
    8283      this.DataPreprocessingButton.Click += new System.EventHandler(this.DataPreprocessingButton_Click);
    8384      //
     85      // button1
     86      //
     87      this.button1.Location = new System.Drawing.Point(438, 45);
     88      this.button1.Name = "button1";
     89      this.button1.Size = new System.Drawing.Size(49, 24);
     90      this.button1.TabIndex = 6;
     91      this.button1.Text = "Data Preprocessing";
     92      this.button1.UseVisualStyleBackColor = true;
     93      this.button1.Click += new System.EventHandler(this.button1_Click);
     94      //
    8495      // ProblemDataView
    8596      //
    8697      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    8798      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     99      this.Controls.Add(this.button1);
    88100      this.Controls.Add(this.DataPreprocessingButton);
    89101      this.Controls.Add(this.FeatureCorrelationButton);
     
    95107      this.Controls.SetChildIndex(this.FeatureCorrelationButton, 0);
    96108      this.Controls.SetChildIndex(this.DataPreprocessingButton, 0);
     109      this.Controls.SetChildIndex(this.button1, 0);
    97110      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    98111      this.ResumeLayout(false);
     
    105118    protected System.Windows.Forms.Button FeatureCorrelationButton;
    106119    protected System.Windows.Forms.Button DataPreprocessingButton;
     120    protected System.Windows.Forms.Button button1;
    107121
    108122  }
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Views/3.4/ProblemDataView.cs

    r10235 r10236  
    123123      return itemView.Content;
    124124    }
     125
     126    private void button1_Click(object sender, EventArgs e) {
     127      Type viewType = MainFormManager.GetViewTypes(typeof(IDataGridContent), true).FirstOrDefault(t => typeof(DataGridContentView).IsAssignableFrom(t));
     128      MainFormManager.MainForm.ShowContent(new DataGridContent(new PreprocessingData(Content)), viewType);
     129    }
    125130  }
    126131}
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Views/3.4/ProblemDataView.resx

    r10134 r10236  
    121121    <value>17, 17</value>
    122122  </metadata>
    123   <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    124     <value>17, 17</value>
    125   </metadata>
    126123  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    127124    <value>140, 17</value>
Note: See TracChangeset for help on using the changeset viewer.