LsrMetrics

class LsrMetrics(num_relations)[source]

For calculating metrics for LsrModel. Computes precision, recall, f1, auc for precision vs recall, and the optimal prediction threshold (theta). This is modified from the original. The original additionally computes an ignore score which ignores facts seen in training set.

compute(input_theta=None)[source]

Computes metrics based on data added so far.

Parameters

input_theta (optional, float) – Prediction threshold. Provide a value between 0 to 1 if you want to compute the precision and recall for that specific threshold. Otherwise the optimal based on f1 score will be computed for you.