Example datasets
gshap.datasets.load_recidivism
def gshap.datasets.load_recidivism(return_X_y=False) [source]
Load the COMPAS recidivism dataset. The purpose of this dataset is to predict whether a criminal will recidivate within two years of release.
Parameters: | return_X_y : bool, default=False
Indicates whether to return just the X and y matrices, as opposed to the data |
---|---|
Returns: | bunch : Bunch
Object containing the dataframe, X feature matrix, and y target vector. Or, if |
gshap.datasets.load_gdp
def gshap.datasets.load_gdp(return_X_y=False) [source]
Load the GDP growth dataset (from FRED data). The purpose of this dataset is to forecast GDP growth based on macroeconomic variables.
Parameters: | return_X_y : bool, default=False
Indicates whether to return just the X and y matrices, as opposed to the data |
---|---|
Returns: | bunch : Bunch
Object containing the dataframe, X feature matrix, and y target vector. Or, if |
gshap.datasets.Bunch
class gshap.datasets.Bunch(filename, target) [source]
Dataset container.
Parameters: | filename : str
Name of the file in Name of target variable |
---|---|
Attributes: | df : pandas.DataFrame
Dataframe containing features and the target variable. data : pandas.DataFrameDataframe containing only the features target : pandas.SeriesSeries of the target variable. |