Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/23/18 08:06:56 (6 years ago)
Author:
gkronber
Message:

#2892: changed LR to produce two solutions: symbolic representation and solution with prediction intervals.

It is not straight-forward to implement the model with prediction intervals as a symbolic regression model.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegressionModel.cs

    r16415 r16448  
    4949      get; private set;
    5050    }
    51    
     51
    5252    public override IEnumerable<string> VariablesUsedForPrediction {
    5353      get { return allowedInputVariables.Union(factorVariables.Select(f => f.Key)); }
     
    7878      this.W = new double[w.Length];
    7979      Array.Copy(w, W, w.Length);
    80       this.C = new double[covariance.GetLength(0),covariance.GetLength(1)];
     80      this.C = new double[covariance.GetLength(0), covariance.GetLength(1)];
    8181      Array.Copy(covariance, C, covariance.Length);
    8282      this.NoiseSigma = noiseSigma;
     
    123123
    124124      double[] d = new double[C.GetLength(0)];
    125      
     125
    126126      for (int row = 0; row < n; row++) {
    127127        for (int column = 0; column < columns; column++) {
    128           d[column] = inputData[row,column];
     128          d[column] = inputData[row, column];
    129129        }
    130130        d[columns] = 1;
    131131
    132132        double var = 0.0;
    133         for(int i=0;i<d.Length;i++) {
    134           for(int j = 0;j<d.Length;j++) {
     133        for (int i = 0; i < d.Length; i++) {
     134          for (int j = 0; j < d.Length; j++) {
    135135            var += d[i] * C[i, j] * d[j];
    136136          }
    137137        }
    138         yield return var + NoiseSigma*NoiseSigma;
     138        yield return var + NoiseSigma * NoiseSigma;
    139139      }
    140140    }
    141 
    142141
    143142    public override IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
Note: See TracChangeset for help on using the changeset viewer.