IMoTE 0.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. imote-0.0.0/IMoTE.egg-info/PKG-INFO +113 -0
  2. imote-0.0.0/IMoTE.egg-info/SOURCES.txt +94 -0
  3. imote-0.0.0/IMoTE.egg-info/dependency_links.txt +1 -0
  4. imote-0.0.0/IMoTE.egg-info/entry_points.txt +2 -0
  5. imote-0.0.0/IMoTE.egg-info/requires.txt +22 -0
  6. imote-0.0.0/IMoTE.egg-info/scm_file_list.json +141 -0
  7. imote-0.0.0/IMoTE.egg-info/scm_version.json +8 -0
  8. imote-0.0.0/IMoTE.egg-info/top_level.txt +1 -0
  9. imote-0.0.0/LICENSE +21 -0
  10. imote-0.0.0/MANIFEST.in +5 -0
  11. imote-0.0.0/PKG-INFO +113 -0
  12. imote-0.0.0/README.md +66 -0
  13. imote-0.0.0/imote/__init__.py +28 -0
  14. imote-0.0.0/imote/adapters/__init__.py +3 -0
  15. imote-0.0.0/imote/adapters/adapter_utils.py +15 -0
  16. imote-0.0.0/imote/adapters/base_adapter.py +76 -0
  17. imote-0.0.0/imote/adapters/build_root_node_m5.py +71 -0
  18. imote-0.0.0/imote/adapters/m5_adapter.py +18 -0
  19. imote-0.0.0/imote/adapters/partykit_adapter.py +133 -0
  20. imote-0.0.0/imote/adapters/pilot_adapter.py +154 -0
  21. imote-0.0.0/imote/app.py +80 -0
  22. imote-0.0.0/imote/benchmark_info.py +29 -0
  23. imote-0.0.0/imote/callbacks/__init__.py +16 -0
  24. imote-0.0.0/imote/callbacks/a_tree_info_callbacks.py +110 -0
  25. imote-0.0.0/imote/callbacks/b_node_callbacks.py +186 -0
  26. imote-0.0.0/imote/callbacks/c_new_tree_callbacks.py +380 -0
  27. imote-0.0.0/imote/callbacks/d_edit_tree_callbacks.py +192 -0
  28. imote-0.0.0/imote/callbacks/e_layout_callbacks.py +39 -0
  29. imote-0.0.0/imote/callbacks/f_highlight_callbacks.py +79 -0
  30. imote-0.0.0/imote/callbacks/g_elements_callbacks.py +195 -0
  31. imote-0.0.0/imote/components/__init__.py +0 -0
  32. imote-0.0.0/imote/components/cards/__init__.py +0 -0
  33. imote-0.0.0/imote/components/cards/a_tree_info_card.py +14 -0
  34. imote-0.0.0/imote/components/cards/b_node_info_card.py +79 -0
  35. imote-0.0.0/imote/components/cards/bb_node_plot_settings_card.py +139 -0
  36. imote-0.0.0/imote/components/cards/c_new_tree_card.py +236 -0
  37. imote-0.0.0/imote/components/cards/d_edit_tree_card.py +159 -0
  38. imote-0.0.0/imote/components/cards/e_layout_card.py +66 -0
  39. imote-0.0.0/imote/components/cards/f_highlight_card.py +48 -0
  40. imote-0.0.0/imote/components/cytoscape_graph.py +39 -0
  41. imote-0.0.0/imote/components/stores.py +20 -0
  42. imote-0.0.0/imote/config.py +252 -0
  43. imote-0.0.0/imote/data/initial_tree.pkl +0 -0
  44. imote-0.0.0/imote/dataset/__init__.py +0 -0
  45. imote-0.0.0/imote/dataset/dataset.py +170 -0
  46. imote-0.0.0/imote/dataset/dataset_registry.py +23 -0
  47. imote-0.0.0/imote/ids.py +124 -0
  48. imote-0.0.0/imote/node_metrics/__init__.py +0 -0
  49. imote-0.0.0/imote/node_metrics/node_metric.py +167 -0
  50. imote-0.0.0/imote/nodes/__init__.py +0 -0
  51. imote-0.0.0/imote/nodes/base_node.py +139 -0
  52. imote-0.0.0/imote/nodes/collapsed_node.py +46 -0
  53. imote-0.0.0/imote/nodes/combined_lin_node.py +78 -0
  54. imote-0.0.0/imote/nodes/internal_node.py +129 -0
  55. imote-0.0.0/imote/nodes/leaf_node.py +74 -0
  56. imote-0.0.0/imote/nodes/node_model.py +342 -0
  57. imote-0.0.0/imote/nodes/none_node.py +56 -0
  58. imote-0.0.0/imote/nodes/split_node.py +219 -0
  59. imote-0.0.0/imote/pages/__init__.py +0 -0
  60. imote-0.0.0/imote/pages/explain_page.py +40 -0
  61. imote-0.0.0/imote/pages/tree_view_page.py +33 -0
  62. imote-0.0.0/imote/plots/__init__.py +0 -0
  63. imote-0.0.0/imote/plots/predsplot.py +485 -0
  64. imote-0.0.0/imote/plots/predsplot2.py +540 -0
  65. imote-0.0.0/imote/plots/regplot.py +81 -0
  66. imote-0.0.0/imote/viz_tree/__init__.py +0 -0
  67. imote-0.0.0/imote/viz_tree/contributions.py +113 -0
  68. imote-0.0.0/imote/viz_tree/viz_tree.py +432 -0
  69. imote-0.0.0/imote/viz_tree/viz_tree_cytoscape.py +293 -0
  70. imote-0.0.0/pyproject.toml +78 -0
  71. imote-0.0.0/pytest.ini +3 -0
  72. imote-0.0.0/setup.cfg +4 -0
  73. imote-0.0.0/tests/__init__.py +0 -0
  74. imote-0.0.0/tests/adapters/__init__.py +0 -0
  75. imote-0.0.0/tests/adapters/test_m5_adapter.py +30 -0
  76. imote-0.0.0/tests/adapters/test_partykit_adapter.py +55 -0
  77. imote-0.0.0/tests/adapters/test_pilot_adapter.py +68 -0
  78. imote-0.0.0/tests/conftest.py +30 -0
  79. imote-0.0.0/tests/dataset/__init__.py +0 -0
  80. imote-0.0.0/tests/dataset/test_dataset.py +72 -0
  81. imote-0.0.0/tests/helpers.py +62 -0
  82. imote-0.0.0/tests/node_metrics/__init__.py +0 -0
  83. imote-0.0.0/tests/node_metrics/test_node_metric.py +47 -0
  84. imote-0.0.0/tests/nodes/__init__.py +0 -0
  85. imote-0.0.0/tests/nodes/conftest.py +30 -0
  86. imote-0.0.0/tests/nodes/test_collapsed_node.py +42 -0
  87. imote-0.0.0/tests/nodes/test_combined_lin_node.py +33 -0
  88. imote-0.0.0/tests/nodes/test_internal_node.py +39 -0
  89. imote-0.0.0/tests/nodes/test_leaf_node.py +30 -0
  90. imote-0.0.0/tests/nodes/test_node_model.py +64 -0
  91. imote-0.0.0/tests/nodes/test_none_node.py +17 -0
  92. imote-0.0.0/tests/nodes/test_split_node.py +125 -0
  93. imote-0.0.0/tests/viz_tree/__init__.py +0 -0
  94. imote-0.0.0/tests/viz_tree/test_contributions.py +31 -0
  95. imote-0.0.0/tests/viz_tree/test_viz_tree.py +161 -0
  96. imote-0.0.0/tests/viz_tree/test_viz_tree_cytoscape.py +107 -0
@@ -0,0 +1,113 @@
1
+ Metadata-Version: 2.4
2
+ Name: IMoTE
3
+ Version: 0.0.0
4
+ Summary: IMoTE: Interactive MOdel Tree Explorer, an interactive app to visualise and explore linear model trees
5
+ Author-email: Flor Debois <flor.debois@uantwerpen.be>, Thomas Servotte <thomas.servotte@uantwerpen.be>, Jakob Raymaekers <jakob.raymaekers@uantwerpen.be>, Tim Verdonck <tim.verdonck@uantwerpen.be>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/STAN-UAntwerp/IMoTE
8
+ Project-URL: Documentation, https://stan-uantwerp.github.io/IMoTE/
9
+ Project-URL: Repository, https://github.com/STAN-UAntwerp/IMoTE
10
+ Project-URL: Issues, https://github.com/STAN-UAntwerp/IMoTE/issues
11
+ Keywords: linear model trees,visualization,interpretability,machine learning,decision trees,regression
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Framework :: Dash
20
+ Classifier: Topic :: Scientific/Engineering :: Visualization
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: dash>=4.2
27
+ Requires-Dist: dash-bootstrap-components>=1.6
28
+ Requires-Dist: dash-cytoscape>=1.0
29
+ Requires-Dist: flask>=3.0
30
+ Requires-Dist: numpy>=1.21
31
+ Requires-Dist: pandas>=1.3
32
+ Requires-Dist: matplotlib>=3.6
33
+ Requires-Dist: seaborn>=0.13
34
+ Requires-Dist: pmlb>=1.0
35
+ Requires-Dist: fast-model-trees>=0.0.5
36
+ Requires-Dist: m5py>=0.3.3
37
+ Requires-Dist: scikit-learn<1.9,>=1.3
38
+ Provides-Extra: dev
39
+ Requires-Dist: pytest>=7; extra == "dev"
40
+ Requires-Dist: build; extra == "dev"
41
+ Requires-Dist: twine; extra == "dev"
42
+ Provides-Extra: docs
43
+ Requires-Dist: mkdocs<2,>=1.6; extra == "docs"
44
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
45
+ Requires-Dist: mkdocstrings[python]>=0.26; extra == "docs"
46
+ Dynamic: license-file
47
+
48
+ # IMoTE: Interactive MOdel Tree Explorer
49
+
50
+ **IMoTE** is an interactive app to fit, visualise and explore **linear model trees** for regression.
51
+ Inspect the tree as an interactive graph, see the linear model and data behind every node, and trace a single
52
+ data point through the tree to understand its prediction.
53
+
54
+ ![IMoTE: the tree graph with the interaction cards on the right](https://raw.githubusercontent.com/STAN-UAntwerp/IMoTE/main/docs/assets/screenshots/app-overview.png)
55
+
56
+ ## Overview
57
+
58
+ IMoTE supports two linear model tree algorithms out of the box:
59
+
60
+ - **PILOT** (*PIecewise Linear Organic Tree*): a fast linear model tree algorithm, using the
61
+ [fast-model-trees](https://github.com/STAN-UAntwerp/fast-model-trees) implementation.
62
+ - **M5**: the classic model tree algorithm, using [m5py](https://pypi.org/project/m5py/).
63
+
64
+ Trees fitted with other tools can be loaded by writing an **adapter**. A partykit (R) adapter is included as an example.
65
+
66
+ ## Installation
67
+
68
+ ```bash
69
+ pip install imote
70
+ ```
71
+
72
+ IMoTE needs Python 3.10 or newer.
73
+
74
+ ## Quick start
75
+
76
+ ### Start the app
77
+
78
+ ```bash
79
+ imote
80
+ ```
81
+
82
+ Then open the address shown in the terminal (by default <http://127.0.0.1:8050>). From the **New Tree** card you can
83
+ fit PILOT or M5 on a built-in dataset or on your own CSV file.
84
+
85
+ IMoTE stores saved trees, uploaded datasets and generated plots in `~/.imote`. Set the `IMOTE_HOME` environment
86
+ variable to use another folder.
87
+
88
+ ## Documentation
89
+
90
+ The full documentation, with a guide to every part of the interface and how to write your own adapter, is at
91
+ <https://stan-uantwerp.github.io/IMoTE/>.
92
+
93
+ ## Papers
94
+
95
+ - **PILOT**: Raymaekers, J., Rousseeuw, P. J., Verdonck, T., & Yao, R. (2024). Fast linear model trees by PILOT.
96
+ *Machine Learning*, 113(9), 6561-6610. <https://doi.org/10.1007/s10994-024-06590-3>
97
+ - **M5**: Quinlan, J. R. (1992). Learning with continuous classes. In *5th Australian Joint Conference on Artificial
98
+ Intelligence* (Vol. 92, pp. 343-348).
99
+
100
+ ## Development
101
+
102
+ ```bash
103
+ git clone https://github.com/STAN-UAntwerp/IMoTE
104
+ cd IMoTE
105
+ pip install -e ".[dev]" # IMoTE in editable mode, plus pytest, build and twine
106
+ python -m imote.app # start the app in Dash debug mode, it reloads on code changes
107
+ ```
108
+
109
+ To work on the documentation: `pip install -e ".[docs]"`, then `mkdocs serve`.
110
+
111
+ ## License
112
+
113
+ MIT, see [LICENSE](https://github.com/STAN-UAntwerp/IMoTE/blob/main/LICENSE).
@@ -0,0 +1,94 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ pytest.ini
6
+ IMoTE.egg-info/PKG-INFO
7
+ IMoTE.egg-info/SOURCES.txt
8
+ IMoTE.egg-info/dependency_links.txt
9
+ IMoTE.egg-info/entry_points.txt
10
+ IMoTE.egg-info/requires.txt
11
+ IMoTE.egg-info/scm_file_list.json
12
+ IMoTE.egg-info/scm_version.json
13
+ IMoTE.egg-info/top_level.txt
14
+ imote/__init__.py
15
+ imote/app.py
16
+ imote/benchmark_info.py
17
+ imote/config.py
18
+ imote/ids.py
19
+ imote/adapters/__init__.py
20
+ imote/adapters/adapter_utils.py
21
+ imote/adapters/base_adapter.py
22
+ imote/adapters/build_root_node_m5.py
23
+ imote/adapters/m5_adapter.py
24
+ imote/adapters/partykit_adapter.py
25
+ imote/adapters/pilot_adapter.py
26
+ imote/callbacks/__init__.py
27
+ imote/callbacks/a_tree_info_callbacks.py
28
+ imote/callbacks/b_node_callbacks.py
29
+ imote/callbacks/c_new_tree_callbacks.py
30
+ imote/callbacks/d_edit_tree_callbacks.py
31
+ imote/callbacks/e_layout_callbacks.py
32
+ imote/callbacks/f_highlight_callbacks.py
33
+ imote/callbacks/g_elements_callbacks.py
34
+ imote/components/__init__.py
35
+ imote/components/cytoscape_graph.py
36
+ imote/components/stores.py
37
+ imote/components/cards/__init__.py
38
+ imote/components/cards/a_tree_info_card.py
39
+ imote/components/cards/b_node_info_card.py
40
+ imote/components/cards/bb_node_plot_settings_card.py
41
+ imote/components/cards/c_new_tree_card.py
42
+ imote/components/cards/d_edit_tree_card.py
43
+ imote/components/cards/e_layout_card.py
44
+ imote/components/cards/f_highlight_card.py
45
+ imote/data/initial_tree.pkl
46
+ imote/dataset/__init__.py
47
+ imote/dataset/dataset.py
48
+ imote/dataset/dataset_registry.py
49
+ imote/node_metrics/__init__.py
50
+ imote/node_metrics/node_metric.py
51
+ imote/nodes/__init__.py
52
+ imote/nodes/base_node.py
53
+ imote/nodes/collapsed_node.py
54
+ imote/nodes/combined_lin_node.py
55
+ imote/nodes/internal_node.py
56
+ imote/nodes/leaf_node.py
57
+ imote/nodes/node_model.py
58
+ imote/nodes/none_node.py
59
+ imote/nodes/split_node.py
60
+ imote/pages/__init__.py
61
+ imote/pages/explain_page.py
62
+ imote/pages/tree_view_page.py
63
+ imote/plots/__init__.py
64
+ imote/plots/predsplot.py
65
+ imote/plots/predsplot2.py
66
+ imote/plots/regplot.py
67
+ imote/viz_tree/__init__.py
68
+ imote/viz_tree/contributions.py
69
+ imote/viz_tree/viz_tree.py
70
+ imote/viz_tree/viz_tree_cytoscape.py
71
+ tests/__init__.py
72
+ tests/conftest.py
73
+ tests/helpers.py
74
+ tests/adapters/__init__.py
75
+ tests/adapters/test_m5_adapter.py
76
+ tests/adapters/test_partykit_adapter.py
77
+ tests/adapters/test_pilot_adapter.py
78
+ tests/dataset/__init__.py
79
+ tests/dataset/test_dataset.py
80
+ tests/node_metrics/__init__.py
81
+ tests/node_metrics/test_node_metric.py
82
+ tests/nodes/__init__.py
83
+ tests/nodes/conftest.py
84
+ tests/nodes/test_collapsed_node.py
85
+ tests/nodes/test_combined_lin_node.py
86
+ tests/nodes/test_internal_node.py
87
+ tests/nodes/test_leaf_node.py
88
+ tests/nodes/test_node_model.py
89
+ tests/nodes/test_none_node.py
90
+ tests/nodes/test_split_node.py
91
+ tests/viz_tree/__init__.py
92
+ tests/viz_tree/test_contributions.py
93
+ tests/viz_tree/test_viz_tree.py
94
+ tests/viz_tree/test_viz_tree_cytoscape.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ imote = imote.app:main
@@ -0,0 +1,22 @@
1
+ dash>=4.2
2
+ dash-bootstrap-components>=1.6
3
+ dash-cytoscape>=1.0
4
+ flask>=3.0
5
+ numpy>=1.21
6
+ pandas>=1.3
7
+ matplotlib>=3.6
8
+ seaborn>=0.13
9
+ pmlb>=1.0
10
+ fast-model-trees>=0.0.5
11
+ m5py>=0.3.3
12
+ scikit-learn<1.9,>=1.3
13
+
14
+ [dev]
15
+ pytest>=7
16
+ build
17
+ twine
18
+
19
+ [docs]
20
+ mkdocs<2,>=1.6
21
+ mkdocs-material>=9.5
22
+ mkdocstrings[python]>=0.26
@@ -0,0 +1,141 @@
1
+ {
2
+ "files": [
3
+ ".github/workflows/docs.yml",
4
+ ".github/workflows/publish.yml",
5
+ ".github/workflows/tests.yml",
6
+ ".gitignore",
7
+ "LICENSE",
8
+ "MANIFEST.in",
9
+ "README.md",
10
+ "docs/adapter/adapter_overview.md",
11
+ "docs/adapter/partykit_example.md",
12
+ "docs/assets/screenshots/a-tree-info.png",
13
+ "docs/assets/screenshots/app-overview-annotated.png",
14
+ "docs/assets/screenshots/app-overview.png",
15
+ "docs/assets/screenshots/b-node-info-pred.png",
16
+ "docs/assets/screenshots/b-node-info-reg.png",
17
+ "docs/assets/screenshots/b-node-info.png",
18
+ "docs/assets/screenshots/c-new-tree.png",
19
+ "docs/assets/screenshots/csv_upload.png",
20
+ "docs/assets/screenshots/d-edit-tree.png",
21
+ "docs/assets/screenshots/e-layout.png",
22
+ "docs/assets/screenshots/f-highlight.png",
23
+ "docs/assets/screenshots/gallery-collapsed.png",
24
+ "docs/assets/screenshots/gallery-highlight-path-plots.png",
25
+ "docs/assets/screenshots/gallery-large.png",
26
+ "docs/assets/screenshots/gallery-m5.png",
27
+ "docs/assets/screenshots/gallery-show-all-node.png",
28
+ "docs/assets/screenshots/gallery-subtree-highlight.png",
29
+ "docs/assets/stylesheets/custom.css",
30
+ "docs/assets/stylesheets/custom_api.css",
31
+ "docs/gallery.md",
32
+ "docs/index.md",
33
+ "docs/reference/adapters/base_adapter.md",
34
+ "docs/reference/adapters/partykit_adapter.md",
35
+ "docs/reference/nodes/base_node.md",
36
+ "docs/reference/nodes/collapsed_node.md",
37
+ "docs/reference/nodes/combined_lin_node.md",
38
+ "docs/reference/nodes/internal_node.md",
39
+ "docs/reference/nodes/leaf_node.md",
40
+ "docs/reference/nodes/node_model.md",
41
+ "docs/reference/nodes/none_node.md",
42
+ "docs/reference/nodes/split_node.md",
43
+ "docs/reference/reference_overview.md",
44
+ "docs/reference/viz_tree.md",
45
+ "docs/user-guide/a-tree-info.md",
46
+ "docs/user-guide/b-node-info.md",
47
+ "docs/user-guide/c-new-tree.md",
48
+ "docs/user-guide/d-edit-tree.md",
49
+ "docs/user-guide/e-layout.md",
50
+ "docs/user-guide/f-highlight.md",
51
+ "docs/user-guide/interface-overview.md",
52
+ "experimental/__init__.py",
53
+ "experimental/beeswarm.py",
54
+ "experimental/colors.py",
55
+ "experimental/contribution_plots.py",
56
+ "imote/__init__.py",
57
+ "imote/adapters/__init__.py",
58
+ "imote/adapters/adapter_utils.py",
59
+ "imote/adapters/base_adapter.py",
60
+ "imote/adapters/build_root_node_m5.py",
61
+ "imote/adapters/m5_adapter.py",
62
+ "imote/adapters/partykit_adapter.py",
63
+ "imote/adapters/pilot_adapter.py",
64
+ "imote/app.py",
65
+ "imote/benchmark_info.py",
66
+ "imote/callbacks/__init__.py",
67
+ "imote/callbacks/a_tree_info_callbacks.py",
68
+ "imote/callbacks/b_node_callbacks.py",
69
+ "imote/callbacks/c_new_tree_callbacks.py",
70
+ "imote/callbacks/d_edit_tree_callbacks.py",
71
+ "imote/callbacks/e_layout_callbacks.py",
72
+ "imote/callbacks/f_highlight_callbacks.py",
73
+ "imote/callbacks/g_elements_callbacks.py",
74
+ "imote/components/__init__.py",
75
+ "imote/components/cards/__init__.py",
76
+ "imote/components/cards/a_tree_info_card.py",
77
+ "imote/components/cards/b_node_info_card.py",
78
+ "imote/components/cards/bb_node_plot_settings_card.py",
79
+ "imote/components/cards/c_new_tree_card.py",
80
+ "imote/components/cards/d_edit_tree_card.py",
81
+ "imote/components/cards/e_layout_card.py",
82
+ "imote/components/cards/f_highlight_card.py",
83
+ "imote/components/cytoscape_graph.py",
84
+ "imote/components/stores.py",
85
+ "imote/config.py",
86
+ "imote/data/initial_tree.pkl",
87
+ "imote/dataset/__init__.py",
88
+ "imote/dataset/dataset.py",
89
+ "imote/dataset/dataset_registry.py",
90
+ "imote/ids.py",
91
+ "imote/node_metrics/__init__.py",
92
+ "imote/node_metrics/node_metric.py",
93
+ "imote/nodes/__init__.py",
94
+ "imote/nodes/base_node.py",
95
+ "imote/nodes/collapsed_node.py",
96
+ "imote/nodes/combined_lin_node.py",
97
+ "imote/nodes/internal_node.py",
98
+ "imote/nodes/leaf_node.py",
99
+ "imote/nodes/node_model.py",
100
+ "imote/nodes/none_node.py",
101
+ "imote/nodes/split_node.py",
102
+ "imote/pages/__init__.py",
103
+ "imote/pages/explain_page.py",
104
+ "imote/pages/tree_view_page.py",
105
+ "imote/plots/__init__.py",
106
+ "imote/plots/predsplot.py",
107
+ "imote/plots/predsplot2.py",
108
+ "imote/plots/regplot.py",
109
+ "imote/viz_tree/__init__.py",
110
+ "imote/viz_tree/contributions.py",
111
+ "imote/viz_tree/viz_tree.py",
112
+ "imote/viz_tree/viz_tree_cytoscape.py",
113
+ "mkdocs.yml",
114
+ "pyproject.toml",
115
+ "pytest.ini",
116
+ "tests/__init__.py",
117
+ "tests/adapters/__init__.py",
118
+ "tests/adapters/test_m5_adapter.py",
119
+ "tests/adapters/test_partykit_adapter.py",
120
+ "tests/adapters/test_pilot_adapter.py",
121
+ "tests/conftest.py",
122
+ "tests/dataset/__init__.py",
123
+ "tests/dataset/test_dataset.py",
124
+ "tests/helpers.py",
125
+ "tests/node_metrics/__init__.py",
126
+ "tests/node_metrics/test_node_metric.py",
127
+ "tests/nodes/__init__.py",
128
+ "tests/nodes/conftest.py",
129
+ "tests/nodes/test_collapsed_node.py",
130
+ "tests/nodes/test_combined_lin_node.py",
131
+ "tests/nodes/test_internal_node.py",
132
+ "tests/nodes/test_leaf_node.py",
133
+ "tests/nodes/test_node_model.py",
134
+ "tests/nodes/test_none_node.py",
135
+ "tests/nodes/test_split_node.py",
136
+ "tests/viz_tree/__init__.py",
137
+ "tests/viz_tree/test_contributions.py",
138
+ "tests/viz_tree/test_viz_tree.py",
139
+ "tests/viz_tree/test_viz_tree_cytoscape.py"
140
+ ]
141
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "0.0.0",
3
+ "distance": 0,
4
+ "node": "gbbdca2696f7c54d0bf4655df980933f8ff238769",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-10-07"
8
+ }
@@ -0,0 +1 @@
1
+ imote
imote-0.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 STAN-UAntwerp
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ # setuptools-scm adds every git-tracked file to the sdist, leave out what users don't need
2
+ prune docs
3
+ prune experimental
4
+ prune .github
5
+ exclude mkdocs.yml .gitignore
imote-0.0.0/PKG-INFO ADDED
@@ -0,0 +1,113 @@
1
+ Metadata-Version: 2.4
2
+ Name: IMoTE
3
+ Version: 0.0.0
4
+ Summary: IMoTE: Interactive MOdel Tree Explorer, an interactive app to visualise and explore linear model trees
5
+ Author-email: Flor Debois <flor.debois@uantwerpen.be>, Thomas Servotte <thomas.servotte@uantwerpen.be>, Jakob Raymaekers <jakob.raymaekers@uantwerpen.be>, Tim Verdonck <tim.verdonck@uantwerpen.be>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/STAN-UAntwerp/IMoTE
8
+ Project-URL: Documentation, https://stan-uantwerp.github.io/IMoTE/
9
+ Project-URL: Repository, https://github.com/STAN-UAntwerp/IMoTE
10
+ Project-URL: Issues, https://github.com/STAN-UAntwerp/IMoTE/issues
11
+ Keywords: linear model trees,visualization,interpretability,machine learning,decision trees,regression
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Framework :: Dash
20
+ Classifier: Topic :: Scientific/Engineering :: Visualization
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: dash>=4.2
27
+ Requires-Dist: dash-bootstrap-components>=1.6
28
+ Requires-Dist: dash-cytoscape>=1.0
29
+ Requires-Dist: flask>=3.0
30
+ Requires-Dist: numpy>=1.21
31
+ Requires-Dist: pandas>=1.3
32
+ Requires-Dist: matplotlib>=3.6
33
+ Requires-Dist: seaborn>=0.13
34
+ Requires-Dist: pmlb>=1.0
35
+ Requires-Dist: fast-model-trees>=0.0.5
36
+ Requires-Dist: m5py>=0.3.3
37
+ Requires-Dist: scikit-learn<1.9,>=1.3
38
+ Provides-Extra: dev
39
+ Requires-Dist: pytest>=7; extra == "dev"
40
+ Requires-Dist: build; extra == "dev"
41
+ Requires-Dist: twine; extra == "dev"
42
+ Provides-Extra: docs
43
+ Requires-Dist: mkdocs<2,>=1.6; extra == "docs"
44
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
45
+ Requires-Dist: mkdocstrings[python]>=0.26; extra == "docs"
46
+ Dynamic: license-file
47
+
48
+ # IMoTE: Interactive MOdel Tree Explorer
49
+
50
+ **IMoTE** is an interactive app to fit, visualise and explore **linear model trees** for regression.
51
+ Inspect the tree as an interactive graph, see the linear model and data behind every node, and trace a single
52
+ data point through the tree to understand its prediction.
53
+
54
+ ![IMoTE: the tree graph with the interaction cards on the right](https://raw.githubusercontent.com/STAN-UAntwerp/IMoTE/main/docs/assets/screenshots/app-overview.png)
55
+
56
+ ## Overview
57
+
58
+ IMoTE supports two linear model tree algorithms out of the box:
59
+
60
+ - **PILOT** (*PIecewise Linear Organic Tree*): a fast linear model tree algorithm, using the
61
+ [fast-model-trees](https://github.com/STAN-UAntwerp/fast-model-trees) implementation.
62
+ - **M5**: the classic model tree algorithm, using [m5py](https://pypi.org/project/m5py/).
63
+
64
+ Trees fitted with other tools can be loaded by writing an **adapter**. A partykit (R) adapter is included as an example.
65
+
66
+ ## Installation
67
+
68
+ ```bash
69
+ pip install imote
70
+ ```
71
+
72
+ IMoTE needs Python 3.10 or newer.
73
+
74
+ ## Quick start
75
+
76
+ ### Start the app
77
+
78
+ ```bash
79
+ imote
80
+ ```
81
+
82
+ Then open the address shown in the terminal (by default <http://127.0.0.1:8050>). From the **New Tree** card you can
83
+ fit PILOT or M5 on a built-in dataset or on your own CSV file.
84
+
85
+ IMoTE stores saved trees, uploaded datasets and generated plots in `~/.imote`. Set the `IMOTE_HOME` environment
86
+ variable to use another folder.
87
+
88
+ ## Documentation
89
+
90
+ The full documentation, with a guide to every part of the interface and how to write your own adapter, is at
91
+ <https://stan-uantwerp.github.io/IMoTE/>.
92
+
93
+ ## Papers
94
+
95
+ - **PILOT**: Raymaekers, J., Rousseeuw, P. J., Verdonck, T., & Yao, R. (2024). Fast linear model trees by PILOT.
96
+ *Machine Learning*, 113(9), 6561-6610. <https://doi.org/10.1007/s10994-024-06590-3>
97
+ - **M5**: Quinlan, J. R. (1992). Learning with continuous classes. In *5th Australian Joint Conference on Artificial
98
+ Intelligence* (Vol. 92, pp. 343-348).
99
+
100
+ ## Development
101
+
102
+ ```bash
103
+ git clone https://github.com/STAN-UAntwerp/IMoTE
104
+ cd IMoTE
105
+ pip install -e ".[dev]" # IMoTE in editable mode, plus pytest, build and twine
106
+ python -m imote.app # start the app in Dash debug mode, it reloads on code changes
107
+ ```
108
+
109
+ To work on the documentation: `pip install -e ".[docs]"`, then `mkdocs serve`.
110
+
111
+ ## License
112
+
113
+ MIT, see [LICENSE](https://github.com/STAN-UAntwerp/IMoTE/blob/main/LICENSE).
imote-0.0.0/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # IMoTE: Interactive MOdel Tree Explorer
2
+
3
+ **IMoTE** is an interactive app to fit, visualise and explore **linear model trees** for regression.
4
+ Inspect the tree as an interactive graph, see the linear model and data behind every node, and trace a single
5
+ data point through the tree to understand its prediction.
6
+
7
+ ![IMoTE: the tree graph with the interaction cards on the right](https://raw.githubusercontent.com/STAN-UAntwerp/IMoTE/main/docs/assets/screenshots/app-overview.png)
8
+
9
+ ## Overview
10
+
11
+ IMoTE supports two linear model tree algorithms out of the box:
12
+
13
+ - **PILOT** (*PIecewise Linear Organic Tree*): a fast linear model tree algorithm, using the
14
+ [fast-model-trees](https://github.com/STAN-UAntwerp/fast-model-trees) implementation.
15
+ - **M5**: the classic model tree algorithm, using [m5py](https://pypi.org/project/m5py/).
16
+
17
+ Trees fitted with other tools can be loaded by writing an **adapter**. A partykit (R) adapter is included as an example.
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ pip install imote
23
+ ```
24
+
25
+ IMoTE needs Python 3.10 or newer.
26
+
27
+ ## Quick start
28
+
29
+ ### Start the app
30
+
31
+ ```bash
32
+ imote
33
+ ```
34
+
35
+ Then open the address shown in the terminal (by default <http://127.0.0.1:8050>). From the **New Tree** card you can
36
+ fit PILOT or M5 on a built-in dataset or on your own CSV file.
37
+
38
+ IMoTE stores saved trees, uploaded datasets and generated plots in `~/.imote`. Set the `IMOTE_HOME` environment
39
+ variable to use another folder.
40
+
41
+ ## Documentation
42
+
43
+ The full documentation, with a guide to every part of the interface and how to write your own adapter, is at
44
+ <https://stan-uantwerp.github.io/IMoTE/>.
45
+
46
+ ## Papers
47
+
48
+ - **PILOT**: Raymaekers, J., Rousseeuw, P. J., Verdonck, T., & Yao, R. (2024). Fast linear model trees by PILOT.
49
+ *Machine Learning*, 113(9), 6561-6610. <https://doi.org/10.1007/s10994-024-06590-3>
50
+ - **M5**: Quinlan, J. R. (1992). Learning with continuous classes. In *5th Australian Joint Conference on Artificial
51
+ Intelligence* (Vol. 92, pp. 343-348).
52
+
53
+ ## Development
54
+
55
+ ```bash
56
+ git clone https://github.com/STAN-UAntwerp/IMoTE
57
+ cd IMoTE
58
+ pip install -e ".[dev]" # IMoTE in editable mode, plus pytest, build and twine
59
+ python -m imote.app # start the app in Dash debug mode, it reloads on code changes
60
+ ```
61
+
62
+ To work on the documentation: `pip install -e ".[docs]"`, then `mkdocs serve`.
63
+
64
+ ## License
65
+
66
+ MIT, see [LICENSE](https://github.com/STAN-UAntwerp/IMoTE/blob/main/LICENSE).
@@ -0,0 +1,28 @@
1
+ """IMoTE: Interactive MOdel Tree Explorer."""
2
+
3
+ from importlib.metadata import PackageNotFoundError, version
4
+
5
+ try:
6
+ __version__ = version("imote") # set from the git tag by setuptools-scm at install time
7
+ except PackageNotFoundError: # running from a source tree that was never pip installed
8
+ __version__ = "0+unknown"
9
+
10
+ from imote.adapters import M5Adapter, PartyKitAdapter, PilotAdapter
11
+ from imote.adapters.base_adapter import ADAPTERS_REGISTRY, BaseAdapter, register_adapter
12
+ from imote.dataset.dataset import Dataset
13
+ from imote.node_metrics.node_metric import NODE_METRICS_REGISTRY, BaseNodeMetric, register_metric
14
+ from imote.viz_tree.viz_tree import VizTree
15
+
16
+ __all__ = [
17
+ "VizTree",
18
+ "Dataset",
19
+ "BaseAdapter",
20
+ "register_adapter",
21
+ "ADAPTERS_REGISTRY",
22
+ "PilotAdapter",
23
+ "M5Adapter",
24
+ "PartyKitAdapter",
25
+ "BaseNodeMetric",
26
+ "register_metric",
27
+ "NODE_METRICS_REGISTRY",
28
+ ]
@@ -0,0 +1,3 @@
1
+ from .pilot_adapter import PilotAdapter
2
+ from .m5_adapter import M5Adapter
3
+ from .partykit_adapter import PartyKitAdapter
@@ -0,0 +1,15 @@
1
+ import numpy as np
2
+
3
+ def split_by_threshold(X_train, current_indices, pivot_idx, pivot_value):
4
+ mask = X_train[current_indices, pivot_idx] <= pivot_value
5
+ return _apply_mask(current_indices, mask)
6
+
7
+ def split_by_categories(X_train, current_indices, pivot_idx, left_categories):
8
+ mask = np.isin(X_train[current_indices, pivot_idx], left_categories)
9
+ return _apply_mask(current_indices, mask)
10
+
11
+ def _apply_mask(current_indices, mask):
12
+ left_indices, right_indices = current_indices.copy(), current_indices.copy()
13
+ left_indices[current_indices] = mask
14
+ right_indices[current_indices] = ~mask
15
+ return left_indices, right_indices