libuplift.datasets.Lalonde#
The Lalonde (jobs) datasets.
There are two versions of the dataset, including 1974 earnings (version B) and excluding 1974 earnings (vestion A).
Functions#
|
Load the Lalonde datasets (uplift regression). |
Module Contents#
- libuplift.datasets.Lalonde.fetch_Lalonde(version='A', data_home=None, categ_as_strings=False, download_if_missing=True, random_state=None, shuffle=False, return_X_y=False, as_frame=False)[source]#
Load the Lalonde datasets (uplift regression).
Download it if necessary.
There are two versions of the dataset, including 1974 earnings (version B) and excluding 1974 earnings (vestion A). Source: http://users.nber.org/~rdehejia/data/nswdata2.html
- Parameters:
- versionstring, optional
Specify which dataset to return. ‘A’ for larger files without 1974 earnings, ‘B’ for smaller files with 1974 earnings.
- data_homestring, optional
Specify another download and cache folder for the datasets. By default all scikit-learn data is stored in ‘~/scikit_learn_data’ subfolders.
- download_if_missingboolean, default=True
If False, raise a IOError if the data is not locally available instead of trying to download the data from the source site.
- random_stateint, RandomState instance or None (default)
Determines random number generation for dataset shuffling. Pass an int for reproducible output across multiple function calls.
- shufflebool, default=False
Whether to shuffle dataset.
- return_X_yboolean, default=False.
If True, returns
(data.data, data.target)instead of a Bunch object.- as_frameboolean, default=False
If True features are returned as pandas DataFrame. If False features are returned as object or float array. Float array is returned if all features are floats.
- Returns:
- datasetdict-like object with the following attributes:
- dataset.datanumpy array of shape (581012, 54)
Each row corresponds to the 54 features in the dataset.
- dataset.targetnumpy array of shape (581012,)
Each value corresponds to one of the 7 forest covertypes with values ranging between 1 to 7.
- dataset.DESCRstring
Description of the forest covertype dataset.
- (data, target)tuple if
return_X_yis True