Title
summary
pyks
The goal of pyks is to help do calculation KS statistic for a model.
The R version rawKS is hosted
from GitHub.
Installation
You can install the released version of pyks from Anaconda
Cloud with:
conda install -c jiaxiangbu pyks
or the released version of pyks from Python Package
Index with:
pip install pyks
or the development version from GitHub with:
pip install git+https://github.com/JiaxiangBU/pyks
Citations
If you use pyks, I would be very grateful if you can add a citation in your published work. By citing pyks, beyond acknowledging the work, you contribute to make it more visible and guarantee its growing and sustainability. For citation, please use the BibTex or the citation content.
@misc{jiaxiang_li_2019_3351276,
author = {Jiaxiang Li},
title = {JiaxiangBU/pyks: pyks 1.1.3},
month = jul,
year = 2019,
doi = {10.5281/zenodo.3351276},
url = {https://doi.org/10.5281/zenodo.3351276}
}
Jiaxiang Li. (2019, July 25). JiaxiangBU/pyks: pyks 1.1.3 (Version v1.1.3). Zenodo. http://doi.org/10.5281/zenodo.3351276
Disclaimers
Code of Conduct
Please note that the pyks project is released with a Contributor Code
of Conduct.
By contributing to this
project, you agree to abide by its terms.
License
MIT \u00a9 Jiaxiang Li
Examples
import pandas as pd
import numpy as np
df1 = pd.read_csv('refs/two_class_example.csv')
from pyKS.ks import perf
perf(df1).chart()
0.727689153693382
The function `plot` is depreciated, use `perf.plot()`
<Figure size 432x288 with 0 Axes>
perf(df1).table()
The function `summary` is depreciated, use `perf.table()`
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
| min_scr | max_scr | bads | goods | total | odds | bad_rate | ks | max_ks | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 1.794262e-07 | 0.002773 | 50 | 0 | 50 | 0.00 | 100.00% | 20.66 | |
| 1 | 2.810221e-03 | 0.036310 | 49 | 1 | 50 | 0.02 | 98.00% | 40.52 | |
| 2 | 3.670582e-02 | 0.122027 | 43 | 7 | 50 | 0.16 | 86.00% | 55.58 | |
| 3 | 1.225460e-01 | 0.325715 | 37 | 13 | 50 | 0.35 | 74.00% | 65.83 | |
| 4 | 3.269821e-01 | 0.655164 | 31 | 19 | 50 | 0.61 | 62.00% | 71.27 | <---- |
| 5 | 6.587248e-01 | 0.853443 | 22 | 28 | 50 | 1.27 | 44.00% | 69.51 | |
| 6 | 8.561391e-01 | 0.958957 | 7 | 43 | 50 | 6.14 | 14.00% | 55.74 | |
| 7 | 9.623505e-01 | 0.987179 | 1 | 49 | 50 | 49.00 | 2.00% | 37.16 | |
| 8 | 9.875471e-01 | 0.997897 | 2 | 48 | 50 | 24.00 | 4.00% | 19.38 | |
| 9 | 9.979229e-01 | 0.999997 | 0 | 50 | 50 | inf | 0.00% | -0.00 |
Release files for pyks 1.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyks-1.1.5.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyks-1.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.8 kB
Release files / pyks-1.1.5.tar.gz
| Download URL | pyks-1.1.5.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d85f2e2e0d7cb8e233994f51c57a8ec5a3b569d36f7877b9bdf7afd2627689e4
|
|
BLAKE2b-256 checksum How to use checksums |
caed83bf89c3800e2265b0891b82a9c4ff0d781848ba0c5a191127b0456652a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.3
|
Release files / pyks-1.1.5-py3-none-any.whl
| Download URL | pyks-1.1.5-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f89f47c1a06c12d508f620dc4dc83fe9ac079eed69c39cae697ac9b9aea93ce8
|
|
BLAKE2b-256 checksum How to use checksums |
b254bcc5e44eefbc67b0e7591691fed63ff40beaa2348343297e774063028d45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.3
|