Plot predictiveness curve
Project description
predictiveness-curve
What's Predictiveness Curve?
Predictiveness curve is a method to display two graphs simultaneously. In both figures, the x-axis is risk percentile, the y-axis of one figure is the value of risk, and the y-axis of the other figure is true positive fractions. This makes it possible to visualize whether the model of risk fits in the medical field and which value of risk should be used as the basis for the model. See Am. J. Epidemiol. 2008; 167:362–368 for details.
Install
This module implements functions to plot Predictiveness Curve
.
Install with :
pip install predictiveness-curve
Example
from predictiveness_curve import plot_predictiveness_curve
from sklearn.datasets import load_breast_cancer
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
data = load_breast_cancer()
y = data.target
X = data.data
training_X, test_X, training_y, test_y = train_test_split(
X, y, test_size=0.5, random_state=42)
clsf = RandomForestClassifier(n_estimators=100, random_state=42)
clsf.fit(training_X, training_y)
probabilities = clsf.predict_proba(test_X)[:, 1]
plot_predictiveness_curve(probabilities, test_y)
See notebooks directory for details.
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
Close
Hashes for predictiveness-curve-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e18e77b794af2a589d5479f8102218a828a90e0cc82f0d28851f98ddabd6dc5e |
|
MD5 | 3d707b42fa1028a18644eeef4a7769cf |
|
BLAKE2b-256 | 514c0ff032d811b3f7ad51f3cfbbda26d4325b8e8c3d604d333d957d6209250b |