Created
March 15, 2020 16:28
-
-
Save ikatsov/6add8a91b68603826d96d5d5cfdc2f01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.metrics import silhouette_samples, silhouette_score | |
for space_name, space in {'t-SNE': tsne_results, | |
'original': model.wv.vectors}.items(): | |
for entity in ['department', 'aisle']: | |
s = silhouette_score(space, df_semantic_item[entity], metric="cosine") | |
print(f"Score on {space_name} space for {entity}s is {s:.4}") | |
-------------- | |
#> Score on t-SNE space for departments is -0.4912 | |
#> Score on t-SNE space for aisles is -0.7124 | |
#> Score on original space for departments is -0.05162 | |
#> Score on original space for aisles is : -0.1148 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment