Skip to main content

realkd.py

Methods for knowledge discovery from data and interpretable machine learning. Currently, package contains primarily rule ensembles learners.

    >>> import pandas as pd
    >>> from sklearn.metrics import roc_auc_score
    >>> from realkd.rules import RuleBoostingEstimator, XGBRuleEstimator
    >>> titanic = pd.read_csv('../datasets/titanic/train.csv')
    >>> survived = titanic.Survived
    >>> titanic.drop(columns=['PassengerId', 'Name', 'Ticket', 'Cabin', 'Survived'], inplace=True)
    >>> re = RuleBoostingEstimator(base_learner=XGBRuleEstimator(loss=logistic_loss))
    >>> re.fit(titanic, survived.replace(0, -1), verbose=0)
       -1.4248 if Pclass>=2 & Sex==male
       +1.7471 if Pclass<=2 & Sex==female
       +2.5598 if Age<=19.0 & Fare>=7.8542 & Parch>=1.0 & Sex==male & SibSp<=1.0

See the full documentation.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

realkd-0.2.1.tar.gz (22.6 kB view details)

Uploaded Source

File details

Details for the file realkd-0.2.1.tar.gz.

File metadata

  • Download URL: realkd-0.2.1.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.44.0 CPython/3.7.7

File hashes

Hashes for realkd-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0f55c813169a4b91b6b8798a5c4f198e0989c97b196df159af624f0bb508fd17
MD5 4863f668edbc33e3d9a2583d0a4c1b9a
BLAKE2b-256 9e88fadbd74a1fec1a9401455c40dccf92c0203bdc56be0ba0c6413e92423525

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 file

0.2.0

1 file

0.1.1

1 file

0.1.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page