Skip to content

Lumen refactoring #49

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

Merged
merged 49 commits into from
Jun 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e4d257d
fix if 1 lmf [TodoReview this]
Perro2110 Jan 13, 2025
67af772
Add test, add iscomplete
giopaglia Jan 20, 2025
ebe5d9d
Merge branch 'gio/refractoring' of https://github.com/aclai-lab/SoleM…
Perro2110 Jan 23, 2025
a287352
refactoring name
Perro2110 Feb 19, 2025
b2312c1
minor fix
Perro2110 Mar 11, 2025
4bc2854
update image_family
Perro2110 Mar 29, 2025
afd1161
decisiontree and xgboost ext working
PasoStudio73 Mar 29, 2025
183de68
minor fix in Project.toml for compatibility
Perro2110 Apr 1, 2025
8ee5cf3
Fix
giopaglia Apr 2, 2025
8ef0051
Merge branch 'lumen-refactoring' of https://github.com/aclai-lab/Sole…
giopaglia Apr 2, 2025
d870851
debug xgboost, not yet ready
PasoStudio73 Apr 2, 2025
5de4302
Refining XGBoost
PasoStudio73 Apr 9, 2025
2ad6442
xgboost float predict issue
PasoStudio73 Apr 11, 2025
dd23501
xgboost predict found areas requireing fixes
PasoStudio73 Apr 14, 2025
93fba4d
XGBoost test passed
PasoStudio73 Apr 14, 2025
ae4e5a1
working on tests
PasoStudio73 Apr 14, 2025
52deed0
codecov working
PasoStudio73 Apr 14, 2025
7c4f025
removed MLJXGBoostInterface in tests
PasoStudio73 Apr 14, 2025
6593222
still fixing codecov
PasoStudio73 Apr 14, 2025
2828e50
again
PasoStudio73 Apr 14, 2025
7c3fbde
guess what?
PasoStudio73 Apr 14, 2025
a9acf2e
update ci.yml breaking!
PasoStudio73 Apr 14, 2025
828c446
again
PasoStudio73 Apr 14, 2025
a7ced5b
last try
PasoStudio73 Apr 14, 2025
fba387a
reverted ci.yml
PasoStudio73 Apr 15, 2025
1e0971f
atom getter
PasoStudio73 Apr 15, 2025
53161b1
adaboost test
PasoStudio73 Apr 15, 2025
d7a5d15
xgboost classifier ready, tested and working
PasoStudio73 Apr 16, 2025
c948f27
xgboost apply!
PasoStudio73 Apr 16, 2025
ef11380
extractrules --> modalextractrules
Perro2110 Apr 18, 2025
36d7ef9
Merge branch 'lumen-refactoring' of https://github.com/aclai-lab/Sole…
Perro2110 Apr 18, 2025
d26e198
minor add in TODO
Perro2110 Apr 18, 2025
9638489
fix tests & deps
PasoStudio73 Apr 18, 2025
b2a4869
posthoc
PasoStudio73 Apr 23, 2025
16476a9
Merge branch 'devTest' into lumen-refactoring
Perro2110 Apr 26, 2025
1b5a6c6
test fixed
PasoStudio73 Apr 27, 2025
dbe8e83
fix extras deps
PasoStudio73 Apr 27, 2025
6c34e4d
cleaned unused packages, tests still working
PasoStudio73 Apr 27, 2025
bcefa20
updated SoleData dep
PasoStudio73 Apr 27, 2025
ba4d143
updated solelogics dep
PasoStudio73 Apr 27, 2025
72efb54
added a @show for checking
PasoStudio73 May 2, 2025
bd889ac
removed guard
PasoStudio73 May 2, 2025
83ffb33
test working
PasoStudio73 Jun 7, 2025
54ae95f
updated github ci
PasoStudio73 Jun 7, 2025
4275b3d
added distributed package
PasoStudio73 Jun 7, 2025
42c052e
added MLJXGBoostInterface package
PasoStudio73 Jun 7, 2025
1218cb1
fix XGB
PasoStudio73 Jun 7, 2025
37daad6
added MMI
PasoStudio73 Jun 7, 2025
d3f8dfe
Merge branch 'main' into lumen-refactoring
PasoStudio73 Jun 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .cirrus.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
16 changes: 16 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ on:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: "3"
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand Down
49 changes: 38 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,47 @@
name: Upload coverage reports to Codecov
on: [push, pull_request]
name: CI
on:
push:
branches:
- lumen-refactoring
tags: ['*']
pull_request:
workflow_dispatch:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
run:
runs-on: ubuntu-latest
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
strategy:
fail-fast: false
matrix:
version:
- '1'
- 'lts'
- 'pre'
os:
- ubuntu-latest
arch:
- x64
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Julia 1.9.0
uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1.9.0"
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
slug: aclai-lab/SoleModels.jl

fail_ci_if_error: false
58 changes: 21 additions & 37 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,22 @@ name = "SoleModels"
uuid = "4249d9c7-3290-4ddd-961c-e1d3ec2467f8"
license = "MIT"
authors = ["Michele GHIOTTI", "Giovanni PAGLIARINI", "Edoardo PONSANESI", "Eduard I. STAN"]
version = "0.10.0"
version = "0.10.1"

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

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

[compat]
AbstractTrees = "0.4"
BenchmarkTools = "1"
CSV = "0.10"
CategoricalArrays = "0.10"
DataFrames = "1"
DataStructures = "0.18"
DecisionTree = "0.12"
FillArrays = "1"
FunctionWrappers = "1"
Graphs = "1.8"
HTTP = "1.9"
IterTools = "1"
Lazy = "0.15.1"
MLJ = "0.19 - 0.20"
MLJBase = "1.6 - 1.7"
MLJDecisionTreeInterface = "0.4"
MLJModelInterface = "1.8"
Lazy = "0.15"
PrettyTables = "2.2"
ProgressMeter = "1"
Random = "1"
Reexport = "1"
Revise = "3"
SoleBase = "0.13"
SoleData = "0.15, 0.16"
SoleData = "0.16"
SoleLogics = "0.13"
StatsBase = "0.30 - 0.34"
Suppressor = "0.2"
Tables = "1"
ThreadSafeDicts = "0.1"
XGBoost = "2"
ZipFile = "0.10"
julia = "1"

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

[targets]
test = ["Test", "DataFrames", "Random", "MLJ", "MLJXGBoostInterface", "MultiData", "Markdown", "InteractiveUtils", "BenchmarkTools", "MLJBase", "XGBoost", "DecisionTree", "MLJDecisionTreeInterface", "SoleData"]
test = [
"DataFrames",
"DecisionTree",
"Distributed",
"InteractiveUtils",
"MLJ",
"MLJDecisionTreeInterface",
"MLJModelInterface",
"MLJXGBoostInterface",
"Markdown",
"MultiData",
"Random",
"Test",
"XGBoost"
]
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ Test:
# Distribution of covered examples for consequent
# Distribution of examples on which the rule was built
✔ Testing parser error @done(24-05-31 11:12)

☐ Add test for rule-extraction.jl
Questions:
✔ Readmetrics for CN2 statistics @done(24-05-31 11:12)
✔ Readmetrics for CN2 statistics @done(24-05-31 11:12)
11 changes: 9 additions & 2 deletions ext/DecisionTreeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import DecisionTree as DT
function get_condition(featid, featval, featurenames)
test_operator = (<)
# @show fieldnames(typeof(tree))
feature = !isnothing(featurenames) ? VariableValue(featurenames[featid]) : VariableValue(featid)
feature = isnothing(featurenames) ? VariableValue(featid) : VariableValue(featid, featurenames[featid])
return ScalarCondition(feature, test_operator, featval)
end

Expand Down Expand Up @@ -106,9 +106,16 @@ function SoleModels.solemodel(
return m
end

function SoleModels.solemodel(tree::DT.InfoNode; keep_condensed = false, featurenames = true, classlabels = tree.info.classlabels, kwargs...)
function SoleModels.solemodel(
tree::DT.InfoNode{T,orig_O};
keep_condensed=false,
featurenames=true,
# classlabels=tree.info.classlabels,
kwargs...
) where {T,orig_O}
# @show fieldnames(typeof(tree))
featurenames = featurenames == true ? tree.info.featurenames : featurenames
classlabels = haskey(tree.info, :classlabels) ? tree.info.classlabels : nothing

root, info = begin
if keep_condensed
Expand Down
Loading