Changeset 7682 for branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
- Timestamp:
- 04/02/12 10:55:26 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs
r7664 r7682 71 71 regData.Description = Description; 72 72 regData.TargetVariable = ProblemData.TargetVariable; 73 regData.InputVariables = ProblemData.InputVariables.Select(x => x.Value) ;74 regData.AllowedInputVariables = ProblemData.AllowedInputVariables ;73 regData.InputVariables = ProblemData.InputVariables.Select(x => x.Value).ToArray(); 74 regData.AllowedInputVariables = ProblemData.AllowedInputVariables.ToArray(); 75 75 regData.TrainingPartitionStart = ProblemData.TrainingPartition.Start; 76 76 regData.TrainingPartitionEnd = ProblemData.TrainingPartition.End; … … 82 82 data.Add(ProblemData.Dataset.GetDoubleValues(variable).ToList()); 83 83 } 84 regData.Values = Transform ation(data);84 regData.Values = Transformer.Transformation(data); 85 85 86 86 return regData; 87 87 } 88 89 public static double[,] Transformation(List<List<double>> data) {90 if (!data.All(x => x.Count.Equals(data.First().Count)))91 throw new ArgumentException("Can't create jagged array.");92 double[,] values = new double[data.First().Count, data.Count];93 for (int i = 0; i < values.GetLength(0); i++) {94 for (int j = 0; j < values.GetLength(1); j++) {95 values[i, j] = data[j][i];96 }97 }98 return values;99 }100 88 } 101 89 }
Note: See TracChangeset
for help on using the changeset viewer.