- fairlearn.datasets.fetch_bank_marketing(*, cache=True, data_home=None, as_frame=True, return_X_y=False)#
Load the UCI bank marketing dataset (binary classification).
Download it if necessary.
The data is related with direct marketing campaigns of a Portuguese banking institution. The marketing campaigns were based on phone calls. Often, more than one contact to the same client was required, in order to access if the product (bank term deposit) would be (or not) subscribed.
The classification goal is to predict if the client will subscribe a term deposit (variable y).
New in version 0.5.0.
cache (bool, default=True) – Whether to cache downloaded datasets using joblib.
data_home (str, default=None) – Specify another download and cache folder for the datasets. By default, all fairlearn data is stored in ‘~/.fairlearn-data’ subfolders.
as_frame (bool, default=True) –
If True, the data is a pandas DataFrame including columns with appropriate dtypes (numeric, string or categorical). The target is a pandas DataFrame or Series depending on the number of target_columns. The Bunch will contain a
frameattribute with the target and the data. If
return_X_yis True, then
(data, target)will be pandas DataFrames or Series as describe above.
Changed in version 0.9.0: Default value changed to True.
return_X_y (bool, default=False) – If True, returns
(data.data, data.target)instead of a Bunch object.
Bunch) – Dictionary-like object, with the following attributes.
- datandarray, shape (45211, 16)
Each row corresponding to the 16 feature values in order. If
datais a pandas object.
- targetnumpy array of shape (45211,)
Each value represents whether the client subscribed a term deposit which is ‘yes’ if the client subscribed and ‘no’ otherwise. If
targetis a pandas object.
- feature_nameslist of length 16
Array of ordered feature names used in the dataset.
Description of the UCI bank marketing dataset.
- categoriesdict or None
Maps each categorical feature name to a list of values, such that the value encoded as i is ith in the list. If
as_frameis True, this is None.
- framepandas DataFrame
Only present when
as_frameis True. DataFrame with
(data, target) (tuple if
Our API largely follows the API of