Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleProblemData.cs @ 6459

Last change on this file since 6459 was 6238, checked in by gkronber, 14 years ago

#1450 adapted views for regression solution to work for ensembles of regression solutions as well.

File size: 2.6 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.IO;
25using System.Linq;
26using HeuristicLab.Common;
27using HeuristicLab.Core;
28using HeuristicLab.Data;
29using HeuristicLab.Parameters;
30using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
31
32namespace HeuristicLab.Problems.DataAnalysis {
33  [StorableClass]
34  [Item("RegressionEnsembleProblemData", "Represents an item containing all data defining a regression problem.")]
35  public sealed class RegressionEnsembleProblemData : RegressionProblemData {
36
37    public override IEnumerable<int> TrainingIndizes {
38      get {
39        return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start);
40      }
41    }
42
43    public override IEnumerable<int> TestIndizes {
44      get {
45        return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start);
46      }
47    }
48
49    [StorableConstructor]
50    private RegressionEnsembleProblemData(bool deserializing) : base(deserializing) { }
51
52    private RegressionEnsembleProblemData(RegressionEnsembleProblemData original, Cloner cloner)
53      : base(original, cloner) {
54    }
55    public override IDeepCloneable Clone(Cloner cloner) { return new RegressionEnsembleProblemData(this, cloner); }
56
57    public RegressionEnsembleProblemData(IRegressionProblemData regressionProblemData)
58      : base(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable) {
59      TrainingPartition.Start = regressionProblemData.TrainingPartition.Start;
60      TrainingPartition.End = regressionProblemData.TrainingPartition.End;
61      TestPartition.Start = regressionProblemData.TestPartition.Start;
62      TestPartition.End = regressionProblemData.TestPartition.End;
63    }
64  }
65}
Note: See TracBrowser for help on using the repository browser.