Free cookie consent management tool by TermsFeed Policy Generator

source: branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.TrentMcConaghy/3.4/TrentMcConaghy/TrentMcConaghyInstanceProvider.cs @ 7827

Last change on this file since 7827 was 7827, checked in by sforsten, 12 years ago

#1784: The branch has been prepared so that only the Trent McConaghy problem instance are in there. The problem instances are in an additional plugin and can be added to HeuristicLab anytime.

File size: 2.7 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2012 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.Linq;
25using System.Reflection;
26using System.Text.RegularExpressions;
27using HeuristicLab.Problems.DataAnalysis;
28
29namespace HeuristicLab.Problems.Instances.Regression.TrentMcConaghy {
30  public class TrentMcConaghyInstanceProvider : ResourceRegressionInstanceProvider {
31    public override string Name {
32      get { return "Trent McConaghy Benchmark Problems"; }
33    }
34    public override string Description {
35      get {
36        return "Paper: Deterministic Symbolic Regression Technology, Genetic Programming Theory and Practice IX" + Environment.NewLine
37          + "High-Dimensional Statistical Modeling and Analysis of Custom Integrated Circuits" + Environment.NewLine
38          + "Authors: T. McConaghy" + Environment.NewLine
39          + "Website: http://trent.st/ffx/";
40      }
41    }
42    public override Uri WebLink {
43      get { return new Uri("http://trent.st/ffx/"); }
44    }
45    public override string ReferencePublication {
46      get { return ""; }
47    }
48
49    protected override string FileName { get { return "TrentMcConaghy"; } }
50
51    public override IRegressionProblemData LoadData(IDataDescriptor id) {
52      IRegressionProblemData regData = base.LoadData(id);
53      string targetVar = regData.InputVariables.First().Value;
54      IEnumerable<string> allowedInputVars = regData.InputVariables.Where(x => !x.Equals(regData.TargetVariable)).Select(x => x.Value);
55      RegressionProblemData newRegData = new RegressionProblemData(regData.Dataset, allowedInputVars, targetVar);
56
57      return regData;
58    }
59
60    /**
61     * has to be overriden to get the ResourceName of this Assembly
62     */
63    protected override string GetResourceName(string fileName) {
64      return Assembly.GetExecutingAssembly().GetManifestResourceNames()
65              .Where(x => Regex.Match(x, @".*\.Data\." + fileName).Success).SingleOrDefault();
66    }
67  }
68}
Note: See TracBrowser for help on using the repository browser.