Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/02/12 10:55:26 (13 years ago)
Author:
sforsten
Message:

#1784:

  • added Problem.Instances.Classification project
  • added classification problem instances
  • added a class Transformer to Problem.Instances
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs

    r7664 r7682  
    7171      regData.Description = Description;
    7272      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();
    7575      regData.TrainingPartitionStart = ProblemData.TrainingPartition.Start;
    7676      regData.TrainingPartitionEnd = ProblemData.TrainingPartition.End;
     
    8282        data.Add(ProblemData.Dataset.GetDoubleValues(variable).ToList());
    8383      }
    84       regData.Values = Transformation(data);
     84      regData.Values = Transformer.Transformation(data);
    8585
    8686      return regData;
    8787    }
    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     }
    10088  }
    10189}
Note: See TracChangeset for help on using the changeset viewer.