aiii-project-sirocchi-ay2223
https://github.com/pikalab-unibo-students/aiii-project-sirocchi-ay2223
Science Score: 57.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 14 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.6%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: pikalab-unibo-students
- License: apache-2.0
- Language: Python
- Default Branch: projects/sirocchi
- Size: 18.7 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 27
- Releases: 0
Metadata Files
README.md
PSyKE

Some quick links: * Home Page * GitHub Repository * PyPi Repository * Issues
Intro
PSyKE (Platform for Symbolic Knowledge Extraction) is intended as a library for extracting symbolic knowledge (in the form of logic rules) out of sub-symbolic predictors.
More precisely, PSyKE offers a general purpose API for knowledge extraction, and a number of different algorithms implementing it, supporting both classification and regression problems. The extracted knowledge consists of a Prolog theory (i.e., a list of Horn clauses) or an OWL ontology containing SWRL rules.
PSyKE relies on 2ppy (tuProlog in Python) for logic support, which in turn is based on the 2p-Kt logic ecosystem.
Class diagram overview:
PSyKE is designed around the notion of extractor.
More precisely, an Extractor is any object capable of extracting a logic Theory out of a trained sub-symbolic regressor or classifier.
Accordingly, an Extractor is composed of
(i) a trained predictor (i.e., black-box used as an oracle) and
(ii) a set of feature descriptors, and it provides two methods:
* extract: returns a logic theory given a dataset;
* predict: predicts a value using the extracted rules (instead of the original predictor).
Currently, the supported extraction algorithms are: * CART, straightforward extracts rules from both classification and regression decision trees; * Classification: * REAL (Rule Extraction As Learning), generates and generalizes rules strarting from dataset samples; * Trepan, generates rules by inducing a decision tree and possibly exploiting m-of-n expressions; * Regression: * ITER, builds and iteratively expands hypercubes in the input space. Each cube holds a constant value, that is the estimated output for the samples inside the cube; * GridEx, extension of the ITER algorithm that produces shorter rule lists retaining higher fidelity w.r.t. the predictor. * GridREx, extension of GridEx where the output of each hypercube is a linear combination of the input variables and not a constant value.
Users may exploit the PEDRO algorithm, included in PSyKE, to tune the optimal values for GridEx and GridREx hyper-parameters.
We are working on PSyKE to extend its features to encompass explainable clustering tasks, as well as to make more general-purpose the supported extraction algorithms (e.g., by adding classification support to GridEx and GridREx).
Users
End users
PSyKE is deployed as a library on Pypi, and it can therefore be installed as Python package by running:
bash
pip install psyke
Requirements
numpypandasscikit-learn2ppy
Test requirements
skl2onnxonnxruntimeparameterized
Once installed, it is possible to create an extractor from a predictor (e.g. Neural Network, Support Vector Machine, K-Nearest Neighbor, Random Forest, etc.) and from the dataset used to train the predictor.
Note: the predictor must expose a method named
predictto be properly used as an oracle.
End users
A brief example is presented in demo.py script in the demo/ folder.
Using sklearn's Iris dataset we train a K-Nearest Neighbor to predict the correct output class.
Before training, we make the dataset discrete.
After that we create two different extractors: REAL and Trepan.
We output the extracted theory for both extractors.
REAL extracted rules:
iris(PetalLength, PetalWidth, SepalLength, SepalWidth, setosa) :- PetalWidth =< 1.0.
iris(PetalLength1, PetalWidth1, SepalLength1, SepalWidth1, versicolor) :- PetalLength1 > 4.9, SepalWidth1 in [2.9, 3.2].
iris(PetalLength2, PetalWidth2, SepalLength2, SepalWidth2, versicolor) :- PetalWidth2 > 1.6.
iris(PetalLength3, PetalWidth3, SepalLength3, SepalWidth3, virginica) :- SepalWidth3 =< 2.9.
iris(PetalLength4, PetalWidth4, SepalLength4, SepalWidth4, virginica) :- SepalLength4 in [5.4, 6.3].
iris(PetalLength5, PetalWidth5, SepalLength5, SepalWidth5, virginica) :- PetalWidth5 in [1.0, 1.6].
Trepan extracted rules:
iris(PetalLength6, PetalWidth6, SepalLength6, SepalWidth6, virginica) :- PetalLength6 > 3.0, PetalLength6 in [3.0, 4.9].
iris(PetalLength7, PetalWidth7, SepalLength7, SepalWidth7, versicolor) :- PetalLength7 > 3.0.
iris(PetalLength8, PetalWidth8, SepalLength8, SepalWidth8, setosa) :- true.
Developers
Working with PSyKE codebase requires a number of tools to be installed:
* Python 3.9
+ Python version greater than 3.9.x are currently not supported
- JDK 11+ (please ensure the
JAVA_HOMEenvironment variable is properly configured) - Git 2.20+
Develop PSyKE with PyCharm
To participate in the development of PSyKE, we suggest the PyCharm IDE.
Importing the project
- Clone this repository in a folder of your preference using
git_cloneappropriately - Open PyCharm
- Select
Open - Navigate your file system and find the folder where you cloned the repository
- Click
Open
Developing the project
Contributions to this project are welcome. Just some rules:
* We use git flow, so if you write new features, please do so in a separate feature/ branch
* We recommend forking the project, developing your code, then contributing back via pull request
* Commit often
* Stay in sync with the develop (or master) branch (pull frequently if the build passes)
* Do not introduce low quality or untested code
Issue tracking
If you meet some problems in using or developing PSyKE, you are encouraged to signal it through the project "Issues" section on GitHub.
Owner
- Name: pikalab-unibo-students
- Login: pikalab-unibo-students
- Kind: organization
- Repositories: 11
- Profile: https://github.com/pikalab-unibo-students
Citation (CITATION.md)
To cite PSyKE in publications, please use:
> Federico Sabbatini, Giovanni Ciatto, Roberta Calegari, Andrea Omicini. "[On the Design of PSyKE: A Platform for Symbolic Knowledge Extraction](http://ceur-ws.org/Vol-2963/paper14.pdf)", in: WOA 2021 – 22nd Workshop “From Objects to Agents”, Aachen, Sun SITE Central Europe, RWTH Aachen University, 2021, 2963, pp. 29 - 48.
A BibTeX entry for LaTeX users is:
```bibtex
@inproceedings{psyke-woa2021,
articleno = 3,
author = {Sabbatini, Federico and Ciatto, Giovanni and Calegari, Roberta and Omicini, Andrea},
booktitle = {WOA 2021 -- 22nd Workshop ``From Objects to Agents''},
editor = {Calegari, Roberta and Ciatto, Giovanni and Denti, Enrico and Omicini, Andrea and Sartor, Giovanni},
issn = {1613-0073},
keywords = {explainable AI, knowledge extraction, interpretable prediction, PSyKE},
location = {Bologna, Italy},
month = oct,
note = {22nd Workshop ``From Objects to Agents'' (WOA 2021), Bologna, Italy, 1--3~} # sep # {~2021. Proceedings},
numpages = 20,
pages = {29--48},
publisher = {Sun SITE Central Europe, RWTH Aachen University},
series = {CEUR Workshop Proceedings},
subseries = {AI*IA Series},
title = {On the Design of {PSyKE}: A Platform for Symbolic Knowledge Extraction},
url = {http://ceur-ws.org/Vol-2963/paper14.pdf},
volume = 2963,
year = 2021
}
```
GitHub Events
Total
- Delete event: 28
- Push event: 82
- Pull request event: 65
- Create event: 31
Last Year
- Delete event: 28
- Push event: 82
- Pull request event: 65
- Create event: 31
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 8
- Average time to close issues: N/A
- Average time to close pull requests: 22 days
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 8
Past Year
- Issues: 0
- Pull requests: 5
- Average time to close issues: N/A
- Average time to close pull requests: 22 days
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 5
Top Authors
Issue Authors
Pull Request Authors
- renovate[bot] (44)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout 3df4ab11eba7bda6032a0b82a6bb43b11571feac composite
- actions/setup-python v4 composite
- actions/checkout 3df4ab11eba7bda6032a0b82a6bb43b11571feac composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- actions/checkout 3df4ab11eba7bda6032a0b82a6bb43b11571feac composite
- actions/checkout master composite
- alstr/todo-to-issue-action v4.10.2 composite
- python 3.11 build
- 2ppy ==0.4.0
- build ==1.0.3
- igraph ==0.10.8
- kivy ==2.2.1
- kivy-garden ==0.1.5
- kneed ==0.8.5
- matplotlib >=3.7.0
- numpy ==1.26.0
- onnxruntime >=1.13.1
- pandas ==1.5.3
- parameterized ==0.9.0
- plotly >=5.13.0
- protobuf ==3.20.3
- scikit-learn >=1.1.1
- scipy >=1.9.0
- screeninfo ==0.8.1
- setuptools >=67.3.3
- skl2onnx >=1.12
- sympy ==1.12
- tensorflow ==2.7.2
- twine ==4.0.2