load_consumer_expenditures¶
-
getml.datasets.
load_consumer_expenditures
(roles=False, units=False, as_pandas=False)[source]¶ 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.
- Args:
as_pandas (bool):
Return data as pandas.DataFrame s
roles (bool):
Return data with roles set
units (bool):
Return data with units set
- Returns:
dict:
Dictionary containing the data as
DataFrame
s orpandas.DataFrame
s (if as_pandas is True). The keys correspond to the name of the DataFrame on theengine
. The following DataFrames are contained in the dictionarypopulation_testing
population_training,
population_validation
expd
fmld
memd
Examples:
>>> df_getml = getml.datasets.load_consumer_expenditures() >>> type(df_getml["expd"]) ... getml.data.data_frame.DataFrame
For an full analysis of the occupancy dataset including all necessary preprocessing steps please refer to getml-examples.
Note:
Roles and units can be set ad-hoc by supplying the respective flag. If roles is False, all columns in the returned
DataFrames
s have rolesunused_string
orunused_float
.` Before using them in an analysis, a data model needs to be constructed usingPlaceholder
s.