Python package classeval
Project description
classeval
The library classeval
is developed to evaluate the models performance of any kind of two-class or multi-class model. classeval
computes many scoring measures in case of a two-class clasification model. Some measures are utilized from sklearn
, among them AUC, MCC, Cohen kappa score, matthews correlation coefficient, whereas others are custom. This library can help to consistenly compare the output of various models. In addition, it can also give insights in tuning the models performance as the the threshold being used can be adjusted and evaluated. The output of classeval
can subsequently plotted in terms of ROC curves, confusion matrices, class distributions, and probability plots. Such plots can help in better understanding of the results.
Docs
Navigate to API documentations for more detailed information.
Contents
Installation
- Install classeval from PyPI (recommended). classeval is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows.
- It is distributed under the MIT license.
Quick Start
pip install classeval
- Alternatively, install classeval from the GitHub source:
git clone https://github.com/erdogant/classeval.git
cd classeval
python setup.py install
Import classeval package
import classeval as clf
Example two-class model:
from sklearn.model_selection import train_test_split
from sklearn.ensemble.gradient_boosting import GradientBoostingClassifier
gb = GradientBoostingClassifier()
X, y = clf.load_example('breast')
X_train, X_test, y_train, y_true = train_test_split(X, y, test_size=0.2)
model = gb.fit(X_train, y_train)
y_proba = model.predict_proba(X_test)[:,1]
y_pred = model.predict(X_test)
# Evaluate
out = clf.eval(y_true, y_proba, pos_label='malignant')
ax = clf.plot(out, figsize=(20,15), fontsize=14)
Example multi-class model:
X,y = clf.load_example('iris')
X_train, X_test, y_train, y_true = train_test_split(X, y, test_size=0.5)
model = gb.fit(X_train, y_train)
y_pred = model.predict(X_test)
y_proba = model.predict_proba(X_test)
y_score = model.decision_function(X_test)
# All
out = clf.eval(y_true, y_proba, y_score, y_pred)
ax = clf.plot(out)
Citation
Please cite classeval in your publications if this is useful for your research. Here is an example BibTeX entry:
@misc{erdogant2020classeval,
title={classeval},
author={Erdogan Taskesen},
year={2019},
howpublished={\url{https://github.com/erdogant/classeval}},
}
Maintainers
- Erdogan Taskesen, github: erdogant
Contribute
- Contributions are welcome.
Licence
See LICENSE for details.
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
Built Distribution
Hashes for classeval-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9a65807d82c599aae2e41254f37f1fc75bcd667e04ee1734cefeb1da6c95695 |
|
MD5 | 80150fc5a6286828eb1104b20dcf6b26 |
|
BLAKE2b-256 | d04e707cbac6345d4a6a5e215186a4da29a59df3f4c03787ae20318c5f4b81c3 |