- Timestamp:
- 11/17/16 15:41:33 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs
r14393 r14400 165 165 try { 166 166 CalculateModel(ds, rows, scaleInputs); 167 } catch (alglib.alglibexception ae) { 167 } 168 catch (alglib.alglibexception ae) { 168 169 // wrap exception so that calling code doesn't have to know about alglib implementation 169 170 throw new ArgumentException("There was a problem in the calculation of the Gaussian process model", ae); … … 259 260 private static double[,] GetData(IDataset ds, IEnumerable<string> allowedInputs, IEnumerable<int> rows, Scaling scaling) { 260 261 if (scaling != null) { 261 // TODO: completely remove Scaling class 262 List<ITransformation<double>> transformations = new List<ITransformation<double>>(); 263 264 foreach (var varName in allowedInputs) { 265 double min; 266 double max; 267 scaling.GetScalingParameters(varName, out min, out max); 268 var add = -min / (max - min); 269 var mult = 1.0 / (max - min); 270 transformations.Add(new LinearTransformation(allowedInputs) { Addend = add, Multiplier = mult }); 271 } 272 return ds.ToArray(allowedInputs, transformations, rows); 262 return AlglibUtil.PrepareAndScaleInputMatrix(ds, allowedInputs, rows, scaling); 273 263 } else { 274 return ds.ToArray(allowedInputs, rows);264 return AlglibUtil.PrepareInputMatrix(ds, allowedInputs, rows); 275 265 } 276 266 } … … 344 334 return Enumerable.Range(0, newN) 345 335 .Select(i => ms[i] + Util.ScalarProd(Ks[i], alpha)); 346 } catch (alglib.alglibexception ae) { 336 } 337 catch (alglib.alglibexception ae) { 347 338 // wrap exception so that calling code doesn't have to know about alglib implementation 348 339 throw new ArgumentException("There was a problem in the calculation of the Gaussian process model", ae); … … 390 381 } 391 382 return kss; 392 } catch (alglib.alglibexception ae) { 383 } 384 catch (alglib.alglibexception ae) { 393 385 // wrap exception so that calling code doesn't have to know about alglib implementation 394 386 throw new ArgumentException("There was a problem in the calculation of the Gaussian process model", ae);
Note: See TracChangeset
for help on using the changeset viewer.