seldonian.parse_tree.zhat_funcs

Module containing the measure functions (zhats) for computing unbiased estimates of base variables

measure_function_vector_mapper: dict

Maps the measure function name that appears in behavioral constraint strings to the zhat function for that measure function.

Functions

batcher(func, N, batch_size, num_batches)

Calls func num_batches times, batching up the inputs.

evaluate_statistic(model, statistic_name, ...)

Evaluate the mean of a statistical function over the whole sample provided.

sample_from_statistic(model, statistic_name, ...)

Calculate a statistical function for each observation in the sample.

vector_Accuracy(model, theta, X, Y, **kwargs)

Calculate probabilistic accuracy for each observation.

vector_Error(model, theta, X, Y, **kwargs)

Calculate error (Y_hat - Y) for each observation in the dataset

vector_Error_Rate(model, theta, X, Y, **kwargs)

Calculate error rate for each observation.

vector_False_Negative_Rate(model, theta, X, ...)

Calculate false negative rate for each observation.

vector_False_Positive_Rate(model, theta, X, ...)

Calculate false positive rate for each observation.

vector_IS_estimate(model, theta, episodes, ...)

Calculate the unweighted importance sampling estimate on each episodes in the dataframe

vector_Negative_Rate(model, theta, X, Y, ...)

Calculate negative rate for each observation.

vector_PDIS_estimate(model, theta, episodes, ...)

Calculate per decision importance sampling estimate on each episodes in the dataframe

vector_Positive_Rate(model, theta, X, Y, ...)

Calculate positive rate for each observation.

vector_Squared_Error(model, theta, X, Y, ...)

Calculate squared error for each observation in the dataset

vector_True_Negative_Rate(model, theta, X, ...)

Calculate true negative rate for each observation.

vector_True_Positive_Rate(model, theta, X, ...)

Calculate true positive rate for each observation.

vector_WIS_estimate(model, theta, episodes, ...)

Calculate weighted importance sampling estimate on each episodes in the dataframe

vector_auxiliary_return_US_estimate(model, ...)

Get the auxiliary reward returns for episodes whose actions fall within the theta bounding box.

vector_confusion_matrix(model, theta, X, Y, ...)

Get the probability of predicting class label l_k if the true class label was l_i. This is the C[l_i,l_k] element of the confusion matrix, C. Let: i = number of datapoints j = number of features (including bias term, if provied) k = number of classes.