using System.Linq; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Problems.DataAnalysis; namespace HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard { public partial class TargetVariablePage : HeuristicLab.ExperimentGeneration.DataAnalysis.Wizard.WizardPage { private RegressionProblemData problem; private DataAnalysisWizardContext context; public DataAnalysisWizardContext Context { get { return context; } } public TargetVariablePage(DataAnalysisWizardContext context) { InitializeComponent(); this.context = context; } private void ProblemDataViewPage_WizardNext(object sender, Wizard.WizardPageEventArgs e) { StringValue selectedValue = problem.TargetVariableParameter.ValidValues.FirstOrDefault(x => x.Value == (string)cmbTargetVariable.SelectedItem); problem.TargetVariableParameter.Value = selectedValue; } private void ProblemDataViewPage_SetActive(object sender, System.ComponentModel.CancelEventArgs e) { cmbTargetVariable.Items.Clear(); problem = (RegressionProblemData)Context.Problem.ProblemData; ItemSet targetValues = problem.TargetVariableParameter.ValidValues; foreach (StringValue value in targetValues) { cmbTargetVariable.Items.Add(value.Value); } cmbTargetVariable.SelectedItem = problem.TargetVariable; stringConvertibleMatrixView.Content = Context.Problem.ProblemData.Dataset; SetWizardButton(Wizard.WizardButtons.Next); } } }