Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/05/12 11:58:17 (12 years ago)
Author:
mkommend
Message:

#1081: Merged trunk changes and fixed compilation errors due to the merge.

Location:
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs

    r8458 r8742  
    5555
    5656    public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
    57       return new ConstantRegressionSolution(this, problemData);
     57      return new ConstantRegressionSolution(this, new RegressionProblemData(problemData));
    5858    }
    5959  }
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs

    r7268 r8742  
    102102
    103103    public RegressionEnsembleSolution CreateRegressionSolution(IRegressionProblemData problemData) {
    104       return new RegressionEnsembleSolution(this.Models, problemData);
     104      return new RegressionEnsembleSolution(this.Models, new RegressionEnsembleProblemData(problemData));
    105105    }
    106106    IRegressionSolution IRegressionModel.CreateRegressionSolution(IRegressionProblemData problemData) {
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs

    r8458 r8742  
    3636  [Item("Regression Ensemble Solution", "A regression solution that contains an ensemble of multiple regression models")]
    3737  [Creatable("Data Analysis - Ensembles")]
    38   public sealed class RegressionEnsembleSolution : RegressionSolution, IRegressionEnsembleSolution {
     38  public sealed class RegressionEnsembleSolution : RegressionSolutionBase, IRegressionEnsembleSolution {
    3939    private readonly Dictionary<int, double> trainingEvaluationCache = new Dictionary<int, double>();
    4040    private readonly Dictionary<int, double> testEvaluationCache = new Dictionary<int, double>();
     41    private readonly Dictionary<int, double> evaluationCache = new Dictionary<int, double>();
    4142
    4243    public new IRegressionEnsembleModel Model {
     
    156157
    157158    #region Evaluation
     159    public override IEnumerable<double> EstimatedValues {
     160      get { return GetEstimatedValues(Enumerable.Range(0, ProblemData.Dataset.Rows)); }
     161    }
     162
    158163    public override IEnumerable<double> EstimatedTrainingValues {
    159164      get {
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r8430 r8742  
    121121      : this(defaultDataset, defaultAllowedInputVariables, defaultTargetVariable) {
    122122    }
     123    public RegressionProblemData(IRegressionProblemData regressionProblemData)
     124      : this(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable) {
     125      TrainingPartition.Start = regressionProblemData.TrainingPartition.Start;
     126      TrainingPartition.End = regressionProblemData.TrainingPartition.End;
     127      TestPartition.Start = regressionProblemData.TestPartition.Start;
     128      TestPartition.End = regressionProblemData.TestPartition.End;
     129    }
    123130
    124131    public RegressionProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable)
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs

    r8458 r8742  
    4545      : base(model, problemData) {
    4646      evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows);
     47      CalculateRegressionResults();
    4748    }
     49
    4850
    4951    public override IEnumerable<double> EstimatedValues {
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs

    r8468 r8742  
    178178
    179179    protected override void RecalculateResults() {
    180       CalculateResults();
    181     }
    182 
    183     private void CalculateResults() {
     180      CalculateRegressionResults();
     181    }
     182
     183    protected void CalculateRegressionResults() {
    184184      IEnumerable<double> estimatedTrainingValues = EstimatedTrainingValues; // cache values
    185185      IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices);
Note: See TracChangeset for help on using the changeset viewer.