Skip to content

Instantly share code, notes, and snippets.

@a-agmon
Created January 15, 2020 16:15
Show Gist options
  • Save a-agmon/39f0050cf3b84b571c156f0315529fbb to your computer and use it in GitHub Desktop.
Save a-agmon/39f0050cf3b84b571c156f0315529fbb to your computer and use it in GitHub Desktop.
#encode all the data
encoded_seqs = encode_sequence_list(seqs_ds.iloc[:,0])
#scale it
scaled_data = MinMaxScaler().fit_transform(encoded_seqs)
#predict it
predicted = autoencoder.predict(scaled_data)
#get the error term
mse = np.mean(np.power(scaled_data - predicted, 2), axis=1)
#now add them to our data frame
seqs_ds['MSE'] = mse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment