Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12321


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

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

Location:
branches/HeuristicLab.VariableInteractionNetworks
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/VariableInteractionNetworkView.cs

    r12320 r12321  
    148148            var variableNames = (from variableImpact in allVariableImpacts
    149149                                 from variableName in variableImpact.RowNames
    150                                  select variableName)
    151                                               .Distinct().ToArray();
     150                                 select variableName).Distinct().ToArray();
    152151
    153152            List<string> variableNamesList = (from variableName in variableNames
     
    189188        private DoubleMatrix UpdateAdjacencyMatrixByThreshold(double threshold, DoubleMatrix adjMatrix)
    190189        {
    191          //   var updatedMatrix = (DoubleMatrix) adjMatrix.Clone();
    192190            var originalMatrix = (DoubleMatrix)viewHost1.Content;
    193191            var groupRunCollection = Content.GroupBy(x => ((IRegressionProblemData)x.Parameters["ProblemData"]).TargetVariable).ToList();
  • 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.