Skip to main content

Calculate KS statistic for models

Project description

Title

summary

pyks

Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge DOI PyPI version

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

png

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()`
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
.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

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

pyks-1.1.5.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

pyks-1.1.5-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file pyks-1.1.5.tar.gz.

File metadata

  • Download URL: pyks-1.1.5.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pyks-1.1.5.tar.gz
Algorithm Hash digest
SHA256 d85f2e2e0d7cb8e233994f51c57a8ec5a3b569d36f7877b9bdf7afd2627689e4
MD5 45c2b1c4eec922d93080c9a3b342a8f5
BLAKE2b-256 caed83bf89c3800e2265b0891b82a9c4ff0d781848ba0c5a191127b0456652a4

See more details on using hashes here.

File details

Details for the file pyks-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: pyks-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pyks-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f89f47c1a06c12d508f620dc4dc83fe9ac079eed69c39cae697ac9b9aea93ce8
MD5 1d407426662d30b2801ac58db71b3eec
BLAKE2b-256 b254bcc5e44eefbc67b0e7591691fed63ff40beaa2348343297e774063028d45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page