Default of Credit Card Clients#
Payment records of 30000 credit card clients in Taiwan, from April to September 2005. The data was collected for a study that compared six data mining methods at predicting default payments. The task is binary classification: will the client default on the payment of the next month? The classes are unbalanced, about 22 percent of the clients default.
Overview#
Loader |
|
Task |
Classification |
Samples |
30000 |
Features |
23 |
Targets |
2 classes: |
Missing values |
None |
License |
CC BY 4.0 |
Features#
23 integer features. The names are the ones of the UCI variable descriptions, the source
calls them X1 to X23:
LIMIT_BAL: the amount of the given credit in NT dollars. It includes the individual consumer credit and the family (supplementary) credit.SEX(1 = male, 2 = female),EDUCATION(1 = graduate school, 2 = university, 3 = high school, 4 = others),MARRIAGE(1 = married, 2 = single, 3 = others) andAGEin years.PAY_0,PAY_2,PAY_3,PAY_4,PAY_5andPAY_6: the repayment status from September back to April 2005. The source documents the scale -1 = pay duly, 1 = payment delay of one month, up to 9 = delay of nine months and above. There is noPAY_1,PAY_0is the status of September.BILL_AMT1toBILL_AMT6: the amount of the bill statement in NT dollars, from September back to April 2005.PAY_AMT1toPAY_AMT6: the amount of the previous payment in NT dollars, from September back to April 2005.
The data is stored exactly as released. Some values are not covered by the documentation of
the source: EDUCATION also contains 0, 5 and 6, MARRIAGE also contains 0, and all
PAY_* columns also contain -2 and 0. The categorical columns keep the raw integer codes
of the source (SEX is 1 and 2, not 0 and 1) and are not declared as categorical features.
Nothing was recoded or removed, so decide yourself how to treat these values. The row
identifier column ID of the source is not included.
The features describe the sex, education, marital status and age of individual clients. A model trained on them can reproduce unfair differences between groups, keep this in mind before drawing conclusions about people.
Target#
y is 0 for a client with no default payment next month and 1 for a client with a
default payment next month, in the order of target_names. 6636 of the 30000 clients
(22.12 percent) have the label 1 and 23364 have the label 0.
Source and citation#
Source: UCI Machine Learning Repository
Obtained from: UCI dataset 350, read with the ucimlrepo package (version stored in extras[‘ucimlrepo_version’]).
Creators: I-Cheng Yeh
Please cite the dataset as:
Yeh, I. (2009). Default of Credit Card Clients [Dataset]. UCI Machine Learning Repository. https://doi.org/10.24432/C55S3H.
License#
CC BY 4.0, as stated by the source. The license was checked at the source on 2026-10-22. See License and citation.
Changes made#
Converted to the NumPy NPZ format.
The row identifier column ID of the source is not included.
Column names X1..X23 were replaced with the feature names from the UCI variable descriptions; the values themselves were not modified.
Features were converted to float64.
Target Y was kept as integer 0/1 codes, and the class names were set from the Yes/No meaning in the source description.
Note
SEX uses the codes 1 (male) and 2 (female) as documented by the source, so the category codes do not start at 0.
Note
EDUCATION is documented as 1 = graduate school, 2 = university, 3 = high school, 4 = others. The data also contains the undocumented values 0, 5 and 6.
Note
MARRIAGE is documented as 1 = married, 2 = single, 3 = others. The data also contains the undocumented value 0.
Note
The repayment status columns PAY_0, PAY_2, PAY_3, PAY_4, PAY_5 and PAY_6 are documented with the scale -1 = pay duly, 1 to 9 = payment delay in months. The data also contains the undocumented values -2 and 0 in all six columns, and the value 9 does not occur. The value 1 does not occur in PAY_5 and PAY_6. There is no column PAY_1: PAY_0 is the repayment status of September 2005, as in the source.
Note
All raw values are kept as they are in the source; no recoding, cleaning or removal of rows was applied.
Example#
>>> import numpy as np
>>> from pyml_datasets import load_credit_card_default
>>> data = load_credit_card_default()
>>> data.X.shape
(30000, 23)
>>> data.target_names
('No default payment', 'Default payment')
>>> np.bincount(data.y)
array([23364, 6636])