However, when I open the related materials method document, shown in the link #2. The similarity output of the method is a distance number not a percentage. #2:Related Materials | Materials Project Documentation
Sorry for the delay. Apart from a small tweak (our docs don’t reflect the manuscript’s choice of kwargs for SiteStatsFingerprint), the differences you’re seeing are probably because the structures which compose a material have changed over time, but the similarity scores have not been updated
Here’s the corrected code which I’ll work into our documentation:
from matminer.featurizers.structure.sites import SiteStatsFingerprint
from matminer.featurizers.site.fingerprint import CrystalNNFingerprint
import numpy as np
bva = BVAnalyzer()
def get_similarity(structure_1, structure_2):
fingerprinter = SiteStatsFingerprint(
CrystalNNFingerprint.from_preset(
"ops",
distance_cutoffs=None,
x_diff_weight=None,
),
stats = ("mean","maximum",)
)
feature_vectors = [
np.array(fingerprinter.featurize(structure))
for structure in (structure_1, structure_2)
]
dist = np.linalg.norm(feature_vectors[1] - feature_vectors[0])
return 100*np.exp(-dist)