Exemple #1
0
##Perfomance evaluation
predictions = model.predict(data, "test")
predictions

labels = data.get_labels("test")
labels

utils.plot_roc(labels, predictions, output_folder + "roc.png")
utils.plot_prec_recall(labels, predictions, output_folder + "prec.png")
print(utils.get_performance_report(labels, predictions))

Image(output_folder + "roc.png")
Image(output_folder + "prec.png")

activations = model.get_max_activations(data, "test")
logos = model.visualize_all_kernels(activations, data, output_folder)
Image(output_folder + "motif_kernel_13.png")
Image(output_folder + "activations_kernel_13.png")
Image(output_folder + "position_kernel_13.png")
Image(output_folder + "data/alu.png")

utils.save_as_meme([logo[0] for logo in logos],
                   output_folder + "motifs_seq.meme")
utils.save_as_meme([logo[1] for logo in logos],
                   output_folder + "motifs_struct.meme")
model.plot_clustering(activations, output_folder + "clustering.png")
Image(output_folder + "clustering.png")

utils.save_data(data, output_folder + "data.pkl")
utils.save_model(model, output_folder + "model.pkl")
Exemple #2
0
 def test_utils_save_load_data(self):
     utils.save_data(self.data, gettempdir() + "/data")
     self.assertTrue(isfile(gettempdir() + "/data"))
     data = utils.load_data(gettempdir() + "/data")
     self.assertTrue(isinstance(data, Data))
     remove(gettempdir() + "/data")