Changeset 7770 for branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 04/30/12 12:52:09 (12 years ago)
- Location:
- branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs
r7759 r7770 43 43 } 44 44 45 #region Import & Export 45 46 public void Load(ClassificationProblemData data) { 46 Name = data.Name; 47 Description = data.Description; 48 ProblemData = new ClassificationProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable); 49 ProblemData.TrainingPartition.Start = data.TrainingPartition.Start; 50 ProblemData.TrainingPartition.End = data.TrainingPartition.End; 51 ProblemData.TestPartition.Start = data.TestPartition.Start; 52 ProblemData.TestPartition.End = data.TestPartition.End; 53 OnReset(); 47 base.Load(data); 54 48 } 55 49 56 50 public ClassificationProblemData Export() { 57 ClassificationProblemData claData = new ClassificationProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable); 58 claData.Name = Name; 59 claData.Description = Description; 60 claData.TrainingPartition.Start = ProblemData.TrainingPartition.Start; 61 claData.TrainingPartition.End = ProblemData.TrainingPartition.End; 62 claData.TestPartition.Start = ProblemData.TestPartition.Start; 63 claData.TestPartition.End = ProblemData.TestPartition.End; 64 return claData; 51 if (ProblemData is ClassificationProblemData) { 52 return (ClassificationProblemData)ProblemData; 53 } else { 54 ClassificationProblemData claData = new ClassificationProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable); 55 return (ClassificationProblemData)base.Export(claData); 56 } 65 57 } 58 #endregion 66 59 } 67 60 } -
branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs
r7758 r7770 90 90 if (handler != null) handler(this, EventArgs.Empty); 91 91 } 92 93 #region Import & Export 94 protected void Load(T data) { 95 Name = data.Name; 96 Description = data.Description; 97 ProblemData = data; 98 OnReset(); 99 } 100 101 protected T Export(T data) { 102 data.Name = Name; 103 data.Description = Description; 104 data.TrainingPartition.Start = ProblemData.TrainingPartition.Start; 105 data.TrainingPartition.End = ProblemData.TrainingPartition.End; 106 data.TestPartition.Start = ProblemData.TestPartition.Start; 107 data.TestPartition.End = ProblemData.TestPartition.End; 108 return data; 109 } 110 #endregion 92 111 } 93 112 } -
branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs
r7759 r7770 43 43 } 44 44 45 #region Import & Export 45 46 public void Load(RegressionProblemData data) { 46 Name = data.Name; 47 Description = data.Description; 48 ProblemData = new RegressionProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable); 49 ProblemData.TrainingPartition.Start = data.TrainingPartition.Start; 50 ProblemData.TrainingPartition.End = data.TrainingPartition.End; 51 ProblemData.TestPartition.Start = data.TestPartition.Start; 52 ProblemData.TestPartition.End = data.TestPartition.End; 53 OnReset(); 47 base.Load(data); 54 48 } 55 49 56 50 public RegressionProblemData Export() { 57 RegressionProblemData regData = new RegressionProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable); 58 regData.Name = Name; 59 regData.Description = Description; 60 regData.TrainingPartition.Start = ProblemData.TrainingPartition.Start; 61 regData.TrainingPartition.End = ProblemData.TrainingPartition.End; 62 regData.TestPartition.Start = ProblemData.TestPartition.Start; 63 regData.TestPartition.End = ProblemData.TestPartition.End; 64 return regData; 51 if (ProblemData is RegressionProblemData) { 52 return (RegressionProblemData)ProblemData; 53 } else { 54 RegressionProblemData regData = new RegressionProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable); 55 return (RegressionProblemData)base.Export(regData); 56 } 65 57 } 58 #endregion 66 59 } 67 60 }
Note: See TracChangeset
for help on using the changeset viewer.