load_consumer_expenditures(roles: bool = True, units: bool = True, as_pandas: bool = False, as_dict: bool = False) → Union[Tuple[Union[getml.data.data_frame.DataFrame, pandas.core.frame.DataFrame], …], Dict[str, Union[getml.data.data_frame.DataFrame, pandas.core.frame.DataFrame]]]¶
Binary classification dataset on consumer expenditures
The Consumer Expenditure Data Set is a public domain data set provided by the American Bureau of Labor Statistics (https://www.bls.gov/cex/pumd.htm). It includes the diary entries, where American consumers are asked to keep diaries of the products they have purchased each month,
We use this dataset to classify wether an item was pruchased as a gift.
- 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:
>>> ce = getml.datasets.load_consumer_expenditures(as_dict=True) >>> type(ce["expd"]) ... getml.data.data_frame.DataFrame
For an full analysis of the occupancy dataset including all necessary preprocessing steps please refer to getml-examples.
Roles and units can be set ad-hoc by supplying the respective flag. 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