Created
November 20, 2017 12:03
-
-
Save fedden/32a69dfa7185ac6c446b8e58e5122c68 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import umap | |
from sklearn.preprocessing import MinMaxScaler | |
def get_scaled_umap_embeddings(features, neighbour, distance): | |
embedding = umap.UMAP(n_neighbors=neighbour, | |
min_dist=distance, | |
metric='correlation').fit_transform(features) | |
scaler = MinMaxScaler() | |
scaler.fit(embedding) | |
return scaler.transform(embedding) | |
umap_embeddings_mfccs = [] | |
umap_embeddings_wavenet = [] | |
neighbours = [5, 10, 15, 30, 50] | |
distances = [0.000, 0.001, 0.01, 0.1, 0.5] | |
for neighbour in neighbours: | |
for distance in distances: | |
umap_mfccs = get_scaled_umap_embeddings(mfcc_features, | |
neighbour, | |
distance) | |
umap_wavenet = get_scaled_umap_embeddings(wavenet_features, | |
neighbour, | |
distance) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey I get an error here: AttributeError: module 'umap' has no attribute 'UMAP'.. Any ideas?