Changeset 9272 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/NcaInitializer.cs
- Timestamp:
- 03/04/13 15:16:49 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/Initialization/NcaInitializer.cs
r9270 r9272 43 43 get { return (ILookupParameter<RealVector>)Parameters["NcaMatrix"]; } 44 44 } 45 public ILookupParameter<Scaling> ScalingParameter {46 get { return (ILookupParameter<Scaling>)Parameters["Scaling"]; }47 }48 45 49 46 [StorableConstructor] … … 54 51 Parameters.Add(new LookupParameter<IntValue>("Dimensions", "The number of dimensions to which the features should be pruned.")); 55 52 Parameters.Add(new LookupParameter<RealVector>("NcaMatrix", "The coefficients of the matrix that need to be optimized. Note that the matrix is flattened.")); 56 Parameters.Add(new LookupParameter<Scaling>("Scaling", "Each dataset is scaled and the information is stored in a scaling object."));57 53 } 58 54 59 55 public override IOperation Apply() { 60 56 var problemData = ProblemDataParameter.ActualValue; 61 var scaling = new Scaling(problemData.Dataset, problemData.AllowedInputVariables, problemData.TrainingIndices);62 57 63 58 var dimensions = DimensionsParameter.ActualValue.Value; 64 var matrix = Initialize(problemData, scaling,dimensions);59 var matrix = Initialize(problemData, dimensions); 65 60 var attributes = matrix.GetLength(0); 66 61 … … 70 65 result[i * dimensions + j] = matrix[i, j]; 71 66 72 ScalingParameter.ActualValue = scaling;73 67 NcaMatrixParameter.ActualValue = new RealVector(result); 74 68 return base.Apply(); 75 69 } 76 70 77 public abstract double[,] Initialize(IClassificationProblemData data, Scaling scaling,int dimensions);71 public abstract double[,] Initialize(IClassificationProblemData data, int dimensions); 78 72 } 79 73 }
Note: See TracChangeset
for help on using the changeset viewer.