Skip to main content

Simple library combining efficient credit scoring ML methods

Project description

A Simple Open-Source Credit Scoring System

easycreditscoring provides a systematic - though simplified - approach to the credit scoring problem. We base on the publicly available Kaggle dataset.

To deal with the credit scoring problem we develop a simple Python package that combines data transformation process with the application of various machine learning models. We will skip the exploratory data analysis (EDA) since the dataset-specific insights are publicly available.

Contents

  1. Workflow
  2. Library structure
  3. Examples

1. Workflow

We start with uploading the dataset in CSV format. Brief analysis shows a large number of missing values and outliers that are to be dealt with.

The library implements standard data cleaning and preprocessing techniques: non-numerical values cleanup, categorical one-hot encoding, outliers elimination based on z-score, missing values imputation with kNN (k-Nearest-Neighbours) algorithm.

After the dataset has been preprocessed, we apply a set of classic machine learning models to predict credit score and evaluate their efficiency: well-interpretable algorithms (logistic regression, decision tree, Bayes) and less interpretable (Random Forest, gradient boosting, neural network). All these models are implemented via abstract classes that allow their usage with a simple interface.

In addition, the library contains an ensemble method to combine any of the implemented models.

To evaluate results, we use a standard confusion matrix to calculate accuracy and other metrics and check ROC-AUC metrics. For the neural network model we provide an advanced interface that implements a custom loss function based on unit economy.

Note: the library can be used to get first estimations and to set baselines. Further analysis, both during the dataset exploration and model fine-tuning, is not in the scope of our work, although our system shows good results on Kaggle dataset.

2. Library structure

├── setup.py
├── src
│   ├── data_cleaning.py	# Data cleaning tools
│   └── modelzoo.py.py   	# ML models implementation
│   └── ensembling.py		# Ensembling tools
│   └── economy.py		# Unit economy implementation
├── LICENSE.txt              	 
├── requirements.txt         	# List of dependencies
└── README.md                	# This README file

3. Examples

To install the library, use the following shell command:

% pip install easycreditscoring

Import works as follows:

import easycreditscoring

from easycreditscoring import DataCleaner, ModelPipeLine, Ensembling, UnitEconomy

To see an example of usage with Kaggle scoring dataset, see this Colab notebook.

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

easycreditscoring-0.0.4.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

easycreditscoring-0.0.4-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file easycreditscoring-0.0.4.tar.gz.

File metadata

  • Download URL: easycreditscoring-0.0.4.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for easycreditscoring-0.0.4.tar.gz
Algorithm Hash digest
SHA256 4dbc3e8479c8a7d246d793de73f20141f0968bece81d304df0a6312cc8762c4e
MD5 95efaec8fc3a9fbac2c454554127acac
BLAKE2b-256 384db85d65411b1863e058f10b4199ae4c925ba66d5a30da85bab679bce12781

See more details on using hashes here.

File details

Details for the file easycreditscoring-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for easycreditscoring-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c201ed44b35caa7264002331c0e96e6ac465618e32e3dac06fb6a8300c708c3f
MD5 67812490018f8da2f5696446e53548f5
BLAKE2b-256 c5d7223fc827ebd22a74c64d3b51c463cd40a35929b293da66981e39e17aa4f7

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