Skip to main content

Predictive Accuracy Subgroup Identification (PASI) trees and ensemble methods

Project description

pasi

Predictive Accuracy Subgroup Identification (PASI) — decision trees and ensemble methods for identifying subgroups with heterogeneous predictive model accuracy.

Installation

pip install pasi

For Numba-accelerated computation:

pip install pasi[numba]

Quick Start

import pandas as pd
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_auc_score
from pasi import pasiTree

# Load data
data = pd.read_csv("thyroid_dataset.csv")
X = data.drop(columns=["target"])
y = data["target"].values

# Fit a predictive model
model = LogisticRegression(max_iter=1000)
model.fit(X, y)
y_pred = model.predict_proba(X)[:, 1]

# Fit a PASI tree (AUC-based)
pasi_model = pasiTree(measure='auc', min_samples_leaf=100, max_depth=3)
pasi_model.fit(X, y=y, y_pred=y_pred)

# Visualize
dot_string = pasi_model.tree.export_graphviz(
    feature_names=list(X.columns),
    measure_name='auc'
)

Available Classes

Class Description
pasiTree PASI decision tree with support for indiv, auc, and auprc measures
pasiRF Random forest ensemble of PASI trees
pasiGB Gradient boosting with PASI tree weak learners
mvModelComb Majority-vote model combiner
emModelComb EM-based model combiner

Accuracy Measures

  • indiv — Individual-level accuracy using pseudo-response mu
  • auc — ROC AUC-based splitting via DeLong's method
  • auprc — Area Under Precision-Recall Curve (bootstrap-based)

License

MIT

Project details


Download files

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

Source Distribution

pasi-0.3.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pasi-0.3.0-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file pasi-0.3.0.tar.gz.

File metadata

  • Download URL: pasi-0.3.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for pasi-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0bbae43cf0e829920783519f8dc3cf1ca20b2d1c119eff456de5ca1acb4d4a99
MD5 504eb119f155094e2eb937531b13cc0f
BLAKE2b-256 aaf13c88e5f15600dc4814cdd3b4c8aaaa25584454aacbe9718c87e119d946dd

See more details on using hashes here.

File details

Details for the file pasi-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pasi-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for pasi-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25521b76bd60ceda0f369b7d4bf3917880fc6012bb701757eb09b8a01c8a22a4
MD5 2d2c439869ff23e3f06d45ff310fe449
BLAKE2b-256 8fec1f993635f7942af0f5a15160b19445b279947498f535fe7aa5d6cc05f558

See more details on using hashes here.

Supported by

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