Skip to content

aclai-lab/SolePostHoc.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SolePostHoc.jl – Post-Hoc Analysis for Symbolic Learning

Stable CI Last Commit Coverage License Julia Issues

In a nutshell

SolePostHoc.jl provides a comprehensive suite of post-hoc analysis and optimization tools for symbolic learning models. The package enables knowledge extraction from both symbolic and non-symbolic models through a unified interface, facilitating the comparison of different interpretation methods while maintaining consistency and ease of use.

Key Features

Knowledge Extraction Algorithms

  • LUMEN;
  • InTrees;
  • TREPAN;
  • REFNE;
  • RuleCOSI+;
  • BATrees.

Model Analysis Capabilities

  • Rule extraction from decision trees, random forests, and black-box models
  • Model transformation and enhancement through rule minimization
  • Performance optimization while preserving interpretability
  • Support for surrogate model generation and knowledge distillation

Unified Interface

All algorithms are accessible through a consistent API via the SolePostHoc.modalextractrules function, enabling seamless comparison between different extraction methods.

Usage

Direct Algorithm Access

# Call specific algorithms directly
extracted_rules = lumen(model)
extracted_rules = intrees(model, X_test, y_test)

Unified Interface (Recommended)

# Use the unified interface with rule extractors
extractor_lumen = LumenRuleExtractor()
extractor_intrees = IntreesRuleExtractor()

decision_set_lumen = modalextractrules(extractor_lumen, model)
decision_set_intrees = modalextractrules(extractor_intrees, model, X_test, y_test)

The unified interface converts outputs into DecisionSet objects—vectors of propositional logical rules in Disjunctive Normal Form (DNF), with one rule per class label.

Example: Rule Extraction from Random Forest

using SolePostHoc

# Assume we have a trained Random Forest on the Iris dataset
rf_model = train_random_forest(X_train, y_train)

# Extract interpretable rules using LUMEN
extractor = LumenRuleExtractor()
interpretable_rules = modalextractrules(extractor, rf_model)

# The result is a DecisionSet with logical rules explaining the model's decisions

Algorithm Categories

Surrogate Trees: Approximate complex models with interpretable decision trees.

Knowledge Distillation: Transfer knowledge from complex to transparent models.

Rule Extraction: Derive clear logical rules from any machine learning model.

Integration

SolePostHoc.jl is part of the Sole.jl ecosystem:

References

For theoretical foundations, see: Modal Symbolic Learning: from theory to practice, G. Pagliarini (2024)

About

Developed by the ACLAI Lab @ University of Ferrara.

About

Sole (SymbOlic LEarning) Post Hoc Analysis Module

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 8