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 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using System.IO;
|
---|
25 | using System.Linq;
|
---|
26 | using HeuristicLab.Common;
|
---|
27 | using HeuristicLab.Core;
|
---|
28 | using HeuristicLab.Data;
|
---|
29 | using HeuristicLab.Parameters;
|
---|
30 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
31 |
|
---|
32 | namespace 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 | }
|
---|