Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/INcaInitializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/INcaInitializer.cs	(revision 9270)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/INcaInitializer.cs	(revision 9272)
@@ -31,5 +31,5 @@
     /// <param name="dimensions">The amount of columns in the matrix</param>
     /// <returns>The matrix that projects the input variables into a lower dimensional space.</returns>
-    double[,] Initialize(IClassificationProblemData data, Scaling scaling, int dimensions);
+    double[,] Initialize(IClassificationProblemData data, int dimensions);
   }
 }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/LdaInitializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/LdaInitializer.cs	(revision 9270)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/LdaInitializer.cs	(revision 9272)
@@ -40,21 +40,11 @@
     }
 
-    public override double[,] Initialize(IClassificationProblemData data, Scaling scaling, int dimensions) {
+    public override double[,] Initialize(IClassificationProblemData data, int dimensions) {
       var instances = data.TrainingIndices.Count();
       var attributes = data.AllowedInputVariables.Count();
 
-      var ldaDs = new double[instances, attributes + 1];
-      int j = 0;
-      foreach (var a in data.AllowedInputVariables) {
-        int i = 0;
-        var sv = scaling.GetScaledValues(data.Dataset, a, data.TrainingIndices);
-        foreach (var v in sv) {
-          ldaDs[i++, j] = v;
-        }
-        j++;
-      }
-      j = 0;
-      foreach (var tv in data.Dataset.GetDoubleValues(data.TargetVariable, data.TrainingIndices))
-        ldaDs[j++, attributes] = tv;
+      var ldaDs = AlglibUtil.PrepareInputMatrix(data.Dataset,
+                                                data.AllowedInputVariables.Concat(data.TargetVariable.ToEnumerable()),
+                                                data.TrainingIndices);
 
       var uniqueClasses = data.Dataset.GetDoubleValues(data.TargetVariable, data.TrainingIndices).Distinct().Count();
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/NcaInitializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/NcaInitializer.cs	(revision 9270)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/NcaInitializer.cs	(revision 9272)
@@ -43,7 +43,4 @@
       get { return (ILookupParameter<RealVector>)Parameters["NcaMatrix"]; }
     }
-    public ILookupParameter<Scaling> ScalingParameter {
-      get { return (ILookupParameter<Scaling>)Parameters["Scaling"]; }
-    }
 
     [StorableConstructor]
@@ -54,13 +51,11 @@
       Parameters.Add(new LookupParameter<IntValue>("Dimensions", "The number of dimensions to which the features should be pruned."));
       Parameters.Add(new LookupParameter<RealVector>("NcaMatrix", "The coefficients of the matrix that need to be optimized. Note that the matrix is flattened."));
-      Parameters.Add(new LookupParameter<Scaling>("Scaling", "Each dataset is scaled and the information is stored in a scaling object."));
     }
 
     public override IOperation Apply() {
       var problemData = ProblemDataParameter.ActualValue;
-      var scaling = new Scaling(problemData.Dataset, problemData.AllowedInputVariables, problemData.TrainingIndices);
 
       var dimensions = DimensionsParameter.ActualValue.Value;
-      var matrix = Initialize(problemData, scaling, dimensions);
+      var matrix = Initialize(problemData, dimensions);
       var attributes = matrix.GetLength(0);
 
@@ -70,10 +65,9 @@
           result[i * dimensions + j] = matrix[i, j];
 
-      ScalingParameter.ActualValue = scaling;
       NcaMatrixParameter.ActualValue = new RealVector(result);
       return base.Apply();
     }
 
-    public abstract double[,] Initialize(IClassificationProblemData data, Scaling scaling, int dimensions);
+    public abstract double[,] Initialize(IClassificationProblemData data, int dimensions);
   }
 }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/PcaInitializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/PcaInitializer.cs	(revision 9270)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/PcaInitializer.cs	(revision 9272)
@@ -40,9 +40,9 @@
     }
 
-    public override double[,] Initialize(IClassificationProblemData data, Scaling scaling, int dimensions) {
+    public override double[,] Initialize(IClassificationProblemData data, int dimensions) {
       var instances = data.TrainingIndices.Count();
       var attributes = data.AllowedInputVariables.Count();
 
-      var pcaDs = AlglibUtil.PrepareAndScaleInputMatrix(data.Dataset, data.AllowedInputVariables, data.TrainingIndices, scaling);
+      var pcaDs = AlglibUtil.PrepareInputMatrix(data.Dataset, data.AllowedInputVariables, data.TrainingIndices);
 
       int info;
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/RandomInitializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/RandomInitializer.cs	(revision 9270)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/RandomInitializer.cs	(revision 9272)
@@ -48,5 +48,5 @@
     }
 
-    public override double[,] Initialize(IClassificationProblemData data, Scaling scaling, int dimensions) {
+    public override double[,] Initialize(IClassificationProblemData data, int dimensions) {
       var attributes = data.AllowedInputVariables.Count();
 
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/ModelCreation/NcaModelCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/ModelCreation/NcaModelCreator.cs	(revision 9270)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/ModelCreation/NcaModelCreator.cs	(revision 9272)
@@ -55,8 +55,4 @@
     }
 
-    public ILookupParameter<Scaling> ScalingParameter {
-      get { return (ILookupParameter<Scaling>)Parameters["Scaling"]; }
-    }
-
     public ILookupParameter<INcaModel> NcaModelParameter {
       get { return (ILookupParameter<INcaModel>)Parameters["NcaModel"]; }
@@ -72,5 +68,4 @@
       Parameters.Add(new LookupParameter<RealVector>("NcaMatrixGradients", "The gradients from the matrix that is being optimized."));
       Parameters.Add(new LookupParameter<IClassificationProblemData>("ProblemData", "The classification problem data."));
-      Parameters.Add(new LookupParameter<Scaling>("Scaling", "The scaling of the dataset."));
       Parameters.Add(new LookupParameter<INcaModel>("NcaModel", "The NCA model that should be created."));
     }
@@ -91,7 +86,6 @@
         }
 
-      var scaling = ScalingParameter.ActualValue;
       var problemData = ProblemDataParameter.ActualValue;
-      NcaModelParameter.ActualValue = new NcaModel(k, matrix, problemData.Dataset, problemData.TrainingIndices, problemData.TargetVariable, problemData.AllowedInputVariables, scaling, problemData.ClassValues.ToArray());
+      NcaModelParameter.ActualValue = new NcaModel(k, matrix, problemData.Dataset, problemData.TrainingIndices, problemData.TargetVariable, problemData.AllowedInputVariables, problemData.ClassValues.ToArray());
       return base.Apply();
     }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/NcaGradientCalculator.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/NcaGradientCalculator.cs	(revision 9270)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/NcaGradientCalculator.cs	(revision 9272)
@@ -65,8 +65,4 @@
       get { return (ILookupParameter<IClassificationProblemData>)Parameters["ProblemData"]; }
     }
-
-    public ILookupParameter<Scaling> ScalingParameter {
-      get { return (ILookupParameter<Scaling>)Parameters["Scaling"]; }
-    }
     #endregion
 
@@ -83,5 +79,4 @@
       Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the current matrix."));
       Parameters.Add(new LookupParameter<IClassificationProblemData>("ProblemData", "The classification problem data."));
-      Parameters.Add(new LookupParameter<Scaling>("Scaling", "The scaling of the dataset."));
     }
 
@@ -92,5 +87,4 @@
     public override IOperation Apply() {
       var problemData = ProblemDataParameter.ActualValue;
-      var scaling = ScalingParameter.ActualValue;
       var dimensions = DimensionsParameter.ActualValue.Value;
       var neighborSamples = NeighborSamplesParameter.ActualValue.Value;
@@ -104,6 +98,6 @@
       }
 
-      var data = AlglibUtil.PrepareAndScaleInputMatrix(problemData.Dataset, problemData.AllowedInputVariables,
-                                                       problemData.TrainingIndices, scaling);
+      var data = AlglibUtil.PrepareInputMatrix(problemData.Dataset, problemData.AllowedInputVariables,
+                                               problemData.TrainingIndices);
       var classes = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).ToArray();
 
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/NcaModel.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/NcaModel.cs	(revision 9270)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/NcaModel.cs	(revision 9272)
@@ -33,6 +33,4 @@
 
     [Storable]
-    private Scaling scaling;
-    [Storable]
     private double[,] transformationMatrix;
     public double[,] TransformationMatrix {
@@ -52,5 +50,4 @@
     protected NcaModel(NcaModel original, Cloner cloner)
       : base(original, cloner) {
-      this.scaling = cloner.Clone(original.scaling);
       this.transformationMatrix = (double[,])original.transformationMatrix.Clone();
       this.allowedInputVariables = (string[])original.allowedInputVariables.Clone();
@@ -59,8 +56,7 @@
       this.classValues = (double[])original.classValues.Clone();
     }
-    public NcaModel(int k, double[,] transformationMatrix, Dataset dataset, IEnumerable<int> rows, string targetVariable, IEnumerable<string> allowedInputVariables, Scaling scaling, double[] classValues) {
+    public NcaModel(int k, double[,] transformationMatrix, Dataset dataset, IEnumerable<int> rows, string targetVariable, IEnumerable<string> allowedInputVariables, double[] classValues) {
       Name = ItemName;
       Description = ItemDescription;
-      this.scaling = scaling;
       this.transformationMatrix = (double[,])transformationMatrix.Clone();
       this.allowedInputVariables = allowedInputVariables.ToArray();
@@ -90,11 +86,12 @@
 
     public double[,] Reduce(Dataset dataset, IEnumerable<int> rows) {
-      var scaledData = AlglibUtil.PrepareAndScaleInputMatrix(dataset, allowedInputVariables, rows, scaling);
+      var data = AlglibUtil.PrepareInputMatrix(dataset, allowedInputVariables, rows);
+
       var targets = dataset.GetDoubleValues(targetVariable, rows).ToArray();
-      var result = new double[scaledData.GetLength(0), transformationMatrix.GetLength(1) + 1];
-      for (int i = 0; i < scaledData.GetLength(0); i++)
-        for (int j = 0; j < scaledData.GetLength(1); j++) {
+      var result = new double[data.GetLength(0), transformationMatrix.GetLength(1) + 1];
+      for (int i = 0; i < data.GetLength(0); i++)
+        for (int j = 0; j < data.GetLength(1); j++) {
           for (int x = 0; x < transformationMatrix.GetLength(1); x++) {
-            result[i, x] += scaledData[i, j] * transformationMatrix[j, x];
+            result[i, x] += data[i, j] * transformationMatrix[j, x];
           }
           result[i, transformationMatrix.GetLength(1)] = targets[i];
