Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/16/15 13:57:16 (9 years ago)
Author:
arapeanu
Message:

#2288: Modified CreateTargetVariationExperimentDialog.cs to exclude unchecked inputs from the target variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/CreateTargetVariationExperimentDialog.cs

    r12320 r12321  
    2525        public Experiment Experiment { get; private set; }
    2626        private int repetitions;
    27 
    28 
     27       
    2928        public CreateTargetVariationExperimentDialog() : this(null) { }
    3029        public CreateTargetVariationExperimentDialog(IAlgorithm alg)
     
    5150                throw new InvalidOperationException("Null algorithm!");
    5251
    53             var problem = algorithm.Problem;
    54             var regressionProblem = problem as IRegressionProblem;
     52            var regressionProblem = algorithm.Problem as IRegressionProblem;
    5553            if (regressionProblem == null)
    56                 throw new Exception();
     54                throw new InvalidOperationException("Null regression problem!!");
    5755
    5856            var problemData = regressionProblem.ProblemData;
    5957            var variables = problemData.InputVariables.ToList();
     58            int checksNo = 0;
    6059
    6160            for (int i = 0; i < variables.Count; i++)
    6261            {
     62                if (!problemData.InputVariables.ItemChecked(problemData.InputVariables[i]))
     63                    continue;
     64
    6365                var alg = (IAlgorithm)algorithm.Clone();
    6466                var pd = ((IRegressionProblem)alg.Problem).ProblemData;
     67                checksNo++;
    6568
    6669                // set target to false
    6770                pd.InputVariables.SetItemCheckedState(pd.InputVariables[i], false);
    68 
     71                   
    6972                pd.TargetVariable = pd.InputVariables[i].Value;
     73                   
    7074                alg.Name += "{Target variable=" + pd.TargetVariable + "}";
    7175
    72                 var batchrun = new BatchRun("Batchrun" + i)
     76                var batchrun = new BatchRun("Batchrun" + checksNo)
    7377                {
    7478                    Repetitions = repetitions,
Note: See TracChangeset for help on using the changeset viewer.