skillfed

skope-rules

Machine Learning with Interpretable Rules

skope-rules v1.0.1 86.6K downloads/30d#13,851 on PyPI663
Permissive license BSD 3 clause DORMANT released

What it is and what it does

Skope-rules is a machine learning module built on top of scikit-learn that learns interpretable logical rules for binary classification by extracting and deduplicating rules from tree ensembles. It aims to find rules that detect instances of a target class with high precision, offering a middle ground between the transparency of a single decision tree and the predictive power of a random forest.

The package extracts rules from tree ensembles, removes near-duplicates based on support similarity, and filters them by user-specified precision and recall thresholds. Rules can be used both for explanation (examining the logical conditions) and for prediction via methods that rank instances by the precision of the rules that match them.

Use it for:

  • Extract human-readable classification rules from a trained tree ensemble to understand which feature combinations define a target class.
  • Build a high-precision detector for rare or critical events where false positives are costly and interpretability is required.
  • Score new instances by the precision of the rules that match them, balancing accuracy with explainability.
  • Generate a small set of actionable business rules from historical data for manual review and deployment in rule engines.
  • Compare rule-based predictions with tree or forest predictions to validate that simplified rules capture ensemble logic.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Skope-rules learns interpretable logical rules from data to classify instances with high precision, balancing the simplicity of decision trees with the power of random forests.

Yes, if you need interpretable rules for binary classification and can accept dormant maintenance. The package is stable, has low install friction, and carries no known vulnerabilities. However, verify compatibility with your current numpy, scikit-learn, scipy, and pandas versions before relying on it in production.

Install

skope-rules on PyPI

pip

pip install skope-rules

uv

uv add skope-rules

poetry

poetry add skope-rules

Installing skope-rules

Before you install

Low friction: pure Python wheel with four common scientific dependencies (numpy, scikit-learn, scipy, pandas). However, the package is dormant—last release was 2020-01-25, over four years ago, with no recent commits beyond 2024-01-31.

License in practice

BSD 3 clause is permissive; you can use, modify, and distribute skope-rules freely in commercial and private projects with minimal restrictions, provided you retain the license notice.

Quickstart

pip install skope-rules

from skope_rules import SkopeRules

clf = SkopeRules(max_depth_duplication=2, n_estimators=30, precision_min=0.3, recall_min=0.1)
clf.fit(X, y)
rules = clf.rules_[0:3]

Verify before relying

  • Whether the package remains compatible with current versions of numpy, scikit-learn, scipy, and pandas given its dormant status.
  • Whether Python 3.10+ is supported; the description mentions Python 2.7 and 3.5 but provides no upper bound.
  • Active community support or maintenance plans, given the gap since the last release in 2020-01-25.

Package facts

License BSD 3 clause (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 4 — numpy, scikit-learn, scipy, pandas
Maintenance dormant — 2,393 days since the last release
Last repo commit
First released
Downloads 86,577/month — #13,851 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: skope_rules-1.0.1-py3-none-any.whl

Keywords: learning with rules, interpretable machine learning

Tags

interpretable machine learning ruleslogical rule extractiondecision rule learninghigh-precision classification rulesrule-based classificationexplainable rule inductiontree ensemble rule extraction
interpretable-mlrule-extractionensemble-methods

More Artificial Intelligence packages