Changeset 13721 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions
- Timestamp:
- 03/23/16 16:19:04 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanConst.cs
r12012 r13721 76 76 } 77 77 78 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, IEnumerable<int>columnIndices) {78 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, int[] columnIndices) { 79 79 double c; 80 80 GetParameters(p, out c); -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanLinear.cs
r12012 r13721 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.Linq; 25 24 using HeuristicLab.Common; … … 70 69 } 71 70 72 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, IEnumerable<int>columnIndices) {71 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, int[] columnIndices) { 73 72 double[] weights; 74 int[] columns = columnIndices .ToArray();73 int[] columns = columnIndices; 75 74 GetParameter(p, out weights); 76 75 var mf = new ParameterizedMeanFunction(); … … 78 77 // sanity check 79 78 if (weights.Length != columns.Length) throw new ArgumentException("The number of rparameters must match the number of variables for the linear mean function."); 80 return Util.ScalarProd(weights, Util.GetRow(x, i, columns) );79 return Util.ScalarProd(weights, Util.GetRow(x, i, columns).ToArray()); 81 80 }; 82 81 mf.Gradient = (x, i, k) => { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanModel.cs
r13136 r13721 73 73 } 74 74 75 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, IEnumerable<int>columnIndices) {75 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, int[] columnIndices) { 76 76 if (p.Length > 0) throw new ArgumentException("No parameters allowed for model-based mean function.", "p"); 77 77 var solution = RegressionSolution; 78 78 var variableNames = solution.ProblemData.AllowedInputVariables.ToArray(); 79 if (variableNames.Length != columnIndices. Count())79 if (variableNames.Length != columnIndices.Length) 80 80 throw new ArgumentException("The number of input variables does not match in MeanModel"); 81 81 var variableValues = variableNames.Select(_ => new List<double>() { 0.0 }).ToArray(); // or of zeros -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanProduct.cs
r12012 r13721 73 73 74 74 75 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, IEnumerable<int>columnIndices) {75 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, int[] columnIndices) { 76 76 var factorMf = new List<ParameterizedMeanFunction>(); 77 77 int totalNumberOfParameters = GetNumberOfParameters(numberOfVariables); -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanSum.cs
r12012 r13721 68 68 } 69 69 70 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, IEnumerable<int>columnIndices) {70 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, int[] columnIndices) { 71 71 var termMf = new List<ParameterizedMeanFunction>(); 72 72 int totalNumberOfParameters = GetNumberOfParameters(numberOfVariables); -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanZero.cs
r12012 r13721 20 20 #endregion 21 21 using System; 22 using System.Collections.Generic;23 using System.Linq;24 22 using HeuristicLab.Common; 25 23 using HeuristicLab.Core; … … 50 48 } 51 49 52 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, IEnumerable<int>columnIndices) {50 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, int[] columnIndices) { 53 51 if (p.Length > 0) throw new ArgumentException("No parameters allowed for zero mean function.", "p"); 54 52 var mf = new ParameterizedMeanFunction();
Note: See TracChangeset
for help on using the changeset viewer.