Opened 5 years ago

Closed 3 years ago

#1763 closed feature request (done)

Support changing of constants and variable weights in the simplifier for symbolic data analysis models

Reported by: bburlacu Owned by: mkommend
Priority: medium Milestone: HeuristicLab 3.3.10
Component: Problems.DataAnalysis.Symbolic.Views Version: branch
Keywords: Cc:

Description (last modified by bburlacu)

The SymbolicDataAnalysisExpressionTreeSimplifier should offer users the possibility of interactively changing constant values or variable weights.

Additionally, the tree model in the simplifier view should support the following operations:

  • inserting an intermediate symbol between two nodes (ideally by selection or drag&drop from the available grammar)
  • removing nodes/sub-trees (removing intermediate symbols or whole branches)
  • "moving" nodes/sub-trees (manual simplification/collapsing or just some kind of copy/paste operation)

Change History (64)

comment:1 Changed 5 years ago by bburlacu

r7361: Updated project references, added build and solution files.

comment:2 Changed 5 years ago by bburlacu

  • Status changed from new to accepted

r7388: Added a new context option for leaf nodes (ConstantTreeNode or VariableTreeNode) to change the value or variable weight respectively.

  • Added new dialog: SymbolicExpressionTreeNodeChangeValueDialog
  • Added new SymbolicExpressionTreeNodeChanged event and handler
  • Changed the double click behavior to account for node value/weight changes

Overall the behavior has been slightly changed: if a node was folded(replaced by a ConstantTreeNode), then it is possible to change its value via the context menu. For all changed nodes the original value is kept in a dictionary, so the first double click will restore it. After that, a second double click will unfold the node.

comment:3 Changed 5 years ago by bburlacu

  • Owner changed from bburlacu to mkommend
  • Status changed from accepted to reviewing

comment:4 Changed 5 years ago by bburlacu

r7411: Improved ValueChangeDialog and overall behavior. Implemented pruning operation on background thread. TODO: Test, improve. This is a work-in-progress.

comment:5 Changed 5 years ago by bburlacu

r7422: The simplifier view now uses a clone of the current model, on which the actual simplification or tree pruning is applied. This fixes a crash when the user clicks on the Symbolic Regression Model while the background thread is pruning the tree (because it was trying to display the tree while it was being changed). Also took out the display part from the CalculateReplacementNodesAndNodeImpacts method and put it in a separate method.

comment:6 Changed 5 years ago by gkronber

  • Summary changed from Improve SymbolicDataAnalysisExpressionTreeSimplifier to Support changing of constants and variable weights in the simplifier for symbolic data analysis models

comment:7 Changed 5 years ago by bburlacu

  • Description modified (diff)
  • Owner changed from mkommend to bburlacu
  • Status changed from reviewing to assigned

comment:8 Changed 5 years ago by bburlacu

r7784: Moved replacement and impact values calculation code from view to separate files. Implemented simplifier actions: copy, cut, delete, insert node/subtree.

comment:9 Changed 5 years ago by gkronber

In this ticket there are no commits on the trunk. Should we move it to milestone 3.3.8?

comment:10 Changed 5 years ago by gkronber

  • Owner changed from bburlacu to mkommend
  • Status changed from assigned to reviewing

comment:11 Changed 5 years ago by mkommend

  • Milestone changed from HeuristicLab 3.3.7 to HeuristicLab 3.3.8

comment:12 Changed 5 years ago by abeham

  • Version changed from 3.3.6 to branch

comment:13 Changed 5 years ago by mkommend

  • Owner changed from mkommend to bburlacu
  • Status changed from reviewing to assigned

comment:14 Changed 5 years ago by bburlacu

  • Owner changed from bburlacu to mkommend
  • Status changed from assigned to reviewing

r8388: Rebranched the TreeSimplifier project to fix merging errors. Added functionality to insert symbols into the tree, fixed bug when deleting tree nodes.

comment:15 Changed 5 years ago by mkommend

r8390: Removed outdated branch HeuristicLab.TreeSimplifierView.

comment:16 Changed 5 years ago by mkommend

r8391: Removed unnecessary Plugin.cs files from repository.

comment:17 Changed 5 years ago by mkommend

r8392: Merged trunk changes into HeuristicLab.TreeSimplifier branch.

comment:18 Changed 5 years ago by mkommend

r8395: Removed unnecessary PreBuildEvent.cmd in projects.

Last edited 5 years ago by mkommend (previous) (diff)

comment:19 Changed 5 years ago by mkommend

  • Owner changed from mkommend to bburlacu
  • Status changed from reviewing to assigned

comment:20 Changed 5 years ago by mkommend

r8915: merged changes from trunk into the simplifier branch.

comment:21 Changed 5 years ago by bburlacu

r8916: Added HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views and HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views to the branch. Removed prune button, minor functionality improvements.

comment:22 Changed 5 years ago by mkommend

Review Comments:

  • The view flickers when the tree is modified.
  • Changing the variable / constant value does only react on enter (missing validated logic).
  • Changing the variable does only react on enter.
  • Remove the closing cross (upper right corner of the dialog) and add an OK and Cancel button.
  • Delete node results in an exception if the tree consists only of one node.
  • Add license header to all created source files
  • TreeEditDialogs
    • Do not use _ as prefix for private members
    • Remove properties which just change the name of a member (e.g., NewValueTextBox, Caption)
    • Do not call events directly. Always add OnEvent methods which include a null check before the event is called.
    • Use OnEventName methods for event firing instead of registering to an event
  • Use designer file for control configuration as much as possible (e.g., InteractiveSymbolicExpressionTreeChart context menu strip is configured in the ctor).
  • Get rid of DisableTreeEditingMenuItems in InteractiveSymbolicExpressionTreeChart (just do not open den context menu if no entries should be displayed).
  • Use using blocks for dialogs (e.g., using(var dialog = new Dialog())) for automatic disposing of allocated resources.
  • Implement / remove TODO entries and commented code.
  • Prepare the SymbolicExpressionTreeChart consistently for sub-classing.
  • Refactor impact value calculation.

comment:23 Changed 5 years ago by bburlacu

  • Owner changed from bburlacu to mkommend
  • Status changed from assigned to reviewing

r8935: Bugfixes and refactoring as suggested in the comments above.

comment:24 Changed 5 years ago by mkommend

r8937: Merged recent trunk changes into the branch.

Last edited 5 years ago by mkommend (previous) (diff)

comment:25 Changed 5 years ago by mkommend

r8942: Merged changes from TreeSimplifier branch to Encodings.symbolicExpressionTreeEncoding.Views.

comment:26 Changed 5 years ago by mkommend

r8946: Merged remaining changes from the TreeSimplifier branch in the trunk and refactored impact values calculators.

comment:27 Changed 5 years ago by mkommend

  • Owner changed from mkommend to bburlacu
  • Status changed from reviewing to assigned

comment:28 Changed 5 years ago by mkommend

r8947: Deleted obsolete tree node change dialog.

comment:29 Changed 5 years ago by mkommend

r8950: Forgot to update the corresponding project file in r8947.

comment:30 Changed 5 years ago by mkommend

r8960: Removed scaling in SymbolicRegressionSolutionImpactValuesCalculator as this does does not have any effect as long as the impact is calculated on the basis of the R².

comment:31 Changed 5 years ago by mkommend

  • Version changed from branch to 3.3.7

comment:32 Changed 5 years ago by bburlacu

r8980: Refactored the tree simplifier. Improved tree/node edit operations.

comment:33 Changed 5 years ago by bburlacu

  • Owner changed from bburlacu to mkommend
  • Status changed from assigned to reviewing

r8981: Forgot to set DialogResult in the InsertNodeDialog, fixed two omissions in the InteractiveSymbolicExpressionTreeChart.

comment:34 Changed 5 years ago by bburlacu

r8986: Surrounded disposable graphics objects with using blocks.

comment:35 Changed 5 years ago by mkommend

r8990: Minor improvements and code simplification in symbolic data analysis simplifier.

comment:36 Changed 5 years ago by bburlacu

r8991: Fixed bug when displaying an invalid tree. Simplified operation set and renamed actions (delete -> remove, edit -> change).

comment:37 Changed 5 years ago by bburlacu

r9006: Refactored the tree simplifier again: moved tree editing functionality into the view, fixed minor display bugs.

comment:38 Changed 5 years ago by mkommend

  • Owner changed from mkommend to bburlacu
  • Status changed from reviewing to assigned

comment:39 Changed 5 years ago by bburlacu

r9043: Fixed tree chart visual node coloring issues and some corner-case tree editing bugs.

comment:40 Changed 5 years ago by bburlacu

r9046: Removed branch since the changes have already been integrated into the trunk.

comment:41 Changed 5 years ago by bburlacu

r9052: Very minor change in the CalculateImpactValue method for symbolic regression (renamed internal variable).

comment:42 Changed 5 years ago by mkommend

r9055: Minor refactoring in tree simplifier and according views. Additionally model updates are displayed in the according views.

comment:43 Changed 5 years ago by bburlacu

r9056: Disabled paste option when attempting to cut/paste a subtree into itself.

comment:44 Changed 5 years ago by bburlacu

r9057: Fixed bug in subtree cut/paste introduced with previous commit, simplified code.

comment:45 Changed 5 years ago by mkommend

  • Owner changed from bburlacu to mkommend
  • Status changed from assigned to reviewing

comment:46 Changed 5 years ago by mkommend

  • Owner changed from mkommend to bburlacu
  • Status changed from reviewing to readytorelease

comment:47 Changed 4 years ago by bburlacu

  • Milestone changed from HeuristicLab 3.3.8 to HeuristicLab 3.3.x Backlog
  • Status changed from readytorelease to assigned

r9445: We found a bug in the InteractiveSymbolicDataAnalysisSolutionSimplifierView: when the user removes one of the linear scaling nodes from the tree (using the new tree editing functionality) then clicks optimize, an exception is raised by the constants optimizer.

We removed the tree editing functionality from the trunk, to be added again and fixed after the release.

comment:48 Changed 4 years ago by gkronber

Please accept this ticket before working on it.

comment:49 Changed 4 years ago by bburlacu

  • Status changed from assigned to accepted

comment:50 Changed 4 years ago by bburlacu

r9930: Removed empty unused folder in the HeuristicLab.Problems.DataAnalysis.Symbolic.Views project.

comment:51 Changed 3 years ago by gkronber

  • Owner changed from bburlacu to gkronber
  • Status changed from accepted to assigned

This seems to be almost ready for release. If possible we could plan to release these changes with 3.3.10.

comment:52 Changed 3 years ago by gkronber

  • Milestone changed from HeuristicLab 3.3.x Backlog to HeuristicLab 3.3.10
  • Status changed from assigned to accepted

comment:53 Changed 3 years ago by bburlacu

  • Owner changed from gkronber to bburlacu
  • Status changed from accepted to assigned

Branched this functionality into branches/HeuristicLab.InteractiveTreeSimplifier

comment:54 Changed 3 years ago by bburlacu

  • Owner changed from bburlacu to mkommend
  • Status changed from assigned to reviewing

r10957: Added a special arity check for multiplication and addition symbols that invalidates the tree when the node has less than 2 subtrees. Disabled right-hand side details box when the tree is invalid.

comment:55 Changed 3 years ago by bburlacu

r11010: Added solution containing the HeuristicLab.Problems.DataAnalysis.Symbolic.Views project. Updated folder structure. Added PreBuildEvent.cmd.

comment:56 Changed 3 years ago by mkommend

  • Version changed from 3.3.7 to branch

comment:57 Changed 3 years ago by bburlacu

r11086: Introduced tree editing functionality directly into the trunk code, with minor changes: simplified drawing (eg when highlighting subtrees from the clipboard), fixed small bug in MinArity function. The branch can be deleted.

comment:58 Changed 3 years ago by mkommend

r11101: Removed branch for interactive tree simplifier.

comment:59 Changed 3 years ago by mkommend

  • Owner changed from mkommend to bburlacu
  • Status changed from reviewing to assigned

The source code looks fine. However, there are three things that must be fixed before this ticket could be released:

  • The design of the insert / change node dialogs must be improved (spacing, ...)
  • It should not be possible to insert group symbols (e.g., terminals) in the tree. If a group symbol is chosen for insertion an exception is thrown.
  • The label for the tree status should only be displayed if the tree is invalid. Maybe it would be better to display it within the tree chart in the lower left corner.

comment:60 Changed 3 years ago by bburlacu

r11111: Improved alignment of node edit dialogs. Removed GroupSymbols from the list of available symbols when inserting new nodes. Added additional condition disallowing paste operations when it exceeds a symbols max arity. Moved tree status indicator to lower left and changed visibility to appear only when the tree is invalid.

comment:61 Changed 3 years ago by bburlacu

r11112: InteractiveSimplifierView: Fixed image resources in the designer file.

comment:62 Changed 3 years ago by bburlacu

  • Owner changed from bburlacu to mkommend
  • Status changed from assigned to reviewing

r11115: Fixed width of variable weight text box in the InsertNodeDialog.

comment:63 Changed 3 years ago by mkommend

  • Status changed from reviewing to readytorelease

r11123: Adapted size of tree chart in simplifier view.

comment:64 Changed 3 years ago by mkommend

  • Resolution set to done
  • Status changed from readytorelease to closed

r11150: Merged r9930, r11086, r11111, r11112, r11115, r11123 into stable (all other changes were already merged to the stable branch.

Note: See TracTickets for help on using tickets.