Skip to main content

Python package for data analytics.

Project description

PtDa

Python package for data analytics.

The package provides:

  • WOE calculation
  • IV calculation
  • Numeric and categorical check
  • etc

How to get it?

Binary installers for the latest released version are available at the Python package index.

# with PyPi 
pip install ptda

The source code is hosted on Github:

https://github.com/luckyp71/ptda

Dependencies

  • Pandas
  • Numpy
  • Scipy

Example

The following code is the example on how to use ptda. In this example, we use UCI Credit Card dataset.

Load Librares and Data

load_lib_data

Check Target Variable Name

Please bear in mind that we need to rename our target variable into target. Luckily in UCI Credit Card dataset we used in this example, the target variable name is already target, hence we don't need make any changes. check_target_var_name

Numeric and Categorical Variable Check

This method will return dataframe which contains numeric_var and categorical_var fields. Those fields are used to inform us whether the particular feature/variable is numeric or categorical, 1 for yes and 0 for no.

How does it work?
What if we have categorical feature that has many unique values, let say 15?

Well the cn_df method has one optional argument, i.e. n_bin, so if you have many unique values in your categorical feature/var, you can pass that unique values count as n_bin in the cn_df method (the default of n_bin is 10). num_cat_check

WOE and IV Calculation

woe_iv is a method to calculate WOE and IV as well as generating dataframe which contains those two information. woe_iv_calculation

iv_result

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

PtDa-0.1.5.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

PtDa-0.1.5-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file PtDa-0.1.5.tar.gz.

File metadata

  • Download URL: PtDa-0.1.5.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.4

File hashes

Hashes for PtDa-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b94154a5c0309045d92b549c52f5f60ab8114f7ae9b264064f8fb7d7cbfc4b26
MD5 78e122d98b976b6bd777008e63213046
BLAKE2b-256 fc93a0ffe6aa74ab5902838ca76bbb3319ab26335aabcf53c4b0d542044032cf

See more details on using hashes here.

File details

Details for the file PtDa-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: PtDa-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.4

File hashes

Hashes for PtDa-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8804d14052f64b0dd255f6a1f0e8e653d5dc275b6620e6238aec6982c707be19
MD5 59374e60e96eeb48722ac085497b5027
BLAKE2b-256 481519472a885834478046b801dab340e5b6a4cb403ac4a42aa18ddc7d0c3a15

See more details on using hashes here.

Supported by

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