Free cookie consent management tool by TermsFeed Policy Generator

source: branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleProblemData.cs @ 6284

Last change on this file since 6284 was 6239, checked in by gkronber, 13 years ago

#1450: implemented support for ensemble solutions for classification.

File size: 2.7 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("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}
Note: See TracBrowser for help on using the repository browser.