Changeset 10310
- Timestamp:
- 01/08/14 15:33:08 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj
r10303 r10310 94 94 <Compile Include="Interfaces\ILineChartLogic.cs" /> 95 95 <Compile Include="Interfaces\ITransformationLogic.cs" /> 96 <Compile Include="PreprocessingCloner.cs" /> 96 97 <Compile Include="Views\FilterView.cs"> 97 98 <SubType>UserControl</SubType> -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataPreprocessingView.cs
r10307 r10310 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Linq;4 3 using System.Windows.Forms; 5 4 using HeuristicLab.Common; 6 5 using HeuristicLab.Core; 7 6 using HeuristicLab.Core.Views; 8 using HeuristicLab.Data;9 7 using HeuristicLab.MainForm; 10 using HeuristicLab.Optimization;11 using HeuristicLab.Problems.DataAnalysis;12 8 13 9 namespace HeuristicLab.DataPreprocessing { … … 25 21 private Dictionary<ListViewItem, IItem> listViewItemItemMapping; 26 22 27 28 23 public DataPreprocessingView() { 29 24 InitializeComponent(); 30 25 } 31 32 26 33 27 protected override void OnContentChanged() { … … 105 99 106 100 private void exportProblemButton_Click(object sender, EventArgs e) { 101 var cloner = new PreprocessingCloner(Content); 102 var alteredClone = cloner.GenerateAlteredClone(Content.Problem); 103 107 104 var saveFileDialog = new SaveFileDialog { 108 105 Title = "Save Item", … … 112 109 }; 113 110 114 var content = Content.Problemas IStorableContent;111 var content = alteredClone as IStorableContent; 115 112 if (saveFileDialog.ShowDialog() == DialogResult.OK) { 116 113 bool compressed = saveFileDialog.FilterIndex != 1; … … 120 117 121 118 private void applyInNewTabButton_Click(object sender, EventArgs e) { 122 IPreprocessingData Data = Content.Data;119 IPreprocessingData data = Content.Data; 123 120 124 foreach (string variable in Data.VariableNames) {125 for (int j = 0; j < Data.Rows; j++) {121 foreach (string variable in data.VariableNames) { 122 for (int j = 0; j < data.Rows; j++) { 126 123 // assume: all double 127 Data.SetCell(variable, j, 1.0);124 data.SetCell(variable, j, 1.0); 128 125 } 129 126 } 130 131 127 MessageBox.Show("Success, now cloning... "); 132 128 133 Dataset dataset = Data.ExportToDataset(); 134 var variables = new CheckedItemList<StringValue>(Data.VariableNames.Select(s => new StringValue(s))).AsReadOnly(); 135 136 var cloner = new Cloner(); 137 138 cloner.RegisterClonedObject(Content.DataAnalysisProblemData.Dataset, dataset); 139 cloner.RegisterClonedObject(Content.DataAnalysisProblemData.TrainingPartition, Data.TrainingPartition); 140 cloner.RegisterClonedObject(Content.DataAnalysisProblemData.TestPartition, Data.TestPartition); 141 cloner.RegisterClonedObject(Content.DataAnalysisProblemData.InputVariables, variables); 142 if (Content.Algorithm != null) { 143 cloner.RegisterClonedObject(Content.Algorithm.Runs, new RunCollection { OptimizerName = Content.Algorithm.Name }); 144 } 145 146 var item = cloner.Clone(Content.ParentItem); 129 var cloner = new PreprocessingCloner(Content); 130 var item = cloner.GenerateAlteredClone(Content.ParentItem); 147 131 148 132 MainFormManager.MainForm.ShowContent(item); 149 133 } 150 151 134 } 152 135 } 153
Note: See TracChangeset
for help on using the changeset viewer.