#region License Information
/* HeuristicLab
* Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
*
* This file is part of HeuristicLab.
*
* HeuristicLab is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* HeuristicLab is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with HeuristicLab. If not, see .
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using HeuristicLab.Core;
using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
using HeuristicLab.Parameters;
using HeuristicLab.Data;
using HeuristicLab.Optimization;
using HeuristicLab.Problems.DataAnalysis;
using System.Drawing;
namespace HeuristicLab.Problems.DataAnalysis.Regression {
[Item("RegressionProblem", "Represents a regression problem.")]
[Creatable("Problems")]
[StorableClass]
public class RegressionProblem : ParameterizedNamedItem {
public override Image ItemImage {
get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; }
}
#region Parameter Properties
public ValueParameter DatasetParameter {
get { return (ValueParameter)Parameters["Dataset"]; }
}
public ValueParameter TargetVariableParameter {
get { return (ValueParameter)Parameters["TargetVariable"]; }
}
public ValueParameter> InputVariablesParameter {
get { return (ValueParameter>)Parameters["InputVariables"]; }
}
public ValueParameter TrainingSamplesStartParameter {
get { return (ValueParameter)Parameters["TrainingSamplesStart"]; }
}
public ValueParameter TrainingSamplesEndParameter {
get { return (ValueParameter)Parameters["TrainingSamplesEnd"]; }
}
public OptionalValueParameter ValidationSamplesStartParameter {
get { return (OptionalValueParameter)Parameters["ValidationSamplesStart"]; }
}
public OptionalValueParameter ValidationSamplesEndParameter {
get { return (OptionalValueParameter)Parameters["ValidationSamplesEnd"]; }
}
public ValueParameter TestSamplesStartParameter {
get { return (ValueParameter)Parameters["TestSamplesStart"]; }
}
public ValueParameter TestSamplesEndParameter {
get { return (ValueParameter)Parameters["TestSamplesEnd"]; }
}
#endregion
public RegressionProblem()
: base() {
var dataset = new Dataset();
// TODO: wiring for sanity checks of parameter values based on dataset (target & input variables available?, training and test partition correct?...)
Parameters.Add(new ValueParameter("Dataset", "The data set containing data to be analyzer.", dataset));
Parameters.Add(new ValueParameter("TargetVariable", "The target variable for which a regression model should be created.", new StringValue()));
Parameters.Add(new ValueParameter>("InputVariables", "The input variables (regressors) that are available for the regression model.", new ItemList()));
Parameters.Add(new ValueParameter("TrainingSamplesStart", "The start index of the training partition.", new IntValue()));
Parameters.Add(new ValueParameter("TrainingSamplesEnd", "The end index of the training partition.", new IntValue()));
Parameters.Add(new OptionalValueParameter("ValidationSamplesStart", "The start index of the validation partition."));
Parameters.Add(new OptionalValueParameter("ValidationSamplesEnd", "The end index of the validation partition."));
Parameters.Add(new ValueParameter("TestSamplesStart", "The start index of the test partition.", new IntValue()));
Parameters.Add(new ValueParameter("TestSamplesEnd", "The end index of the test partition.", new IntValue()));
}
[StorableConstructor]
private RegressionProblem(bool deserializing) : base() { }
#region ISingleObjectiveProblem Members
public IParameter MaximizationParameter {
get { throw new NotImplementedException(); }
}
public IParameter BestKnownQualityParameter {
get { throw new NotImplementedException(); }
}
public ISingleObjectiveEvaluator Evaluator {
get { throw new NotImplementedException(); }
}
#endregion
}
}