Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/13/16 14:51:38 (8 years ago)
Author:
pfleck
Message:

#2559

  • Enabled different export types for preprocessing.
  • Hid unused buttons in ViewShortcutListView.
  • Made data preprocessing a NamedItem to allow naming.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/PreprocessingContext.cs

    r13504 r13507  
    3939        var algorithm = Source as IAlgorithm;
    4040        if (algorithm != null)
    41           yield return new KeyValuePair<string, Func<IItem>>(algorithm.Name, () => ExportAlgorithm(algorithm));
     41          yield return new KeyValuePair<string, Func<IItem>>(algorithm.GetType().GetPrettyName(), () => ExportAlgorithm(algorithm));
    4242
    4343        var problem = algorithm != null ? algorithm.Problem as IDataAnalysisProblem : Source as IDataAnalysisProblem;
    4444        if (problem != null)
    45           yield return new KeyValuePair<string, Func<IItem>>(problem.Name, () => ExportProblem(problem));
     45          yield return new KeyValuePair<string, Func<IItem>>(problem.GetType().GetPrettyName(), () => ExportProblem(problem));
    4646
    4747        var problemData = problem != null ? problem.ProblemData : Source as IDataAnalysisProblemData;
    4848        if (problemData != null)
    49           yield return new KeyValuePair<string, Func<IItem>>(problemData.Name, () => ExportProblemData(problemData));
     49          yield return new KeyValuePair<string, Func<IItem>>(problemData.GetType().GetPrettyName(), () => ExportProblemData(problemData));
    5050
    5151        // ToDo: Export CSV
     
    6363
    6464
    65     public PreprocessingContext() : this(new RegressionProblemData()) { }
     65    public PreprocessingContext() : this(new RegressionProblemData()) {
     66      Name = "Data Preprocessing";
     67    }
    6668    public PreprocessingContext(IItem source)
    67       : base("PreprocessingContext") {
     69      : base("Data Preprocessing") {
    6870      Import(source);
    6971    }
     
    8587    public void Import(IItem source) {
    8688      Source = source;
     89      var namedSource = source as INamedItem;
     90      if (namedSource != null) Name = "Preprocessing: " + namedSource.Name;
    8791
    8892      var dataSource = ExtractProblemData(source);
     
    100104    #region Export
    101105    public IItem Export() {
    102       var creator = new ProblemDataCreator(this);
    103106      if (Source is IAlgorithm)
    104107        return ExportAlgorithm((IAlgorithm)Source);
     
    124127    private IDataAnalysisProblemData ExportProblemData(IDataAnalysisProblemData source) {
    125128      var creator = new ProblemDataCreator(this);
    126       return creator.CreateProblemData(source);
     129      var preprocessedProblemData = creator.CreateProblemData(source);
     130      preprocessedProblemData.Name = "Preprocessed " + source.Name;
     131      return preprocessedProblemData;
    127132    }
    128133    private void SetNewProblemData(IDataAnalysisProblem problem) {
Note: See TracChangeset for help on using the changeset viewer.