Skip to main content

Primarily used for developing binary classification models and generating reports for production work.

Project description

abcard

abcard is a Python package primarily used for developing binary classification models and generating reports for production work.
It supports Logit and LGBM models, can generate PDF model reports and production-ready deployment code.
It emphasizes concise and efficient API calls, rich visualizations, and retention of the development process.

Installation

abcard requires Python 3.9 or later, install using pip with:

pip install abcard

Additional dependencies: numpy, pandas, tqdm, statsmodels, scikit-learn, matplotlib, PyMuPDF, lightgbm

Main Features

from abcard import Frame, LogitFrame, LGBMCFrame, Report, ModReport, LogitReport, LGBMCReport

train: 'pandas.DataFrame datasets'
test: 'pandas.DataFrame datasets'
oot: 'pandas.DataFrame datasets'
flag: 'target label (y)'
time: 'name of the time column, optional'
exclude: 'column names to be excluded, optional'
Mod: 'Logit, LGBM models'

df = LogitFrame(flag = flag, time = time, exclude = exclude) # Initial sample set field configuration.
df = LGBMCFrame(flag = flag, time = time, exclude = exclude) # Initial sample set field configuration.
df.set_samp(train, 'train') # Set the sample dataset.
df.get_samp(test, 'test') # Get the sample dataset.
df.del_samp(oot, 'oot') # Delete the sample dataset.

df.describe_sample() # Descriptive analysis of samples.
df.describe_feature() # Descriptive analysis of fearures.
df.chi2_split() # Perform chi-square binning on all features.

df.mergebins() # Merge bins manually.

df.drop_nan(nan = 0.9) # Various feature filtering methods starting with 'drop'.

df.transform() # Convert the sample set into bins or WOE.

train_set = df.get_xy(label = 'train') # Get the X and y for model training or prediction.
df.get_metric() # Retrieve the model's evaluation metrics on all sample sets.
df.scorecard() # Calculate Logistic Regression Scorecard for Selected Features.

df._mod = Mod # A fully trained model.

rep = LGBMCReport(df) # Initialize a PyMuPDF Document object for a LGBMClassifier model Frame object.
rep.design()
rep.describe_feature()
rep.bins() # Generate a chapter for the feature binning results.
rep.filter() # Generate a chapter for the feature filtering results.
rep.modres() # Generate a chapter containing the model results.
rep.analysis('train') # Generate a chapter containing the model analysis and evaluation for the specified samples.
rep.plotcuts(cores = 4) # Generate a chapter containing the model binning plots.
rep.code() # Generate a chapter containing the deployment code.
rep.log()
rep.save("model_name_report.pdf")
rep.close()

License and Copyright

abcard is available under open-source AGPL and commercial license agreements.

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

abcard-0.1.3.tar.gz (102.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abcard-0.1.3-py3-none-any.whl (103.0 kB view details)

Uploaded Python 3

File details

Details for the file abcard-0.1.3.tar.gz.

File metadata

  • Download URL: abcard-0.1.3.tar.gz
  • Upload date:
  • Size: 102.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for abcard-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c8ff273b8e6fa7e2a307d564ec99d3b4094a942ad1d1df0553a4f6e49ff4ed64
MD5 845f28bfe1d15163b4dfdf8784f09ac1
BLAKE2b-256 d5e03ee6a0a9353999f15904942d37165cee61b71d62a7f61918327eb9b60afa

See more details on using hashes here.

File details

Details for the file abcard-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: abcard-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 103.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for abcard-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1698d6c6888f3d7f287cc61c35ac3b45bef63f1e72464b7bc2b5f3fcb3b91c25
MD5 74456dd34d958a52eddd114ec03cfbdc
BLAKE2b-256 7e4c8168a91533e623a0277eb2a453801621e5c8610caff3212d655400113135

See more details on using hashes here.

Supported by

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