Dataset#

class empulse.datasets.Dataset(data, target, cost_matrix, instance_costs, feature_names, target_names, name, DESCR)[source]#

Container object for datasets returned by the load / fetch functions.

Returned by every load_* / fetch_* function; also accepts these as constructor arguments if you need to build one by hand.

Parameters:
datapandas.DataFrame, numpy.ndarray, or any dataframe supported by narwhals

Feature matrix.

targetpandas.Series, numpy.ndarray, or any series supported by narwhals

Binary classification labels.

cost_matrixCostMatrix

Symbolic cost matrix with default values pre-filled via set_default. The formula only uses deterministic variables.

instance_costsdict[str, numpy.ndarray] or None

Per-instance cost drivers (e.g. {'clv': array}). Keys match the symbol names (or aliases) in cost_matrix. Pass as keyword arguments to Metric:

metric(y_true, y_score, **dataset.instance_costs)

None when no instance-dependent costs are available.

feature_nameslist[str]

Column names of data.

target_nameslist[str]

Human-readable label names.

namestr

Dataset name.

DESCRstr

Full description of the dataset.