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-responsemuauc— ROC AUC-based splitting via DeLong's methodauprc— Area Under Precision-Recall Curve (bootstrap-based)
License
MIT
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pasi-0.3.0-py3-none-any.whl
(28.2 kB
view details)
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bbae43cf0e829920783519f8dc3cf1ca20b2d1c119eff456de5ca1acb4d4a99
|
|
| MD5 |
504eb119f155094e2eb937531b13cc0f
|
|
| BLAKE2b-256 |
aaf13c88e5f15600dc4814cdd3b4c8aaaa25584454aacbe9718c87e119d946dd
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25521b76bd60ceda0f369b7d4bf3917880fc6012bb701757eb09b8a01c8a22a4
|
|
| MD5 |
2d2c439869ff23e3f06d45ff310fe449
|
|
| BLAKE2b-256 |
8fec1f993635f7942af0f5a15160b19445b279947498f535fe7aa5d6cc05f558
|