- Timestamp:
- 01/13/16 14:51:38 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataPreprocessing/3.4/PreprocessingContext.cs
r13504 r13507 39 39 var algorithm = Source as IAlgorithm; 40 40 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)); 42 42 43 43 var problem = algorithm != null ? algorithm.Problem as IDataAnalysisProblem : Source as IDataAnalysisProblem; 44 44 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)); 46 46 47 47 var problemData = problem != null ? problem.ProblemData : Source as IDataAnalysisProblemData; 48 48 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)); 50 50 51 51 // ToDo: Export CSV … … 63 63 64 64 65 public PreprocessingContext() : this(new RegressionProblemData()) { } 65 public PreprocessingContext() : this(new RegressionProblemData()) { 66 Name = "Data Preprocessing"; 67 } 66 68 public PreprocessingContext(IItem source) 67 : base(" PreprocessingContext") {69 : base("Data Preprocessing") { 68 70 Import(source); 69 71 } … … 85 87 public void Import(IItem source) { 86 88 Source = source; 89 var namedSource = source as INamedItem; 90 if (namedSource != null) Name = "Preprocessing: " + namedSource.Name; 87 91 88 92 var dataSource = ExtractProblemData(source); … … 100 104 #region Export 101 105 public IItem Export() { 102 var creator = new ProblemDataCreator(this);103 106 if (Source is IAlgorithm) 104 107 return ExportAlgorithm((IAlgorithm)Source); … … 124 127 private IDataAnalysisProblemData ExportProblemData(IDataAnalysisProblemData source) { 125 128 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; 127 132 } 128 133 private void SetNewProblemData(IDataAnalysisProblem problem) {
Note: See TracChangeset
for help on using the changeset viewer.