Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/RegressionProblem.cs @ 3257

Last change on this file since 3257 was 3253, checked in by gkronber, 14 years ago

Implemented basic framework for symbolic regression problems for HL 3.3. #938 (Data types and operators for regression problems)

File size: 4.9 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 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 HeuristicLab.Core;
26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
27using HeuristicLab.Parameters;
28using HeuristicLab.Data;
29using HeuristicLab.Optimization;
30using HeuristicLab.Problems.DataAnalysis;
31using System.Drawing;
32
33namespace HeuristicLab.Problems.DataAnalysis.Regression {
34  [Item("RegressionProblem", "Represents a regression problem.")]
35  [Creatable("Problems")]
36  [StorableClass]
37  public class RegressionProblem : ParameterizedNamedItem {
38    public override Image ItemImage {
39      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; }
40    }
41
42    #region Parameter Properties
43    public ValueParameter<Dataset> DatasetParameter {
44      get { return (ValueParameter<Dataset>)Parameters["Dataset"]; }
45    }
46    public ValueParameter<StringValue> TargetVariableParameter {
47      get { return (ValueParameter<StringValue>)Parameters["TargetVariable"]; }
48    }
49    public ValueParameter<ItemList<StringValue>> InputVariablesParameter {
50      get { return (ValueParameter<ItemList<StringValue>>)Parameters["InputVariables"]; }
51    }
52    public ValueParameter<IntValue> TrainingSamplesStartParameter {
53      get { return (ValueParameter<IntValue>)Parameters["TrainingSamplesStart"]; }
54    }
55    public ValueParameter<IntValue> TrainingSamplesEndParameter {
56      get { return (ValueParameter<IntValue>)Parameters["TrainingSamplesEnd"]; }
57    }
58    public OptionalValueParameter<IntValue> ValidationSamplesStartParameter {
59      get { return (OptionalValueParameter<IntValue>)Parameters["ValidationSamplesStart"]; }
60    }
61    public OptionalValueParameter<IntValue> ValidationSamplesEndParameter {
62      get { return (OptionalValueParameter<IntValue>)Parameters["ValidationSamplesEnd"]; }
63    }
64    public ValueParameter<IntValue> TestSamplesStartParameter {
65      get { return (ValueParameter<IntValue>)Parameters["TestSamplesStart"]; }
66    }
67    public ValueParameter<IntValue> TestSamplesEndParameter {
68      get { return (ValueParameter<IntValue>)Parameters["TestSamplesEnd"]; }
69    }
70    #endregion
71
72    public RegressionProblem()
73      : base() {
74      var dataset = new Dataset();
75      // TODO: wiring for sanity checks of parameter values based on dataset (target & input variables available?, training and test partition correct?...)
76      Parameters.Add(new ValueParameter<Dataset>("Dataset", "The data set containing data to be analyzer.", dataset));
77      Parameters.Add(new ValueParameter<StringValue>("TargetVariable", "The target variable for which a regression model should be created.", new StringValue()));
78      Parameters.Add(new ValueParameter<ItemList<StringValue>>("InputVariables", "The input variables (regressors) that are available for the regression model.", new ItemList<StringValue>()));
79      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesStart", "The start index of the training partition.", new IntValue()));
80      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesEnd", "The end index of the training partition.", new IntValue()));
81      Parameters.Add(new OptionalValueParameter<IntValue>("ValidationSamplesStart", "The start index of the validation partition."));
82      Parameters.Add(new OptionalValueParameter<IntValue>("ValidationSamplesEnd", "The end index of the validation partition."));
83      Parameters.Add(new ValueParameter<IntValue>("TestSamplesStart", "The start index of the test partition.", new IntValue()));
84      Parameters.Add(new ValueParameter<IntValue>("TestSamplesEnd", "The end index of the test partition.", new IntValue()));
85    }
86
87    [StorableConstructor]
88    private RegressionProblem(bool deserializing) : base() { }
89
90    #region ISingleObjectiveProblem Members
91
92    public IParameter MaximizationParameter {
93      get { throw new NotImplementedException(); }
94    }
95
96    public IParameter BestKnownQualityParameter {
97      get { throw new NotImplementedException(); }
98    }
99
100    public ISingleObjectiveEvaluator Evaluator {
101      get { throw new NotImplementedException(); }
102    }
103
104    #endregion
105  }
106}
Note: See TracBrowser for help on using the repository browser.