load_loans(roles=True, units=True, as_pandas=False, as_dict=False)¶
Binary classification dataset on loan default
The loans dataset is based on financial dataset from the the CTU Prague Relational Learning Repository.
The original publication is: Berka, Petr (1999). Workshop notes on Discovery Challange PKDD’99.
The dataset contains information on 606 successful and 76 unsuccessful loans. After some preprocessing it contains 5 tables
account: Information about the borrower(s) of a given loan.
loan: Information about the loans themselves, such as the date of creation, the amount, and the planned duration of the loan. The target variable is the status of the loan (default/no default)
meta: Meta information about the obligor, such as gender and geo-information
order: Information about permanent orders, debited payments and account balances.
trans: Information about transactions and accounts balances.
The population table is split into a training and a testing set at 80% of the main population.
- roles (bool):
Return data with roles set
- units (bool):
Return data with units set
- as_pandas (bool):
Return data as pandas.DataFrame s
- as_dict (bool):
Return data as dict with df.name s as keys and df s as values.
Tuple containing (sorted alphabetically by df.name`s) the data as :class:`~getml.DataFrame s or
pandas.DataFrames (if as_pandas is True) or
The following DataFrames are returned:
>>> loans = getml.datasets.load_loans(as_dict=True) >>> type(loans["population_train"]) ... getml.data.data_frame.DataFrame
For an full analysis of the loans dataset including all necessary preprocessing steps please refer to getml-examples.
Roles and units can be set ad-hoc by supplying the respective flags. If roles is False, all columns in the returned
DataFramess have roles
unused_float. Before using them in an analysis, a data model needs to be constructed using