Ignore:
Timestamp:
04/19/19 13:06:11 (4 months ago)
Author:
gkronber
Message:

#2847: made some minor changes while reviewing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/LeafModels/PreconstructedLinearModel.cs

    r15967 r16847  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Diagnostics;
    2524using System.Linq;
    2625using HeuristicLab.Common;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2826using HeuristicLab.Problems.DataAnalysis;
     27using HEAL.Attic;
    2928
    3029namespace HeuristicLab.Algorithms.DataAnalysis {
    3130  //mulitdimensional extension of http://www2.stat.duke.edu/~tjl13/s101/slides/unit6lec3H.pdf
    32   [StorableClass]
     31  [StorableType("15F2295C-28C1-48C3-8DCB-9470823C6734")]
    3332  internal sealed class PreconstructedLinearModel : RegressionModel {
    3433    [Storable]
     
    4039      get { return Coefficients.Keys; }
    4140    }
     41
    4242    #region HLConstructors
    4343    [StorableConstructor]
    44     private PreconstructedLinearModel(bool deserializing) : base(deserializing) { }
     44    private PreconstructedLinearModel(StorableConstructorFlag _) : base(_) { }
    4545    private PreconstructedLinearModel(PreconstructedLinearModel original, Cloner cloner) : base(original, cloner) {
    4646      if (original.Coefficients != null) Coefficients = original.Coefficients.ToDictionary(x => x.Key, x => x.Value);
     
    4848    }
    4949    public PreconstructedLinearModel(Dictionary<string, double> coefficients, double intercept, string targetvariable) : base(targetvariable) {
    50       Coefficients = coefficients;
     50      Coefficients = new Dictionary<string, double>(coefficients);
    5151      Intercept = intercept;
    5252    }
     
    117117      alglib.spdmatrixcholeskysolve(aTa, n + 1, true, aTyVector, out info, out report, out coefficients);
    118118
    119       //if cholesky calculation fails fall bakc to classic linear regresseion
     119      //if cholesky calculation fails fall back to classic linear regresseion
    120120      if (info != 1) {
    121121        alglib.linearmodel lm;
Note: See TracChangeset for help on using the changeset viewer.