stattools
Statistics¶
Tools for statistics.
medianabsdev¶
medianabsdev(data) computes the median absolute deviation of a sequence of floats.
entropy¶
entropy(data) computes the entropy of a sequence of any items.
Tip
You can also pass a dictionary of (item, frequency) as known frequency distribution to data.
Binary Classification¶
Tools for binary classification.
teststats¶
teststats(truths, predictions) matches the truth labels and the prediction labels. Return a tuples of (tp, fp, tn, fn) as true positive, false positive, true negative, and false negative.
accuracy¶
accuracy(tp, fp, tn, fn) returns the accuracy.
Tip
You can simply call accuracy(*teststats(truths, predictions)).
precision, recall, and f1¶
precision(tp, fp, tn, fn) and recall(tp, fp, tn, fn) return the precision and recall.
f1(tp, fp, tn, fn, beta=1) returns the F measure in default, and returns the F measure when beta is specified.