DataFetcher for the data set used for the experiment. All exper_func take a
DataFetcher as an argument to have access to all data points and noisy indices.
pred_modelModel
Prediction model for the DataEvaluators
train_kwargsdict[str, Any], optional
Training key word arguments for the prediction model, by default None
Experiment function, runs an experiment on a DataEvaluator and the data of
the DataFetcher associated. Output must be a dict with results of the
experiment. NOTE, the results must all be <= 1 dimensional but does not
need to be the same length.
save_outputbool, optional
Wether to save the outputs to self.output_dir, by default False
eval_kwargsdict[str, Any], optional
Additional key word arguments to be passed to the exper_func
Name of the data set, must be registered with
Register
cache_dirUnion[str, pathlib.Path], optional
Directory of where to cache the loaded data, by default None which uses
Register.CACHE_DIR
force_downloadbool, optional
Forces download from source URL, by default False
train_countUnion[int, float]
Number/proportion training points
valid_countUnion[int, float]
Number/proportion validation points
test_countUnion[int, float]
Number/proportion test points
add_noiseCallable
If None, no changes are made. Takes as argument required arguments
DataFetcher and adds noise to those the data points of DataFetcher as
needed. Returns dict[str, np.ndarray] that has the updated np.ndarray in a
dict to update the data loader with the following keys:
“x_train” – Updated training covariates with noise, optional
“y_train” – Updated training labels with noise, optional
“x_valid” – Updated validation covariates with noise, optional
“y_valid” – Updated validation labels with noise, optional
“x_test” – Updated testing covariates with noise, optional
“y_test” – Updated testing labels with noise, optional
“noisy_train_indices” – Indices of training data set with noise
noise_kwargsdict[str, Any], optional
Key word arguments passed to add_noise, by default None
random_stateRandomState, optional
Random initial state, by default None
model_namestr, optional
Name of the preset model, check model_factory() for preset models,
by default None
devicetorch.device, optional
Tensor device for acceleration, by default torch.device(“cpu”)
Experiment function, runs an experiment on a DataEvaluator and the data of
the DataFetcher associated. Output must be a dict with results of the
experiment. NOTE, the results must all be <= 1 dimensional but does not
need to be the same length.
figFigure, optional
MatPlotLib Figure which each experiment result is plotted, by default None
rowint, optional
Number of rows of subplots in the plot, by default set to num_evaluators/col
colint, optional
Number of columns of subplots in the plot, by default 2
save_outputbool, optional
Wether to save the outputs to self.output_dir, by default False
eval_kwargsdict[str, Any], optional
Additional key word arguments to be passed to the exper_func
dict containing list of the proportion of noisy indices found after exploring
the (i*percentile) least valuable data points. If plot is not None,
also returns optimal and random search performances as lists
“axis” – Proportion of data values explored currently.
“corrupt_found” – Proportion of corrupted data values found currently
“optimal” – Optimal proportion of corrupted values found currently
meaning if the inspected only contained corrupted samples until
the number of corrupted samples are completely exhausted.
“random” – Random proportion of corrupted samples found, meaning
if the data points were explored randomly, we’d expect to find
corrupted_samples in proportion to the number of corruption in the data set.
Evaluate accuracy after removing data points with data values above threshold.
For each subplot, displays the proportion of the data set with data values less
than the specified data value (x-axis) and the performance of the model when all
data values greater than the specified data value is removed. This implementation
was inspired by V. Feldman and C. Zhang in their paper [1] where the same principle
was applied to memorization functions.
dict containing the thresholds of data values examined, proportion of training
data points removed, and performance after those data points were removed.
“axis” – Thresholds of data values examined. For a given threshold,
considers the subset of data points with data values below.
“frac_datapoints_explored” – Proportion of data points with data values
below the specified threshold
f”{metric}_at_datavalues” – Performance metric when data values
Compute F1 score (of 2NN classifier) of the data evaluator
on the noisy indices. KMeans labels are random, but because of the convexity of
KMeans, the highest data point and lowest data point have different labels and
belong to the most valuable/least valuable group. Thus, the least valuable group
will be in one group and most valuable to zero for the F1 score.
Indices of the data points in each cluster, because of the convexity of KMeans,
the first sequence represents the lower value group and the second the higher