Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/11/11 15:03:46 (14 years ago)
Author:
gkronber
Message:

Merged changes from trunk to data analysis exploration branch and added fractional distance metric evaluator. #1142

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/LinearRegression/LinearRegressionSolutionCreator.cs

    r4082 r5275  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    2627using HeuristicLab.Data;
     
    3940  [Item("LinearRegressionSolutionCreator", "Uses linear regression to create a structure tree.")]
    4041  [StorableClass]
    41   public class LinearRegressionSolutionCreator : SingleSuccessorOperator, ISolutionCreator {
     42  public sealed class LinearRegressionSolutionCreator : SingleSuccessorOperator, ISolutionCreator {
    4243    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
    4344    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
     
    4546    private const string SamplesEndParameterName = "SamplesEnd";
    4647
     48    [StorableConstructor]
     49    private LinearRegressionSolutionCreator(bool deserializing) : base(deserializing) { }
     50    private LinearRegressionSolutionCreator(LinearRegressionSolutionCreator original, Cloner cloner) : base(original, cloner) { }
    4751    public LinearRegressionSolutionCreator() {
    4852      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The resulting solution encoded as a symbolic expression tree."));
     
    5155      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The end of the samples on which the linear regression should be applied."));
    5256    }
    53     [StorableConstructor]
    54     public LinearRegressionSolutionCreator(bool deserializing)
    55       : base(deserializing) {
     57
     58    public override IDeepCloneable Clone(Cloner cloner) {
     59      return new LinearRegressionSolutionCreator(this, cloner);
    5660    }
    5761
     
    107111
    108112      int retVal = 1;
    109       alglib.linreg.lrbuild(ref inputMatrix, nRows, nFeatures, ref retVal, ref lm, ref ar);
     113      alglib.linreg.lrbuild(inputMatrix, nRows, nFeatures, ref retVal, lm, ar);
    110114      if (retVal != 1) throw new ArgumentException("Error in calculation of linear regression model");
    111115      rmsError = ar.rmserror;
Note: See TracChangeset for help on using the changeset viewer.