Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/17/16 15:41:33 (8 years ago)
Author:
gkronber
Message:

#2697: reverse merge of r14378, r14390, r14391, r14393, r14394, r14396

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs

    r14393 r14400  
    165165      try {
    166166        CalculateModel(ds, rows, scaleInputs);
    167       } catch (alglib.alglibexception ae) {
     167      }
     168      catch (alglib.alglibexception ae) {
    168169        // wrap exception so that calling code doesn't have to know about alglib implementation
    169170        throw new ArgumentException("There was a problem in the calculation of the Gaussian process model", ae);
     
    259260    private static double[,] GetData(IDataset ds, IEnumerable<string> allowedInputs, IEnumerable<int> rows, Scaling scaling) {
    260261      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);
    273263      } else {
    274         return ds.ToArray(allowedInputs, rows);
     264        return AlglibUtil.PrepareInputMatrix(ds, allowedInputs, rows);
    275265      }
    276266    }
     
    344334        return Enumerable.Range(0, newN)
    345335          .Select(i => ms[i] + Util.ScalarProd(Ks[i], alpha));
    346       } catch (alglib.alglibexception ae) {
     336      }
     337      catch (alglib.alglibexception ae) {
    347338        // wrap exception so that calling code doesn't have to know about alglib implementation
    348339        throw new ArgumentException("There was a problem in the calculation of the Gaussian process model", ae);
     
    390381        }
    391382        return kss;
    392       } catch (alglib.alglibexception ae) {
     383      }
     384      catch (alglib.alglibexception ae) {
    393385        // wrap exception so that calling code doesn't have to know about alglib implementation
    394386        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.