Changeset 17159


Ignore:
Timestamp:
07/23/19 20:33:58 (5 weeks ago)
Author:
gkronber
Message:

#2847: merged r16853, r16855, r16856, r16858, r17078, r17079:17085, r17139 from trunk to stable

Location:
stable
Files:
8 deleted
9 edited
2 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab 3.3.sln

    r17117 r17159  
    465465EndProject
    466466Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.ExactOptimization.Views-3.3", "HeuristicLab.ExactOptimization.Views\3.3\HeuristicLab.ExactOptimization.Views-3.3.csproj", "{D1D69043-17E6-4B8C-BF41-0799C7E56032}"
     467EndProject
     468Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.DataAnalysis.DecisionTrees-3.4", "HeuristicLab.Algorithms.DataAnalysis.DecisionTrees\3.4\HeuristicLab.Algorithms.DataAnalysis.DecisionTrees-3.4.csproj", "{541A53F3-E6A7-402F-91BB-D76041CDD9FD}"
    467469EndProject
    468470Global
     
    22602262    {D1D69043-17E6-4B8C-BF41-0799C7E56032}.Release|x64.Build.0 = Release|x64
    22612263    {D1D69043-17E6-4B8C-BF41-0799C7E56032}.Release|x86.ActiveCfg = Release|Any CPU
     2264    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     2265    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
     2266    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Debug|x64.ActiveCfg = Debug|Any CPU
     2267    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Debug|x64.Build.0 = Debug|Any CPU
     2268    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Debug|x86.ActiveCfg = Debug|Any CPU
     2269    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Debug|x86.Build.0 = Debug|Any CPU
     2270    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
     2271    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Release|Any CPU.Build.0 = Release|Any CPU
     2272    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Release|x64.ActiveCfg = Release|Any CPU
     2273    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Release|x64.Build.0 = Release|Any CPU
     2274    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Release|x86.ActiveCfg = Release|Any CPU
     2275    {541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Release|x86.Build.0 = Release|Any CPU
    22622276  EndGlobalSection
    22632277  GlobalSection(SolutionProperties) = preSolution
  • stable/HeuristicLab.Algorithms.DataAnalysis

  • stable/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/LeafBase.cs

    r17080 r17159  
    112112    public class LeafBuildingState : Item {
    113113      [Storable]
    114       public Queue<RegressionNodeModel> nodeQueue = new Queue<RegressionNodeModel>();
     114      private RegressionNodeModel[] storableNodeQueue { get { return nodeQueue.ToArray(); } set { nodeQueue = new Queue<RegressionNodeModel>(value); } }
     115      public Queue<RegressionNodeModel> nodeQueue;
    115116      [Storable]
    116       public Queue<IReadOnlyList<int>> trainingRowsQueue = new Queue<IReadOnlyList<int>>();
     117      private IReadOnlyList<int>[] storabletrainingRowsQueue { get { return trainingRowsQueue.ToArray(); } set { trainingRowsQueue = new Queue<IReadOnlyList<int>>(value); } }
     118      public Queue<IReadOnlyList<int>> trainingRowsQueue;
    117119
    118120      //State.Code values denote the current action (for pausing)
     
    130132        Code = original.Code;
    131133      }
    132       public LeafBuildingState() { }
     134      public LeafBuildingState() {
     135        nodeQueue = new Queue<RegressionNodeModel>();
     136        trainingRowsQueue = new Queue<IReadOnlyList<int>>();
     137      }
    133138      public override IDeepCloneable Clone(Cloner cloner) {
    134139        return new LeafBuildingState(this, cloner);
  • stable/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Pruning/ComplexityPruning.cs

    r17080 r17159  
    204204    public class PruningState : Item {
    205205      [Storable]
    206       public IDictionary<RegressionNodeModel, int> modelComplexities = new Dictionary<RegressionNodeModel, int>();
    207       [Storable]
    208       public IDictionary<RegressionNodeModel, int> nodeComplexities = new Dictionary<RegressionNodeModel, int>();
    209       [Storable]
    210       public IDictionary<RegressionNodeModel, int> pruningSizes = new Dictionary<RegressionNodeModel, int>();
    211       [Storable]
    212       public IDictionary<RegressionNodeModel, double> modelErrors = new Dictionary<RegressionNodeModel, double>();
    213 
    214       [Storable]
    215       public Queue<RegressionNodeModel> nodeQueue = new Queue<RegressionNodeModel>();
    216       [Storable]
    217       public Queue<IReadOnlyList<int>> trainingRowsQueue = new Queue<IReadOnlyList<int>>();
    218       [Storable]
    219       public Queue<IReadOnlyList<int>> pruningRowsQueue = new Queue<IReadOnlyList<int>>();
     206      public IDictionary<RegressionNodeModel, int> modelComplexities;
     207      [Storable]
     208      public IDictionary<RegressionNodeModel, int> nodeComplexities;
     209      [Storable]
     210      public IDictionary<RegressionNodeModel, int> pruningSizes;
     211      [Storable]
     212      public IDictionary<RegressionNodeModel, double> modelErrors;
     213
     214      [Storable]
     215      private RegressionNodeModel[] storableNodeQueue { get { return nodeQueue.ToArray(); } set { nodeQueue = new Queue<RegressionNodeModel>(value); } }
     216      public Queue<RegressionNodeModel> nodeQueue;
     217      [Storable]
     218      private IReadOnlyList<int>[] storabletrainingRowsQueue { get { return trainingRowsQueue.ToArray(); } set { trainingRowsQueue = new Queue<IReadOnlyList<int>>(value); } }
     219      public Queue<IReadOnlyList<int>> trainingRowsQueue;
     220      [Storable]
     221      private IReadOnlyList<int>[] storablepruningRowsQueue { get { return pruningRowsQueue.ToArray(); } set { pruningRowsQueue = new Queue<IReadOnlyList<int>>(value); } }
     222      public Queue<IReadOnlyList<int>> pruningRowsQueue;
    220223
    221224      //State.Code values denote the current action (for pausing)
     
    242245        Code = original.Code;
    243246      }
    244       public PruningState() { }
     247      public PruningState() {
     248        modelComplexities = new Dictionary<RegressionNodeModel, int>();
     249        nodeComplexities = new Dictionary<RegressionNodeModel, int>();
     250        pruningSizes = new Dictionary<RegressionNodeModel, int>();
     251        modelErrors = new Dictionary<RegressionNodeModel, double>();
     252        nodeQueue = new Queue<RegressionNodeModel>();
     253        trainingRowsQueue = new Queue<IReadOnlyList<int>>();
     254        pruningRowsQueue = new Queue<IReadOnlyList<int>>();
     255      }
    245256      public override IDeepCloneable Clone(Cloner cloner) {
    246257        return new PruningState(this, cloner);
  • stable/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Splitting/SplitterBase.cs

    r17080 r17159  
    112112    [StorableType("BC1149FD-370E-4F3A-92F5-6E519736D09A")]
    113113    public class SplittingState : Item {
     114      public Queue<RegressionNodeModel> nodeQueue;
    114115      [Storable]
    115       public Queue<RegressionNodeModel> nodeQueue = new Queue<RegressionNodeModel>();
     116      private RegressionNodeModel[] storableNodeQueue {
     117        get { return nodeQueue.ToArray(); }
     118        set { nodeQueue = new Queue<RegressionNodeModel>(value); }
     119      }
     120
     121      public Queue<IReadOnlyList<int>> trainingRowsQueue;
    116122      [Storable]
    117       public Queue<IReadOnlyList<int>> trainingRowsQueue = new Queue<IReadOnlyList<int>>();
     123      private IReadOnlyList<int>[] storableTrainingRowsQueue {
     124        get { return trainingRowsQueue.ToArray(); }
     125        set { trainingRowsQueue = new Queue<IReadOnlyList<int>>(value); }
     126      }
     127
    118128
    119129      //State.Code values denote the current action (for pausing)
     
    131141        Code = original.Code;
    132142      }
    133       public SplittingState() { }
     143      public SplittingState() : base() {
     144        nodeQueue = new Queue<RegressionNodeModel>();
     145        trainingRowsQueue = new Queue<IReadOnlyList<int>>();
     146      }
    134147      public override IDeepCloneable Clone(Cloner cloner) {
    135148        return new SplittingState(this, cloner);
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/LinearModelToTreeConverter.cs

    r17097 r17159  
    3838      double @const = 0) {
    3939
    40       if (factorCoefficients.Length == 0 && coefficients.Length == 0) throw new ArgumentException();
     40      if (factorCoefficients.Length == 0 && coefficients.Length == 0 && @const==0) throw new ArgumentException();
     41
     42      // Combine both trees
     43      ISymbolicExpressionTreeNode add = (new Addition()).CreateTreeNode();
    4144
    4245      // Create tree for double variables
    43       ISymbolicExpressionTree tree = null;     
    4446      if (coefficients.Length > 0) {
    45         tree = CreateTree(variableNames, new int[variableNames.Length], coefficients, @const);
    46         if (factorCoefficients.Length == 0) return tree;
     47        var varTree = CreateTree(variableNames, new int[variableNames.Length], coefficients);
     48        foreach (var varNode in varTree.IterateNodesPrefix().OfType<VariableTreeNode>())
     49          add.AddSubtree(varNode);
    4750      }
    4851
    4952      // Create tree for string variables
    50       ISymbolicExpressionTree factorTree = null;     
    5153      if (factorCoefficients.Length > 0) {
    52         factorTree = CreateTree(factors, factorCoefficients, @const);
    53         if (tree == null) return factorTree; 
     54        var factorTree = CreateTree(factors, factorCoefficients);
     55        foreach (var binFactorNode in factorTree.IterateNodesPrefix().OfType<BinaryFactorVariableTreeNode>())
     56          add.AddSubtree(binFactorNode);
    5457      }
    5558
    56       // Combine both trees
    57       ISymbolicExpressionTreeNode add = tree.Root.GetSubtree(0).GetSubtree(0);
    58       foreach (var binFactorNode in factorTree.IterateNodesPrefix().OfType<BinaryFactorVariableTreeNode>())
    59         add.InsertSubtree(add.SubtreeCount - 1, binFactorNode);
     59      if (@const!=0.0) {
     60        ConstantTreeNode cNode = (ConstantTreeNode)new Constant().CreateTreeNode();
     61        cNode.Value = @const;
     62        add.AddSubtree(cNode);
     63      }
     64
     65      ISymbolicExpressionTree tree = new SymbolicExpressionTree(new ProgramRootSymbol().CreateTreeNode());
     66      ISymbolicExpressionTreeNode startNode = new StartSymbol().CreateTreeNode();
     67      tree.Root.AddSubtree(startNode);
     68      startNode.AddSubtree(add);
    6069      return tree;
    61 
    62       throw new ArgumentException();
    6370    }
    6471
Note: See TracChangeset for help on using the changeset viewer.