Skip to content

Conversation

@eschmidt42
Copy link
Owner

@eschmidt42 eschmidt42 commented Aug 17, 2025

This pull request refactors the way decision tree components are imported and used across multiple Jupyter notebooks, improving clarity and consistency. It also updates import paths for shared parameters and metrics, standardizes how tree visualization is invoked, and makes minor improvements to development notebooks and dependencies.

Refactoring and import improvements:

  • Changed imports in all core notebooks to use direct imports of DecisionTreeClassifier, DecisionTreeRegressor, and show_tree from their respective modules, instead of importing the entire decisiontree module as dtree. This clarifies usage and reduces namespace clutter. [1] [2] [3] [4] [5] [6] [7]
  • Updated all usages of dtree.show_tree(...) to show_tree(...) across notebooks for consistency. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]

Parameter and metric import updates:

  • Replaced imports of ThresholdSelectionMethod, ColumnSelectionMethod, and MetricNames from random_tree_models.utils or random_tree_models.scoring to import them from the new random_tree_models.params module, reflecting recent codebase organization. [1] [2] [3] [4] [5]
  • Updated XGBoost model instantiations to use measure_name=MetricNames.xgboost instead of a string literal for consistency and clarity. [1] [2]

Notebook and dependency improvements:

  • Added explicit re-exports in random_tree_models.decisiontree.__init__.py for DecisionTreeClassifier, DecisionTreeRegressor, DecisionTreeTemplate, find_leaf_node, and grow_tree to simplify imports elsewhere.
  • Updated test dependencies in pyproject.toml to include dirty-equals and inline-snapshot for improved testing capabilities.
  • Updated the Python version metadata in a development notebook to reflect use of Python 3.13.3.
  • Minor code simplifications in the dev XGBoost profiling notebook by making function calls more concise. [1] [2]

@eschmidt42 eschmidt42 merged commit 4210c92 into main Aug 17, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants