--- id: skope-rules version: "1.0.1" license: BSD 3 clause license_treatment: permissive maintenance: dormant --- # skope-rules — Machine Learning with Interpretable Rules License: permissive · Maintenance: dormant · Downloads: 86.6K/mo ## 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 above — 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 pip install skope-rules uv add skope-rules 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 86.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags interpretable machine learning rules, logical rule extraction, decision rule learning, high-precision classification rules, rule-based classification, explainable rule induction, tree ensemble rule extraction, interpretable-ml, rule-extraction, ensemble-methods [View on SkillFed](https://skillfed.io/packages/skope-rules) · [View on PyPI](https://pypi.org/project/skope-rules/)