Skip to content

Commit eafd7a9

Browse files
authored
Merge pull request #49 from aclai-lab/lumen-refactoring
Added support for SolePostHoc and SoleXplorer what's changed: - porting from Cirrus to GitHub CI workflow - Lumen implementation - clean unused packages and deps - external packages "DecisiontreeExt" and "XgboostExt" implemented and working - minor
2 parents 2bd8d7f + d3f8dfe commit eafd7a9

29 files changed

+1015
-620
lines changed

.cirrus.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

.github/workflows/TagBot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ on:
44
types:
55
- created
66
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: "3"
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
723
jobs:
824
TagBot:
925
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'

.github/workflows/ci.yml

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,47 @@
1-
name: Upload coverage reports to Codecov
2-
on: [push, pull_request]
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- lumen-refactoring
6+
tags: ['*']
7+
pull_request:
8+
workflow_dispatch:
9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
314
jobs:
4-
run:
5-
runs-on: ubuntu-latest
15+
test:
16+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
17+
runs-on: ${{ matrix.os }}
18+
timeout-minutes: 60
19+
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
20+
actions: write
21+
contents: read
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
version:
26+
- '1'
27+
- 'lts'
28+
- 'pre'
29+
os:
30+
- ubuntu-latest
31+
arch:
32+
- x64
633
steps:
7-
- name: Checkout
8-
uses: actions/checkout@v2
9-
- name: Set up Julia 1.9.0
10-
uses: julia-actions/setup-julia@v1
34+
- uses: actions/checkout@v4
35+
- uses: julia-actions/setup-julia@v2
1136
with:
12-
version: "1.9.0"
37+
version: ${{ matrix.version }}
38+
arch: ${{ matrix.arch }}
39+
- uses: julia-actions/cache@v2
1340
- uses: julia-actions/julia-buildpkg@v1
1441
- uses: julia-actions/julia-runtest@v1
1542
- uses: julia-actions/julia-processcoverage@v1
1643
- uses: codecov/codecov-action@v5
1744
with:
45+
files: lcov.info
1846
token: ${{ secrets.CODECOV_TOKEN }}
19-
slug: aclai-lab/SoleModels.jl
20-
47+
fail_ci_if_error: false

Project.toml

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,22 @@ name = "SoleModels"
22
uuid = "4249d9c7-3290-4ddd-961c-e1d3ec2467f8"
33
license = "MIT"
44
authors = ["Michele GHIOTTI", "Giovanni PAGLIARINI", "Edoardo PONSANESI", "Eduard I. STAN"]
5-
version = "0.10.0"
5+
version = "0.10.1"
66

77
[deps]
88
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
9-
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
109
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
11-
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
1210
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
1311
FunctionWrappers = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e"
14-
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
15-
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
1612
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
1713
Lazy = "50d2b5c4-7a5e-59d5-8109-a42b560f39c0"
18-
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
19-
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
2014
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
21-
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
2215
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
23-
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
2416
SoleBase = "4475fa32-7023-44a0-aa70-4813b230e492"
2517
SoleData = "123f1ae1-6307-4526-ab5b-aab3a92a2b8c"
2618
SoleLogics = "b002da8f-3cb3-4d91-bbe3-2953433912b5"
2719
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
28-
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
29-
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
3020
ThreadSafeDicts = "4239201d-c60e-5e0a-9702-85d713665ba7"
31-
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
3221

3322
[weakdeps]
3423
DecisionTree = "7806a523-6efd-50cb-b5f6-3fa6f1930dbb"
@@ -40,53 +29,48 @@ XGBoostExt = "XGBoost"
4029

4130
[compat]
4231
AbstractTrees = "0.4"
43-
BenchmarkTools = "1"
44-
CSV = "0.10"
4532
CategoricalArrays = "0.10"
46-
DataFrames = "1"
47-
DataStructures = "0.18"
48-
DecisionTree = "0.12"
4933
FillArrays = "1"
5034
FunctionWrappers = "1"
51-
Graphs = "1.8"
52-
HTTP = "1.9"
5335
IterTools = "1"
54-
Lazy = "0.15.1"
55-
MLJ = "0.19 - 0.20"
56-
MLJBase = "1.6 - 1.7"
57-
MLJDecisionTreeInterface = "0.4"
58-
MLJModelInterface = "1.8"
36+
Lazy = "0.15"
5937
PrettyTables = "2.2"
60-
ProgressMeter = "1"
61-
Random = "1"
6238
Reexport = "1"
63-
Revise = "3"
6439
SoleBase = "0.13"
65-
SoleData = "0.15, 0.16"
40+
SoleData = "0.16"
6641
SoleLogics = "0.13"
6742
StatsBase = "0.30 - 0.34"
68-
Suppressor = "0.2"
69-
Tables = "1"
7043
ThreadSafeDicts = "0.1"
71-
XGBoost = "2"
72-
ZipFile = "0.10"
7344
julia = "1"
7445

7546
[extras]
76-
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
7747
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
48+
DecisionTree = "7806a523-6efd-50cb-b5f6-3fa6f1930dbb"
49+
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
7850
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
7951
MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7"
80-
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
8152
MLJDecisionTreeInterface = "c6f25543-311c-4c74-83dc-3ea6d1015661"
8253
MLJModelInterface = "e80e1ace-859a-464e-9ed9-23947d8ae3ea"
8354
MLJXGBoostInterface = "54119dfa-1dab-4055-a167-80440f4f7a91"
8455
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
8556
MultiData = "8cc5100c-b3d1-4f82-90cb-0ea93d317aba"
86-
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
8757
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
88-
SoleData = "123f1ae1-6307-4526-ab5b-aab3a92a2b8c"
8958
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
59+
XGBoost = "009559a3-9522-5dbb-924b-0b6ed2b22bb9"
9060

9161
[targets]
92-
test = ["Test", "DataFrames", "Random", "MLJ", "MLJXGBoostInterface", "MultiData", "Markdown", "InteractiveUtils", "BenchmarkTools", "MLJBase", "XGBoost", "DecisionTree", "MLJDecisionTreeInterface", "SoleData"]
62+
test = [
63+
"DataFrames",
64+
"DecisionTree",
65+
"Distributed",
66+
"InteractiveUtils",
67+
"MLJ",
68+
"MLJDecisionTreeInterface",
69+
"MLJModelInterface",
70+
"MLJXGBoostInterface",
71+
"Markdown",
72+
"MultiData",
73+
"Random",
74+
"Test",
75+
"XGBoost"
76+
]

TODO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ Test:
5151
# Distribution of covered examples for consequent
5252
# Distribution of examples on which the rule was built
5353
✔ Testing parser error @done(24-05-31 11:12)
54-
54+
☐ Add test for rule-extraction.jl
5555
Questions:
56-
✔ Readmetrics for CN2 statistics @done(24-05-31 11:12)
56+
✔ Readmetrics for CN2 statistics @done(24-05-31 11:12)

ext/DecisionTreeExt.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import DecisionTree as DT
99
function get_condition(featid, featval, featurenames)
1010
test_operator = (<)
1111
# @show fieldnames(typeof(tree))
12-
feature = !isnothing(featurenames) ? VariableValue(featurenames[featid]) : VariableValue(featid)
12+
feature = isnothing(featurenames) ? VariableValue(featid) : VariableValue(featid, featurenames[featid])
1313
return ScalarCondition(feature, test_operator, featval)
1414
end
1515

@@ -106,9 +106,16 @@ function SoleModels.solemodel(
106106
return m
107107
end
108108

109-
function SoleModels.solemodel(tree::DT.InfoNode; keep_condensed = false, featurenames = true, classlabels = tree.info.classlabels, kwargs...)
109+
function SoleModels.solemodel(
110+
tree::DT.InfoNode{T,orig_O};
111+
keep_condensed=false,
112+
featurenames=true,
113+
# classlabels=tree.info.classlabels,
114+
kwargs...
115+
) where {T,orig_O}
110116
# @show fieldnames(typeof(tree))
111117
featurenames = featurenames == true ? tree.info.featurenames : featurenames
118+
classlabels = haskey(tree.info, :classlabels) ? tree.info.classlabels : nothing
112119

113120
root, info = begin
114121
if keep_condensed

0 commit comments

Comments
 (0)