Skip to content

whiteboxml/whiteboxml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code style: black


WhiteBox Utilities Toolkit: Tools to make your life easier

Fancy data functions that will make your life as a data scientist easier.

Installing

To install this library in your Python environment:

  • pip install whiteboxml

Documentation

Metrics

Classification

  • ROC curve / AUC:
import numpy as np

from whiteboxml.modeling.metrics import plot_roc_auc_binary

y_pred = np.random.normal(0, 1, 1000)
y_true = np.random.choice([0, 1], 1000)

ax, fpr, tpr, thr, auc_score = plot_roc_auc_binary(y_pred=y_pred, y_true=y_true, figsize=(8, 8))

ax.get_figure().savefig('roc_curve.png')

roc_auc

  • Confusion Matrix:
import numpy as np

from whiteboxml.modeling.metrics import plot_confusion_matrix

y_true = np.random.choice([0, 1, 2, 3], 10000)
y_pred = np.random.choice([0, 1, 2, 3], 10000)

ax, matrix = plot_confusion_matrix(y_pred=y_pred, y_true=y_true, 
                                   class_labels=['a', 'b', 'c', 'd'])

ax.get_figure().savefig('confusion_matrix.png')

confusion_matrix

  • Optimal Threshold:
import numpy as np

from whiteboxml.modeling.metrics import get_optimal_thr

y_pred_proba = np.random.normal(0, 1, (100, 1))
y_true = np.random.choice([0, 1], (100, 1))

thr = get_optimal_thr(y_pred=y_pred_proba, y_true=y_true)

About

Fancy data functions that will make your life as a data scientist easier.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages