Changeset 15143


Ignore:
Timestamp:
07/06/17 11:13:51 (3 weeks ago)
Author:
gkronber
Message:

#2697: merged r14845, r14851, r14854

Location:
stable
Files:
4 edited

Legend:

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

    r15142 r15143  
    259259    private static double[,] GetData(IDataset ds, IEnumerable<string> allowedInputs, IEnumerable<int> rows, Scaling scaling) {
    260260      if (scaling != null) {
     261        // BackwardsCompatibility3.3
     262        #region Backwards compatible code, remove with 3.4
    261263        // 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);
     264        List<string> variablesList = allowedInputs.ToList();
     265        List<int> rowsList = rows.ToList();
     266
     267        double[,] matrix = new double[rowsList.Count, variablesList.Count];
     268
     269        int col = 0;
     270        foreach (string column in variablesList) {
     271          var values = scaling.GetScaledValues(ds, column, rowsList);
     272          int row = 0;
     273          foreach (var value in values) {
     274            matrix[row, col] = value;
     275            row++;
     276          }
     277          col++;
     278        }
     279        return matrix;
     280        #endregion
    273281      } else {
    274282        return ds.ToArray(allowedInputs, rows);
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs

    r15142 r15143  
    2727using HeuristicLab.Core;
    2828using HeuristicLab.Data;
    29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    3029using HeuristicLab.Optimization;
    3130using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs

    r14843 r15143  
    106106
    107107    // state for recursive transformation of trees
    108     private readonly List<string> variableNames;
    109     private readonly List<int> lags;
    110108    private readonly List<double> initialConstants;
    111109    private readonly Dictionary<DataForVariable, AutoDiff.Variable> parameters;
     
    115113    private TreeToAutoDiffTermConverter(bool makeVariableWeightsVariable) {
    116114      this.makeVariableWeightsVariable = makeVariableWeightsVariable;
    117       this.variableNames = new List<string>();
    118       this.lags = new List<int>();
    119115      this.initialConstants = new List<double>();
    120116      this.parameters = new Dictionary<DataForVariable, AutoDiff.Variable>();
  • stable/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeSimplifierTest.cs

    r15142 r15143  
    233233
    234234    private void AssertEqualAfterSimplification(string original, string expected) {
    235       var simplifier = new SymbolicDataAnalysisExpressionTreeSimplifier();
     235      var simplifier = new TreeSimplifier();
    236236      var formatter = new SymbolicExpressionTreeStringFormatter();
    237237      var importer = new SymbolicExpressionImporter();
Note: See TracChangeset for help on using the changeset viewer.