-
Notifications
You must be signed in to change notification settings - Fork 0
Lumen dirty test #31
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
base: dev
Are you sure you want to change the base?
Lumen dirty test #31
Changes from 126 commits
dcce87e
740ce9f
caf6009
163cf81
cc014eb
92392ab
c66bd3b
40eb6b7
97e6d38
8391b23
f18da83
7a0344c
0fbc99a
22240d5
8905b01
1168023
570549e
d49313f
649c8be
3e8e8a4
b69a362
186cf32
e50caed
d4fb65e
312ecac
a291f0b
699c582
0d8654b
1310e07
cfd6f9a
b043f52
9e45fe0
2631b3c
76e573c
46c4d04
326f3a8
2ef16e2
bcf9ac7
4380e6f
c44bbf3
6d3760c
3e6e850
e349f78
d1c7455
62b6746
09426c3
6369a24
32476bb
fc1ca0b
f2c0bed
1817865
dd0507b
a9b40c0
f373d20
017335f
b8bac60
618d146
693341f
47ab9b7
99a38b0
ed88574
958d4f6
079d2a0
128e0fb
ebb0e6c
d09ba94
de14005
c28ff00
1b2b258
960895b
97f2f98
318a315
5d34d30
435a1bd
8c6beab
19f1d52
b830325
504907e
7ed295e
b05dc13
2c95123
7510374
229162e
0bad2b1
5f12692
582855f
0aaeef5
1184827
410da60
e273365
95fd9cc
d5608dd
95b1e64
54eca93
0c1d488
27b4aac
8d289e7
e420f60
056bf75
8de9fff
e4a69b1
f56d1b4
c427468
ccdc228
a11f21d
a41863f
e65e8b2
969b963
c069bd2
fd73c5a
d636e1a
1035e2a
8d10bf7
376d0d0
73a6098
d8f95a0
5816fdb
790526e
142cf95
550a029
f37e236
46834a9
eaca796
2fe94ac
8f553c8
489a2cb
22e83df
a166221
68e5534
c27ffe0
48bf69d
1161320
6c4e093
91287c1
bc774be
8819028
4f0d882
a9e157e
dd6da31
be0f106
5f340a4
6b9158b
e560493
ee022d1
a90503c
ff38051
eecc821
1f2d11c
c77d68f
8ec7b0f
127aabb
bd9266f
41e3507
52d23f0
2c95e2f
a12a17c
37a1d75
e013acf
559b821
f3b8f7e
9b8412d
fc7c655
a4c9672
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,76 @@ | ||
<div align="center"><a href="https://github.com/aclai-lab/Sole.jl"><img src="logo.png" alt="" title="This package is part of Sole.jl" width="200"></a></div> | ||
|
||
# SolePostHoc.jl | ||
# SolePostHoc.jl – Post-Hoc Analysis for Symbolic Learning | ||
🚧 This package is under construction. 🚧 | ||
|
||
|
||
<!-- | ||
[](https://aclai-lab.github.io/SolePostHoc.jl/stable) | ||
[](https://aclai-lab.github.io/SolePostHoc.jl/dev) | ||
[](https://cirrus-ci.com/github/aclai-lab/SolePostHoc.jl) | ||
[](https://codecov.io/gh/aclai-lab/SolePostHoc.jl) | ||
[](https://coveralls.io/github/aclai-lab/SolePostHoc.jl?branch=main) | ||
--> | ||
|
||
🚧 This package is under construction. 🚧 | ||
## In a nutshell | ||
|
||
*SolePostHoc.jl* is dedicated to post-hoc analysis and optimization of symbolic learning models. It provides a comprehensive suite of algorithms for: | ||
- Rule extraction from both symbolic and non-symbolic models | ||
- Rule minimization and optimization | ||
- Model transformation and enhancement | ||
- Interpretability analysis | ||
|
||
## Key Features | ||
|
||
### Rule Extraction and Model Optimization | ||
- Extraction of comprehensible rules from complex models | ||
- Support for various source models: | ||
- Decision trees and random forests | ||
- Black-box models | ||
- A clean Rule extraction interface (`SolePostHoc.modalextractrules`) | ||
- Implementation of state-of-the-art algorithms: | ||
- LUMEN (L: Logic-driven U: Unified M: Minimal E: Extractor of N: Notions) | ||
- InTrees (Interpret Tree Ensembles) | ||
- TREPAN | ||
- REFNE | ||
- have binding with other state-of-the-art algorithms | ||
- binding to RuleCOSI(+) | ||
- BATrees (Born Again Trees) | ||
### Through these we guarantee | ||
- Rule minimization techniques | ||
- Model simplification while preserving accuracy | ||
- Performance enhancement through post-processing | ||
|
||
### Integration | ||
- Seamless integration with other Sole.jl packages | ||
|
||
|
||
## Usage Example | ||
|
||
```julia | ||
# Load packages | ||
using SolePostHoc | ||
using SoleModels | ||
using MLJ | ||
|
||
# Load and prepare a model (e.g., a random forest) | ||
🌳 = load_model("your_model.jl") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But how about instead of
or by means of parsing:
Btw I like Ps Nice iconography with the emojis! |
||
|
||
# Extract rules | ||
🍃 = modalextractrules(RuleExtractor = LumenRuleExtractor,🌳) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a space missing before 🌳 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "modalextractrules -> extractrules" it's a request from the professor... he preferred this one... "There's a space missing before 🌳" wow I hadn't noticed that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is not a single |
||
|
||
# View metrics | ||
printmetrics(🍃) | ||
``` | ||
|
||
|
||
## Want to know more? | ||
For the theoretical foundations of Sole framework, refer to: | ||
[*Modal Symbolic Learning: from theory to practice*, G. Pagliarini (2024)](https://scholar.google.com/citations?view_op=view_citation&hl=en&user=FRo4yrcAAAAJ&citation_for_view=FRo4yrcAAAAJ:LkGwnXOMwfcC) | ||
|
||
Comment on lines
+63
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe here it's better if we refer to the Sole.jl github, so that mantaining references is less of a burden? Similar to https://github.com/aclai-lab/SoleLogics.jl?tab=readme-ov-file#about But I see that SoleModels also has this same footer https://github.com/aclai-lab/SoleModels.jl?tab=readme-ov-file#want-to-know-more SoleData is even more different... https://github.com/aclai-lab/SoleData.jl We probably should choose one style of referencing to Sole and its background, and stick with it across all packages like SoleLogics and SoleData. I don't know which style is the correct one. Thoughts? @ferdiu @alberto-paparella @mauro-milella ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a great talking point for a Sole Reunion There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the more maintainable between all of them is the one present in SoleModels you linked. I also liked the idea of the Similar Julia Packages from SoleLogics but it is going to be hard to keep it up-to-date so I would not go down that path for all packages. I would go with SoleModels model 😝 for the footer of the READMEs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with @ferdiu, I also prefer the one from |
||
## About | ||
|
||
The package is developed by the [ACLAI Lab](https://aclai.unife.it/en/) @ University of Ferrara. | ||
|
||
## More on Sole | ||
*SolePostHoc.jl* is part of the [*Sole.jl*](https://github.com/aclai-lab/Sole.jl) ecosystem, working alongside: | ||
- [SoleLogics.jl](https://github.com/aclai-lab/SoleLogics.jl): Logical foundations | ||
- [SoleData.jl](https://github.com/aclai-lab/SoleData.jl): Data handling | ||
- [SoleModels.jl](https://github.com/aclai-lab/SoleModels.jl): Model definitions | ||
- [SoleFeatures.jl](https://github.com/aclai-lab/SoleFeatures.jl): Feature engineering |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# TODO | ||
|
||
|
||
## LUMEN | ||
- Remove Italian sentences | ||
- | ||
|
||
## BA-Trees | ||
BA-Trees must be integrated well as a `RuleExtraction` object. Some first steps: | ||
- Separate forest learning, forest simplification, and algorithm testing logics. | ||
- Write a function that translates decision forests to BA-tree txt format. | ||
- Write a function that translates ANY (non-bag) symbolic model to BA-tree txt format. Remember that any non-bag model can be seen as a particular case of a forest (ensemble of trees), via a polynomial reduction | ||
- Build object `BATreesRuleExtraction`, which outputs a SoleModel.DecisionTree. Be careful: clarify the assumpions on the symbolic model type, or the underlying logical language | ||
- Can we extend it to the modal level? |
Perro2110 marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number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this comment
The reason will be displayed to describe this comment to others. Learn more.
We should clean all of these dependencies, we can't have this many. If needed, we should do package extensions e.g., for DecisionTree.jl
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.
yes I have to put myself there! now start