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("ClassificationEnsembleProblemData", "Represents an item containing all data defining a classification problem.")]
|
---|
35 | public class ClassificationEnsembleProblemData : ClassificationProblemData {
|
---|
36 |
|
---|
37 | public override IEnumerable<int> TrainingIndizes {
|
---|
38 | get {
|
---|
39 | return Enumerable.Range(TrainingPartition.Start, TestPartition.End - TestPartition.Start);
|
---|
40 | }
|
---|
41 | }
|
---|
42 | public override IEnumerable<int> TestIndizes {
|
---|
43 | get {
|
---|
44 | return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start);
|
---|
45 | }
|
---|
46 | }
|
---|
47 |
|
---|
48 | [StorableConstructor]
|
---|
49 | protected ClassificationEnsembleProblemData(bool deserializing) : base(deserializing) { }
|
---|
50 |
|
---|
51 | protected ClassificationEnsembleProblemData(ClassificationEnsembleProblemData original, Cloner cloner)
|
---|
52 | : base(original, cloner) {
|
---|
53 | }
|
---|
54 | public override IDeepCloneable Clone(Cloner cloner) { return new ClassificationEnsembleProblemData(this, cloner); }
|
---|
55 |
|
---|
56 | public ClassificationEnsembleProblemData(IClassificationProblemData classificationProblemData)
|
---|
57 | : base(classificationProblemData.Dataset, classificationProblemData.AllowedInputVariables, classificationProblemData.TargetVariable) {
|
---|
58 | this.TrainingPartition.Start = classificationProblemData.TrainingPartition.Start;
|
---|
59 | this.TrainingPartition.End = classificationProblemData.TrainingPartition.End;
|
---|
60 | this.TestPartition.Start = classificationProblemData.TestPartition.Start;
|
---|
61 | this.TestPartition.End = classificationProblemData.TestPartition.End;
|
---|
62 | }
|
---|
63 | }
|
---|
64 | }
|
---|