Skip to content

Instantly share code, notes, and snippets.

@klintan
Created September 7, 2018 22:29
Show Gist options
  • Save klintan/d5cfb9323d40432ed9c66a2b51415dd9 to your computer and use it in GitHub Desktop.
Save klintan/d5cfb9323d40432ed9c66a2b51415dd9 to your computer and use it in GitHub Desktop.
Truthfinder 2
while error > tol and it < max_iteration_count:
source_trustworthiness_old = copy.deepcopy(source_trustworthiness)
# 1. Compute fact confidence score
data = compute_confidence(data, objects, source_trustworthiness, attribute_key)
# 2. Compute source trustworthiness score
source_trustworthiness = compute_source_trust(data, source_trustworthiness)
# Check convergence of the process
error = 1 - np.dot(list(source_trustworthiness.values()),
list(source_trustworthiness_old.values()) / (np.linalg.norm(list(source_trustworthiness.values())) *
np.linalg.norm(list(source_trustworthiness_old.values()))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment