Changeset 13517
- Timestamp:
- 01/15/16 17:14:26 (9 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingDataTableView.cs
r13502 r13517 745 745 746 746 // shift the chart to the left so the bars are placed on the intervals 747 if (Classification != null || valueFrequencies.First().Item1 < doubleRange.First()) {747 if (Classification != null || (valueFrequencies.Any() && valueFrequencies.First().Item1 < doubleRange.First())) { 748 748 series.Points.Add(new DataPoint(min - intervalWidth, 0)); 749 749 series.Points.Add(new DataPoint(max + intervalWidth, 0)); -
trunk/sources/HeuristicLab.DataPreprocessing/3.4/Content/CorrelationMatrixContent.cs
r13508 r13517 39 39 public DataAnalysisProblemData ProblemData { 40 40 get { 41 return (DataAnalysisProblemData)Context.CreateNewProblemData(); 42 //var creator = new ProblemDataCreator(Context); 43 //return (DataAnalysisProblemData)creator.CreateProblemData(); 41 var problemData = (DataAnalysisProblemData)Context.CreateNewProblemData(); 42 foreach (var input in problemData.InputVariables) 43 problemData.InputVariables.SetItemCheckedState(input, true); 44 // CorrelationView hides non-input columns per default 45 return problemData; 44 46 } 45 47 } -
trunk/sources/HeuristicLab.DataPreprocessing/3.4/Data/TransactionalPreprocessingData.cs
r13508 r13517 216 216 } 217 217 218 219 public override void InsertRow(int rowIndex) { 220 SaveSnapshot(DataPreprocessingChangedEventType.DeleteRow, -1, rowIndex); 221 foreach (IList column in variableValues) { 222 Type type = column.GetType().GetGenericArguments()[0]; 223 column.Insert(rowIndex, type.IsValueType ? Activator.CreateInstance(type) : null); 224 } 225 if (TrainingPartition.Start <= rowIndex && rowIndex <= TrainingPartition.End) { 226 TrainingPartition.End++; 227 if (TrainingPartition.End <= TestPartition.Start) { 228 TestPartition.Start++; 229 TestPartition.End++; 230 } 231 } else if (TestPartition.Start <= rowIndex && rowIndex <= TestPartition.End) { 232 TestPartition.End++; 233 if (TestPartition.End <= TrainingPartition.Start) { 234 TestPartition.Start++; 235 TestPartition.End++; 236 } 237 } 238 if (!IsInTransaction) 239 OnChanged(DataPreprocessingChangedEventType.AddRow, -1, rowIndex); 240 } 241 public override void DeleteRow(int rowIndex) { 242 SaveSnapshot(DataPreprocessingChangedEventType.AddRow, -1, rowIndex); 243 foreach (IList column in variableValues) { 244 column.RemoveAt(rowIndex); 245 } 246 if (TrainingPartition.Start <= rowIndex && rowIndex <= TrainingPartition.End) { 247 TrainingPartition.End--; 248 if (TrainingPartition.End <= TestPartition.Start) { 249 TestPartition.Start--; 250 TestPartition.End--; 251 } 252 } else if (TestPartition.Start <= rowIndex && rowIndex <= TestPartition.End) { 253 TestPartition.End--; 254 if (TestPartition.End <= TrainingPartition.Start) { 255 TestPartition.Start--; 256 TestPartition.End--; 257 } 258 } 259 if (!IsInTransaction) 260 OnChanged(DataPreprocessingChangedEventType.DeleteRow, -1, rowIndex); 261 } 218 262 public override void DeleteRowsWithIndices(IEnumerable<int> rows) { 219 263 SaveSnapshot(DataPreprocessingChangedEventType.AddRow, -1, -1); … … 222 266 column.RemoveAt(rowIndex); 223 267 } 268 if (TrainingPartition.Start <= rowIndex && rowIndex <= TrainingPartition.End) { 269 TrainingPartition.End--; 270 if (TrainingPartition.End <= TestPartition.Start) { 271 TestPartition.Start--; 272 TestPartition.End--; 273 } 274 } else if (TestPartition.Start <= rowIndex && rowIndex <= TestPartition.End) { 275 TestPartition.End--; 276 if (TestPartition.End <= TrainingPartition.Start) { 277 TestPartition.Start--; 278 TestPartition.End--; 279 } 280 } 224 281 } 225 282 if (!IsInTransaction) 226 283 OnChanged(DataPreprocessingChangedEventType.DeleteRow, -1, -1); 227 ResetPartitions();228 }229 230 public override void InsertRow(int rowIndex) {231 SaveSnapshot(DataPreprocessingChangedEventType.DeleteRow, -1, rowIndex);232 foreach (IList column in variableValues) {233 Type type = column.GetType().GetGenericArguments()[0];234 column.Insert(rowIndex, type.IsValueType ? Activator.CreateInstance(type) : null);235 }236 if (!IsInTransaction)237 OnChanged(DataPreprocessingChangedEventType.AddRow, -1, rowIndex);238 ResetPartitions();239 }240 241 public override void DeleteRow(int rowIndex) {242 SaveSnapshot(DataPreprocessingChangedEventType.AddRow, -1, rowIndex);243 foreach (IList column in variableValues) {244 column.RemoveAt(rowIndex);245 }246 if (!IsInTransaction)247 OnChanged(DataPreprocessingChangedEventType.DeleteRow, -1, rowIndex);248 ResetPartitions();249 284 } 250 285 … … 308 343 if (listeners != null) listeners(this, EventArgs.Empty); 309 344 } 310 311 312 private void ResetPartitions() {313 TrainingPartition = new IntRange();314 TestPartition = new IntRange();315 }316 317 345 #endregion 318 346
Note: See TracChangeset
for help on using the changeset viewer.