pdmlabs.evaluation.vus.basic_metrics#

Classes

basic_metricor([a,Β probability,Β bias])

class pdmlabs.evaluation.vus.basic_metrics.basic_metricor(a=1, probability=True, bias='flat')#

Bases: object

Cardinality_factor(Anomolyrange, Prange)#
RangeAUC(labels, score, window=0, percentage=0, plot_ROC=False, AUC_type='window')#
RangeAUC_volume(labels_original, score, windowSize)#
TPR_FPR_RangeAUC(labels, pred, P, L)#
b(i, length)#
detect_model(model, label, contamination=0.1, window=100, is_A=False, is_threshold=True)#
existence_reward(labels, preds)#

labels: list of ordered pair preds predicted data

extend_postive_range(x, window=5)#
extend_postive_range_individual(x, percentage=0.2)#
labels_conv(preds)#

return indices of predicted anomaly

labels_conv_binary(preds)#

return predicted label

metric_PR(label, score)#
metric_new(label, score, best_threshold_examined, plot_ROC=False, alpha=0.2)#
input:

Real labels and anomaly score in prediction

output:

AUC, Precision, Recall, F-score, Range-precision, Range-recall, Range-Fscore, Precison@k,

k is chosen to be # of outliers in real labels

num_nonzero_segments(x)#
range_convers_new(label)#

input: arrays of binary values output: list of ordered pair [[a0,b0], [a1,b1]… ] of the inputs

range_recall_new(labels, preds, alpha)#
scale_threshold(score, score_mu, score_sigma)#
w(AnomalyRange, p)#