ModalDecisionTrees

Julia implementation of Modal Decision Trees & Forests, for interpretable classification of spatial and temporal data. Long live Symbolic Learning!!

https://github.com/aclai-lab/modaldecisiontrees.jl

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, springer.com
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary

Keywords

decision-trees logic machine-learning modal-logic symbolic-learning time-series-classification
Last synced: 6 months ago · JSON representation ·

Repository

Julia implementation of Modal Decision Trees & Forests, for interpretable classification of spatial and temporal data. Long live Symbolic Learning!!

Basic Info
  • Host: GitHub
  • Owner: aclai-lab
  • License: other
  • Language: Julia
  • Default Branch: main
  • Homepage:
  • Size: 2.85 MB
Statistics
  • Stars: 11
  • Watchers: 2
  • Forks: 2
  • Open Issues: 16
  • Releases: 20
Topics
decision-trees logic machine-learning modal-logic symbolic-learning time-series-classification
Created over 2 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

Modal Decision Trees & Forests

Stable Dev Build Status Coverage Binder <!-- Code Style: Blue -->

Interpretable models for native time-series & image classification!

This package provides algorithms for learning decision trees and decision forests with enhanced abilities. Leveraging the express power of Modal Logic, these models can extract temporal/spatial patterns, and can natively handle time series and images (without any data preprocessing). Currently available via MLJ.jl and Sole.jl.

Features & differences with DecisionTree.jl:

The MLJ models provided (ModalDecisionTree and ModalRandomForest) can act as drop in replacements for DecisionTree.jl's tree and forest models. The main difference is that the two models provided are probabilistic and can perform both classification (with y labels of type String or CategoricalValue), and regression (with numeric y labels). <!-- Also featureimportance = :impurity is not supported --> Additionally, these models: - Are able to handle variables that are AbstractVector{<:Real} or AbstractMatrix{<:Real}; - Support multimodal learning (e.g., learning from combinations of scalars, time series and images); - A unique algorithm that extends CART and C4.5; <!-- - Fully optimized implementation (fancy data structures, multithreading, memoization, minification, Pareto-based pruning optimizations, etc); --> <!-- - TODO --> <!-- - Four pruning conditions: maxdepth, minsamplesleaf, minpurityincrease, maxpurityat_leaf --> <!-- TODO - Top-down pre-pruning & post-pruning --> <!-- - Bagging (Random Forests) TODO dillo meglio -->

Current limitations (also see TODOs):

  • Only supports numeric features;
  • Does not support missing or NaN values.

JuliaCon 2022 8-minute talk

Installation & Usage

Simply type the following commands in Julia's REPL:

```julia

Install package

using Pkg; Pkg.add("MLJ"); using Pkg; Pkg.add("ModalDecisionTrees");

Import packages

using MLJ using ModalDecisionTrees using Random

Load an example dataset (a temporal one)

X, y = ModalDecisionTrees.load_japanesevowels() N = length(y)

Instantiate an MLJ machine based on a Modal Decision Tree with 4 samples at leaf

mach = machine(ModalDecisionTree(minsamplesleaf=4), X, y)

Split dataset

p = randperm(N) trainidxs, testidxs = p[1:round(Int, N.8)], p[round(Int, N.8)+1:end]

Fit

fit!(mach, rows=train_idxs)

Perform predictions, compute accuracy

yhat = predictmode(mach, X[testidxs,:]) accuracy = MLJ.accuracy(yhat, y[test_idxs])

Print model

report(mach).printmodel(3)

Access raw model

model = fitted_params(mach).model ```

Want to know more?

Della Monica, Dario, et al. "Decision trees with a modal flavor." International Conference of the Italian Association for Artificial Intelligence. Cham: Springer International Publishing, 2022.

Most of the works in symbolic learning are based either on Propositional Logics (PLs) or First-order Logics (FOLs); PLs are the simplest kind of logic and can only handle tabular data, while FOLs can express complex entity-relation concepts. Machine Learning with FOLs enables handling data with complex topologies, such as time series, images, or videos; however, these logics are computationally challenging. Instead, Modal Logics (e.g. Interval Logic) represent a perfect trade-off in terms of computational tractability and expressive power, and naturally lend themselves for expressing some forms of temporal/spatial reasoning.

Recently, symbolic learning techniques such as Decision Trees, Random Forests and Rule-Based models have been extended to the use of Modal Logics of time and space. Modal Decision Trees and Modal Random Forests have been applied to classification tasks, showing statistical performances that are often comparable to those of functional methods (e.g., neural networks), while providing, at the same time, highly-interpretable classification models. Examples of these tasks are COVID-19 diagnosis from cough/breath audio [1], [2], land cover classification from aereal images [3], EEG-related tasks [4], and gas turbine trip prediction. This technology also offers a natural extension for multimodal learning [5].

Credits

ModalDecisionTrees.jl lives within the Sole.jl framework for symbolic machine learning.

The package is developed by the ACLAI Lab @ University of Ferrara.

Thanks to Ben Sadeghi (@bensadeghi), author of DecisionTree.jl, which inspired the construction of this package.

Owner

  • Name: Applied Computational Logic and Artificial Intelligence Laboratory
  • Login: aclai-lab
  • Kind: organization
  • Email: aclai@unife.it
  • Location: Italy

Applied Computational Logic and Artificial Intelligence (ACLAI) Laboratory of the Department of Mathematics and Computer Science, University of Ferrara

Citation (CITATION.bib)

@article{Manzella2023-nd,
	title    = "The voice of {COVID-19}: Breath and cough recording
							classification with temporal decision trees and random forests",
	author   = "Manzella, F and Pagliarini, G and Sciavicco, G and Stan, I E",
	abstract = "Symbolic learning is the logic-based approach to machine
							learning, and its mission is to provide algorithms and
							methodologies to extract logical information from data and
							express it in an interpretable way. Interval temporal logic has
							been recently proposed as a suitable tool for symbolic learning,
							specifically via the design of an interval temporal logic
							decision tree extraction algorithm. In order to improve their
							performances, interval temporal decision trees can be embedded
							into interval temporal random forests, mimicking the
							corresponding schema at the propositional level. In this article
							we consider a dataset of cough and breath sample recordings of
							volunteer subjects, labeled with their COVID-19 status,
							originally collected by the University of Cambridge. By
							interpreting such recordings as multivariate time series, we
							study the problem of their automated classification using
							interval temporal decision trees and forests. While this problem
							has been approached with the same dataset as well as with other
							datasets, in all cases, non-symbolic learning methods (usually,
							deep learning-based) have been applied to solve it; in this
							article we apply a symbolic approach, and show that it does not
							only outperform the state-of-the-art obtained with the same
							dataset, but its results are also superior to those of most
							non-symbolic techniques applied on other datasets. As an added
							bonus, thanks to the symbolic nature of our approach, we are also
							able to extract explicit knowledge to help physicians
							characterize typical COVID-positive cough and breath.",
	journal  = "Artif Intell Med",
	volume   =  137,
	pages    = "102486",
	month    =  feb,
	year     =  2023,
	address  = "Netherlands",
	keywords = "COVID-19; Interval temporal decision trees and forests; Symbolic
							models",
	language = "en"
}

GitHub Events

Total
  • Create event: 27
  • Issues event: 5
  • Release event: 1
  • Delete event: 36
  • Issue comment event: 5
  • Push event: 55
  • Pull request event: 43
  • Fork event: 2
Last Year
  • Create event: 27
  • Issues event: 5
  • Release event: 1
  • Delete event: 36
  • Issue comment event: 5
  • Push event: 55
  • Pull request event: 43
  • Fork event: 2

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 174
  • Total Committers: 6
  • Avg Commits per committer: 29.0
  • Development Distribution Score (DDS): 0.057
Past Year
  • Commits: 26
  • Committers: 3
  • Avg Commits per committer: 8.667
  • Development Distribution Score (DDS): 0.231
Top Committers
Name Email Commits
giopaglia 2****a 164
PasoStudio73 p****3@g****m 5
Michele21 g****2@g****m 2
Alberto Paparella 5****a 1
mauro-milella m****o@l****t 1
CompatHelper Julia c****y@j****g 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 7
  • Total pull requests: 92
  • Average time to close issues: 40 minutes
  • Average time to close pull requests: 5 months
  • Total issue authors: 3
  • Total pull request authors: 2
  • Average comments per issue: 13.86
  • Average comments per pull request: 0.03
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 86
Past Year
  • Issues: 5
  • Pull requests: 37
  • Average time to close issues: about 1 hour
  • Average time to close pull requests: about 1 month
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.08
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 31
Top Authors
Issue Authors
  • PasoStudio73 (5)
  • giopaglia (1)
  • JuliaTagBot (1)
Pull Request Authors
  • github-actions[bot] (83)
  • PasoStudio73 (7)
Top Labels
Issue Labels
bug (1) enhancement (1) suggested change (1)
Pull Request Labels
enhancement (2) suggested change (2)

Packages

  • Total packages: 1
  • Total downloads:
    • julia 2 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 21
juliahub.com: ModalDecisionTrees

Julia implementation of Modal Decision Trees & Forests, for interpretable classification of spatial and temporal data. Long live Symbolic Learning!!

  • Versions: 21
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 2 Total
Rankings
Dependent repos count: 10.2%
Average: 37.0%
Dependent packages count: 37.6%
Stargazers count: 46.0%
Forks count: 54.2%
Last synced: 6 months ago

Dependencies

.github/workflows/CompatHelper.yml actions
  • julia-actions/setup-julia v1 composite
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • codecov/codecov-action v3 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/Documentation.yml actions
  • actions/checkout v2 composite
  • julia-actions/setup-julia latest composite