-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/symbolic explanations #101
Conversation
…/symbolic-explanations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice overall and the tests are working 💪 I have some minor remarks. It would also be nice if you could run the pre-commit hooks so everything is formatted properly and address the errors in the new files (some minor things like missing docstring I think).
Also is it correct that I am getting DEBUG console output without changing any settings?
Furthermore, I am running into some problems running the plugin but maybe I am using it wrong. When I select the smac-pendigits run, the plugin does not seem to produce any explanations.
Server Log
SymbolicExplanations (DEBUG): Button pressed.
SymbolicExplanations (DEBUG): Enqueued SMAC-pendigits-015-0-0 (69666054159540351ed1f6fbf825f2cd).
RandomForestSurrogate (DEBUG): RandomForestSurrogate: Initial Seed = 0
RandomForestSurrogate (DEBUG): RandomForestSurrogate: Final Seed = 248400791
PDP (DEBUG): PDP: Initial Seed = 0
PDP (DEBUG): PDP: Final Seed = 1543538891
ICE (DEBUG): ICE: Initial Seed = True
ICE (DEBUG): ICE: Seed = Use existing
ICE (INFO): Recalculating ICE...
| Population Average | Best Individual |
---- ------------------------- ------------------------------------------ ----------
Gen Length Fitness Length Fitness OOB Fitness Time Left
0 12.62 181.416 11 0.014005 N/A 17.39s
1 8.73 20.5379 11 0.014005 N/A 14.85s
2 7.70 0.39384 10 0.014005 N/A 12.92s
3 4.63 0.2092 10 0.014005 N/A 11.07s
4 2.15 0.086137 3 0.0140051 N/A 8.63s
5 2.02 0.0345978 2 0.0140079 N/A 6.89s
6 2.04 0.0389469 2 0.0140079 N/A 5.37s
7 2.03 0.0395785 2 0.0140079 N/A 3.46s
8 2.05 0.0408348 2 0.0140079 N/A 1.72s
9 2.03 0.039717 2 0.0140079 N/A 0.00s
SymbolicExplanations (DEBUG): Job 69666054159540351ed1f6fbf825f2cd-48ad708a7a708995d8fdf94b34a2dca3 for run_id 69666054159540351ed1f6fbf825f2cd.
SymbolicExplanations (DEBUG): Job 69666054159540351ed1f6fbf825f2cd-48ad708a7a708995d8fdf94b34a2dca3 cached.
SymbolicExplanations (DEBUG): Job 69666054159540351ed1f6fbf825f2cd-48ad708a7a708995d8fdf94b34a2dca3 deleted.
@@ -2,7 +2,7 @@ | |||
# are usually completed in github actions. | |||
|
|||
SHELL := /bin/bash | |||
VERSION := 1.1.3 | |||
VERSION := 1.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says version 1.2, but in the Changelog the change is under Version 1.1.4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edited to 1.2 in Changelog.
description = "An interactive framework to visualize and analyze your AutoML process in real-time." | ||
url = "automl.org" | ||
project_urls = { | ||
"Documentation": "https://automl.github.io/DeepCAVE/main", | ||
"Source Code": "https://github.com/automl/deepcave", | ||
} | ||
copyright = f"Copyright {datetime.date.today().strftime('%Y')}, {author}" | ||
version = "1.1.3" | ||
version = "1.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the previous comment about inconsistent versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
|
||
This plugin is capable of answering similar questions as the Partial Dependencies plugin, i.e.: | ||
|
||
* How does the objective change wrt one or two hyperparameters? For example, does the accuracy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just write "with respect to"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed that in all cases of wrt
Symbolic Explanations | ||
==================== | ||
|
||
This plugin is capable of answering similar questions as the Partial Dependencies plugin, i.e.: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think an explanation of what symbolic explanations are in the first sentence would be best; so just adding one more sentence before this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a sentence in the beginning.
deepcave/cli.py
Outdated
@@ -1,5 +1,4 @@ | |||
from typing import Any, List | |||
|
|||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os is unsused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
@@ -49,6 +49,9 @@ def PLUGINS(self) -> Dict[str, List["Plugin"]]: | |||
from deepcave.plugins.budget.budget_correlation import BudgetCorrelation | |||
from deepcave.plugins.hyperparameter.importances import Importances | |||
from deepcave.plugins.hyperparameter.pdp import PartialDependencies | |||
from deepcave.plugins.hyperparameter.symbolic_explanations import ( | |||
SymbolicExplanations, | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the brackets? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how they got there, removed :)
try: | ||
# Simplification can fail in some cases. If so, use the unsimplified version. | ||
symb_simpl = sympy.simplify(symb_conv) | ||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific exception that could be caught here instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I unfortunately didn't track that and cannot find an example now, thus I just changed it to actually print the exception (so if I should see one at some point, I can edit it).
|
||
def convert_symb(symb, n_decimals: int = None, hp_names: list = None) -> sympy.core.expr: | ||
""" | ||
Convert a fitted symbolic regression to a simplified and potentially rounded mathematical expression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is over 100 characters; however, I am not 100% sure what our desired setting for the linter would be. 100 is admittedly really short.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure either, but I think most parts of the code would be fine with 100. I limited the length here.
return function_set | ||
|
||
|
||
def convert_symb(symb, n_decimals: int = None, hp_names: list = None) -> sympy.core.expr: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type of symb?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
[ | ||
dbc.Label("Parsimony coefficient"), | ||
help_button( | ||
"Penalizes the complexity of the resulting formulas." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a line if higher or lower will mean less complexity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, added.
Regarding the debug logging, I changed the plugin (and other) specific logging settings in For the pre-commit hooks, I edited the files I added similar to the changes in the pre-commit branch. Regarding the problem with the smac-pendigits run, this seems to be related to the problem I ran into with one of Daphne's runs (#111). I added the example there. @helegraf would be great if you could re-check if everything is addressed :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested some small adaptations that might be nice.
handlers: [console] | ||
disable_existing_loggers: false | ||
disable_existing_loggers: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for us setting this to true?
@@ -13,7 +13,7 @@ Since configurations are used throughout the application, you might find links a | |||
plugin. This plugin is capable of answering following questions: | |||
|
|||
* Where is the configuration coming from? | |||
* How are the objective values wrt the budgets? | |||
* How are the objective values with respect to the budgets? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the ....
Plugins
Enhancements
Bug-Fixes
Others