Changeset 5275 for branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/LinearRegression
- Timestamp:
- 01/11/11 15:03:46 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/LinearRegression/LinearRegressionSolutionCreator.cs
r4082 r5275 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 26 27 using HeuristicLab.Data; … … 39 40 [Item("LinearRegressionSolutionCreator", "Uses linear regression to create a structure tree.")] 40 41 [StorableClass] 41 public class LinearRegressionSolutionCreator : SingleSuccessorOperator, ISolutionCreator {42 public sealed class LinearRegressionSolutionCreator : SingleSuccessorOperator, ISolutionCreator { 42 43 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; 43 44 private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData"; … … 45 46 private const string SamplesEndParameterName = "SamplesEnd"; 46 47 48 [StorableConstructor] 49 private LinearRegressionSolutionCreator(bool deserializing) : base(deserializing) { } 50 private LinearRegressionSolutionCreator(LinearRegressionSolutionCreator original, Cloner cloner) : base(original, cloner) { } 47 51 public LinearRegressionSolutionCreator() { 48 52 Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The resulting solution encoded as a symbolic expression tree.")); … … 51 55 Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The end of the samples on which the linear regression should be applied.")); 52 56 } 53 [StorableConstructor] 54 public LinearRegressionSolutionCreator(bool deserializing)55 : base(deserializing) {57 58 public override IDeepCloneable Clone(Cloner cloner) { 59 return new LinearRegressionSolutionCreator(this, cloner); 56 60 } 57 61 … … 107 111 108 112 int retVal = 1; 109 alglib.linreg.lrbuild( ref inputMatrix, nRows, nFeatures, ref retVal, ref lm, refar);113 alglib.linreg.lrbuild(inputMatrix, nRows, nFeatures, ref retVal, lm, ar); 110 114 if (retVal != 1) throw new ArgumentException("Error in calculation of linear regression model"); 111 115 rmsError = ar.rmserror;
Note: See TracChangeset
for help on using the changeset viewer.