Skip to content

Commit 3b39a80

Browse files
committed
Merge branch 'dev'
2 parents 3ec12a7 + b1a6b11 commit 3b39a80

31 files changed

+926
-1560
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22
on:
33
push:
44
branches:
5-
- main
5+
- dev
66
tags: ['*']
77
pull_request:
88
workflow_dispatch:
@@ -24,9 +24,10 @@ jobs:
2424
matrix:
2525
version:
2626
- '1'
27-
# - 'lts' broken: expects SolePostHoc to be registered
27+
# - 'lts' # julia lts unsupported
2828
os:
2929
- ubuntu-latest
30+
- ubuntu-24.04
3031
arch:
3132
- x64
3233
steps:
@@ -37,11 +38,11 @@ jobs:
3738
arch: ${{ matrix.arch }}
3839
- uses: julia-actions/cache@v2
3940
- uses: julia-actions/julia-buildpkg@v1
40-
env:
41-
PYTHON: ""
41+
# env:
42+
# PYTHON: ""
4243
- uses: julia-actions/julia-runtest@v1
43-
env:
44-
PYTHON: ""
44+
# env:
45+
# PYTHON: ""
4546
- uses: julia-actions/julia-processcoverage@v1
4647
- uses: codecov/codecov-action@v5
4748
with:

Project.toml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,51 @@
11
name = "SoleXplorer"
22
uuid = "5816ab97-8dbe-4a0a-b2fb-0334bd9876ed"
33
version = "0.1.0"
4-
authors = ["Lorenzo BALBONI", "Federico MANZELLA", "Mauro MILELLA", "Giovanni PAGLIARINI", "Alberto PAPARELLA", "Riccardo PASINI", "Marco PERROTTA"]
4+
authors = ["Lorenzo BALBONI", "Michele GHIOTTI", "Federico MANZELLA", "Mauro MILELLA", "Giovanni PAGLIARINI", "Alberto PAPARELLA", "Riccardo PASINI", "Marco PERROTTA"]
55

66
[deps]
7-
Catch22 = "acdeb78f-3d39-4310-8fdf-6d75c17c6d5a"
7+
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
88
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
9+
DataTreatments = "1b3ff5f2-9b56-42a2-b38a-76a033f741ca"
10+
DimensionalData = "0703355e-b756-11e9-17c0-8b28908087d0"
11+
Imbalance = "c709b415-507b-45b7-9a3d-1767c89fde68"
912
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
1013
MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7"
11-
MLJBalancing = "45f359ea-796d-4f51-95a5-deb1a414c586"
1214
MLJDecisionTreeInterface = "c6f25543-311c-4c74-83dc-3ea6d1015661"
1315
MLJParticleSwarmOptimization = "17a086e9-ed03-4f30-ab88-8b63f0f6126c"
1416
MLJXGBoostInterface = "54119dfa-1dab-4055-a167-80440f4f7a91"
15-
ModalAssociationRules = "fb95e5f7-b6b0-4744-a282-88ebeeae65a3"
1617
ModalDecisionTrees = "e54bda2e-c571-11ec-9d64-0242ac120002"
1718
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1819
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
19-
SoleBase = "4475fa32-7023-44a0-aa70-4813b230e492"
2020
SoleData = "123f1ae1-6307-4526-ab5b-aab3a92a2b8c"
2121
SoleModels = "4249d9c7-3290-4ddd-961c-e1d3ec2467f8"
2222
SolePostHoc = "cf1aa0c3-12c9-4ebe-9bdc-bd6c2ca79b72"
2323
XGBoost = "009559a3-9522-5dbb-924b-0b6ed2b22bb9"
2424

2525
[compat]
26-
Catch22 = "0.7"
26+
CategoricalArrays = "0.10 - 1"
2727
DataFrames = "1"
28+
DataTreatments = "0.2"
29+
DimensionalData = "0.29"
30+
Imbalance = "0.1"
2831
JLD2 = "0.6"
2932
MLJ = "0.20, 0.21, 0.22"
3033
MLJBalancing = "0.1"
3134
MLJDecisionTreeInterface = "0.4"
3235
MLJParticleSwarmOptimization = "0.1"
3336
MLJXGBoostInterface = "0.3"
34-
ModalAssociationRules = "0.2"
3537
ModalDecisionTrees = "0.5"
3638
Random = "1"
3739
Reexport = "1"
38-
SoleBase = "0.13"
3940
SoleData = "0.16"
4041
SoleModels = "0.10"
4142
SolePostHoc = "0.1"
4243
XGBoost = "2.5"
4344
julia = "1"
4445

4546
[extras]
46-
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
47-
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
4847
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
4948
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5049

5150
[targets]
52-
test = ["DelimitedFiles", "Downloads", "JLD2", "Test"]
51+
test = ["JLD2", "Test"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ modelc = symbolic_analysis(
6262

6363
```julia
6464
# Load a temporal dataset
65-
natopsloader = NatopsLoader()
65+
natopsloader = SoleXplorer.NatopsLoader()
6666
Xts, yts = SoleXplorer.load(natopsloader)
6767

6868
# Train a modal decision tree

TODO.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ resultsts = symbolic_analysis(
1313
Xts, yts;
1414
model=XGBoostClassifier(),
1515
resampling=(type=TimeSeriesCV(nfolds=5), rng=Xoshiro(1)),
16-
win=AdaptiveWindow(nwindows=3, relative_overlap=0.3),
17-
modalreduce=mean,
16+
win=adaptivewindow(nwindows=3, overlap=0.3),
17+
reducefunc=mean,
1818
features=[maximum, minimum],
1919
measures=(accuracy, log_loss, confusion_matrix, kappa)
2020
)
@@ -66,13 +66,6 @@ rivederne la propagazione: ad oggi non è ancora formalmente testata
6666
# ---------------------------------------------------------------------------- #
6767
Bisogna pensare anche ai modelli non supervisionati: apply(m, X)
6868

69-
# ---------------------------------------------------------------------------- #
70-
# timeout #
71-
# ---------------------------------------------------------------------------- #
72-
l'algoritmo è pronto, sia il mio che quello mio di perry
73-
il più performante vince
74-
ma lo sviluppo sarà su un altra repo.
75-
7669
# ---------------------------------------------------------------------------- #
7770
# multi thread #
7871
# ---------------------------------------------------------------------------- #

docs/src/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Key features:
1515
* Works also on time-series based datasets using modal logic.
1616
* View rules and their metrics.
1717
* Inspect logical formulas and their evaluation.
18-
* View modal rule associations.
19-
* Integrated GUI.
18+
<!-- * View modal rule associations. -->
19+
<!-- * Integrated GUI. -->
2020

2121
## Installation
2222
```julia
@@ -59,7 +59,7 @@ modelc = symbolic_analysis(
5959
### Temporal association rules
6060
```julia
6161
# Load a temporal dataset
62-
natopsloader = NatopsLoader()
62+
natopsloader = SoleXplorer.NatopsLoader()
6363
Xts, yts = SoleXplorer.load(natopsloader)
6464

6565
# Train a modal decision tree
@@ -78,7 +78,7 @@ SoleXplorer extensively uses the following packages:
7878
* [`SoleLogics`](https://github.com/aclai-lab/SoleLogics.jl): modal and temporal logic systems.
7979
* [`MLJ`](https://github.com/JuliaAI/MLJ.jl): provides all machine learning frameworks.
8080
* [`SolePostHoc`](https://github.com/aclai-lab/SolePostHoc.jl): for rule extraction.
81-
* [`ModalAssociationRules`](https://github.com/aclai-lab/ModalAssociationRules.jl): for mining association rules.
81+
<!-- * [`ModalAssociationRules`](https://github.com/aclai-lab/ModalAssociationRules.jl): for mining association rules. -->
8282

8383
## About
8484
The package is developed by the [ACLAI Lab](https://aclai.unife.it/en/) @ University of Ferrara.

docs/src/symbolic_analysis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ModelSet
2020
dsetup(m::ModelSet)
2121
solemodels(m::ModelSet)
2222
rules(m::ModelSet)
23-
associations(m::ModelSet)
23+
<!-- associations(m::ModelSet) -->
2424
performance(m::ModelSet)
2525
```
2626

docs/src/treatement.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,30 @@ With multidimensional datasets there are two possible types of work:
1818
treatment(X::AbstractDataFrame, treat::Symbol)
1919
```
2020

21-
Windowing strategies availables for reduce/aggregation time-series datasets.
21+
<!-- Windowing strategies availables for reduce/aggregation time-series datasets.
2222
2323
```@docs
2424
MovingWindow
2525
WholeWindow
2626
SplitWindow
27-
AdaptiveWindow
27+
adaptivewindow
2828
AbstractWinFunction
2929
WinFunction
30-
```
30+
``` -->
3131

3232
# [Featuresets](@id featuresets)
3333

3434
### Basic Statistics
3535
Standard statistical measures: `maximum`, `minimum`, `mean`, `median`, `std`, `cov`
3636

37-
### Catch22 Features
37+
<!-- ### Catch22 Features
3838
Canonical time-series characteristics covering:
3939
- Distribution properties and extreme events
4040
- Linear and nonlinear autocorrelation structures
4141
- Forecasting performance and scaling properties
42-
- Symbolic dynamics and transition patterns
42+
- Symbolic dynamics and transition patterns -->
4343

44-
### Predefined Feature Sets
44+
<!-- ### Predefined Feature Sets
4545
4646
- [`base_set`](@ref): Minimal statistical features (4 features)
4747
- [`catch9`](@ref): Curated subset combining statistics + key Catch22 (9 features)
@@ -52,20 +52,20 @@ Canonical time-series characteristics covering:
5252
5353
The Catch22 features are based on the Canonical Time-series Characteristics:
5454
- **Repository**: https://github.com/DynamicsAndNeuralSystems/catch22
55-
- **Paper**: Lubba, C.H., Sethi, S.S., Knaute, P. et al. "catch22: CAnonical Time-series CHaracteristics." *Data Min Knowl Disc* 33, 1821–1852 (2019). https://doi.org/10.1007/s10618-019-00647-x
55+
- **Paper**: Lubba, C.H., Sethi, S.S., Knaute, P. et al. "catch22: CAnonical Time-series CHaracteristics." *Data Min Knowl Disc* 33, 1821–1852 (2019). https://doi.org/10.1007/s10618-019-00647-x -->
5656

57-
```@docs
57+
<!-- ```@docs
5858
base_set
5959
catch9
6060
catch22_set
6161
complete_set
62-
```
62+
``` -->
6363

6464
See also: [`treatment`](@ref), [`setup_dataset`](@ref)
6565

6666
## All Catch22 Features
6767

68-
```@docs
68+
<!-- ```@docs
6969
mode_5
7070
mode_10
7171
embedding_dist
@@ -88,4 +88,4 @@ low_freq_power
8888
centroid_freq
8989
transition_variance
9090
periodicity
91-
```
91+
``` -->

src/SoleXplorer.jl

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module SoleXplorer
22
using Reexport
33

4-
using SoleBase: Label, CLabel, RLabel, XGLabel
5-
using SoleBase: movingwindow, wholewindow, splitwindow, adaptivewindow
64
using SoleData: scalarlogiset
75
using SoleData.Artifacts
6+
7+
@reexport using SoleModels: Label, CLabel, RLabel, XGLabel
88
using SoleModels: Branch, ConstantModel
99
using SoleModels: DecisionEnsemble, DecisionTree, DecisionXGBoost
1010
using SoleModels: AbstractModel, solemodel, weighted_aggregation, apply!
@@ -13,14 +13,15 @@ using SoleModels: RuleExtractor, DecisionSet
1313
@reexport using SoleData.Artifacts: NatopsLoader, load
1414
@reexport using SoleModels: readmetrics
1515

16-
@reexport using SolePostHoc: InTreesRuleExtractor, LumenRuleExtractor, BATreesRuleExtractor
17-
@reexport using SolePostHoc: RULECOSIPLUSRuleExtractor, REFNERuleExtractor, TREPANRuleExtractor
18-
using SolePostHoc
16+
@reexport using SolePostHoc.RuleExtraction: InTreesRuleExtractor, LumenRuleExtractor, BATreesRuleExtractor
17+
# @reexport using SolePostHoc.RuleExtraction: RULECOSIPLUSRuleExtractor
18+
@reexport using SolePostHoc.RuleExtraction: REFNERuleExtractor, TREPANRuleExtractor
19+
using SolePostHoc.RuleExtraction
1920

20-
@reexport using ModalAssociationRules: Item, Atom, ScalarCondition, VariableMin, VariableMax
21-
@reexport using ModalAssociationRules: IA_L, box, diamond
22-
@reexport using ModalAssociationRules: gsupport, gconfidence, glift, gconviction, gleverage
23-
using ModalAssociationRules
21+
# @reexport using ModalAssociationRules: Item, Atom, ScalarCondition, VariableMin, VariableMax
22+
# @reexport using ModalAssociationRules: IA_L, box, diamond
23+
# @reexport using ModalAssociationRules: gsupport, gconfidence, glift, gconviction, gleverage
24+
# using ModalAssociationRules
2425

2526
# ---------------------------------------------------------------------------- #
2627
# MLJ #
@@ -36,28 +37,27 @@ using MLJParticleSwarmOptimization
3637
const PSO = MLJParticleSwarmOptimization
3738
using MLJ
3839
using MLJ: MLJBase, MLJTuning
40+
# custom resampling strategy
41+
import MLJ.MLJBase: train_test_pairs
3942
# balancing
40-
using MLJBalancing
41-
@reexport using MLJBalancing:
43+
using Imbalance
44+
@reexport using Imbalance.MLJ:
4245
BorderlineSMOTE1, ClusterUndersampler, ENNUndersampler, ROSE,
4346
RandomOversampler, RandomUndersampler, RandomWalkOversampler,
4447
SMOTE, SMOTEN, SMOTENC, TomekUndersampler
4548

4649
# ---------------------------------------------------------------------------- #
4750
# external packages #
4851
# ---------------------------------------------------------------------------- #
49-
@reexport using SoleData: load_arff_dataset
52+
@reexport using DataTreatments: movingwindow, wholewindow, splitwindow, adaptivewindow
53+
@reexport using DataTreatments: zscore, sigmoid, pnorm, scale, minmax, center, unitpower, outliersuppress
54+
using DataTreatments
55+
56+
using CategoricalArrays
5057
using DataFrames
5158
using Random
5259
using JLD2
5360

54-
# ---------------------------------------------------------------------------- #
55-
# timeout #
56-
# ---------------------------------------------------------------------------- #
57-
# using TimeOut
58-
59-
const preprocess = "using SoleXplorer\n"
60-
6161
# ---------------------------------------------------------------------------- #
6262
# maybe types #
6363
# ---------------------------------------------------------------------------- #
@@ -76,25 +76,20 @@ const MaybeNTuple = Maybe{NamedTuple}
7676
# ---------------------------------------------------------------------------- #
7777
# feature extraction via Catch22
7878
# export user friendly Catch22 nicknames
79-
export mode_5, mode_10, embedding_dist, acf_timescale, acf_first_min, ami2,
80-
trev, outlier_timing_pos, outlier_timing_neg, whiten_timescale,
81-
forecast_error, ami_timescale, high_fluctuation, stretch_decreasing,
82-
stretch_high, entropy_pairs, rs_range, dfa, low_freq_power, centroid_freq,
83-
transition_variance, periodicity, base_set, catch9, catch22_set, complete_set
84-
using Catch22
85-
include("featureset.jl")
79+
@reexport using DataTreatments: mode_5, mode_10, embedding_dist, acf_timescale,
80+
acf_first_min, ami2, trev, outlier_timing_pos, outlier_timing_neg,
81+
whiten_timescale, forecast_error, ami_timescale, high_fluctuation,
82+
stretch_decreasing, stretch_high, entropy_pairs, rs_range, dfa,
83+
low_freq_power, centroid_freq, transition_variance, periodicity, base_set
84+
@reexport using DataTreatments: catch9, catch22_set, complete_set
8685

8786
# ---------------------------------------------------------------------------- #
8887
# interfaces #
8988
# ---------------------------------------------------------------------------- #
89+
export partition, pCV
9090
export get_X, get_y, get_train, get_test
9191
include("partition.jl")
9292

93-
export AbstractWinFunction, WinFunction
94-
export MovingWindow, WholeWindow, SplitWindow, AdaptiveWindow
95-
export treatment
96-
include("treatment.jl")
97-
9893
# ---------------------------------------------------------------------------- #
9994
# models #
10095
# ---------------------------------------------------------------------------- #
@@ -137,8 +132,8 @@ include("train_test.jl")
137132

138133
include("extractrules.jl")
139134

140-
export Apriori, FPGrowth, Eclat
141-
include("associationrules.jl")
135+
# export Apriori, FPGrowth, Eclat
136+
# include("associationrules.jl")
142137

143138
export AbstractModelSet, ModelSet
144139
export dsetup, solemodels, rules, associations

src/apply.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ get_classlabels(encoding) = [string(encoding[i]) for i in sort(keys(encoding) |
7272
function apply(
7373
m :: Machine{DecisionTreeClassifier},
7474
X :: AbstractDataFrame,
75-
y :: AbstractVector
75+
y :: AbstractVector{<:CLabel}
7676
)::DecisionTree
7777
featurenames = MLJ.report(m).features
7878
classlabels = sort(MLJ.report(m).classes_seen)

0 commit comments

Comments
 (0)