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
import pylab | |
data1 = [1,2,3,4] | |
data2 = [2,3,4,5] | |
pylab.plot(data1, "-o", label="meh") | |
pylab.plot(data2, "-o", label="arr") | |
pylab.title("example") | |
pylab.grid(True) |
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
import pylab | |
def plot_roc(y, out, label="", out_fn=None): | |
""" | |
show or save ROC curve | |
""" | |
pylab.figure() | |
plot_roc_noshow(y, out, label=label) |
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
import cPickle | |
import bz2 | |
def save(filename, myobj): | |
""" | |
save object to file using pickle | |
@param filename: name of destination file | |
@type filename: str |
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
def rand_seq(alphabet, length): | |
""" | |
generates a random sequence of length over alphabet | |
@param alphabet: alphabet from which to choose characters | |
@type alphabet: list<str> | |
@param length: length of random string | |
@type length: int | |
""" |
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
def power_set(orignal_list): | |
''' | |
PowerSet of a List | |
@param orignal_list: list from which to construct a powerset | |
''' | |
list_size = len(orignal_list) | |
num_sets = 2**list_size | |
powerset = [] | |
# Don't include empty set |
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
import random | |
def coshuffle(*args): | |
""" | |
will shuffle target_list and apply | |
same permutation to other lists | |
>>> helper.coshuffle([2, 1, 3], [4, 2, 8], [6, 3, 12]) | |
([5, 3, 2, 1, 4], [5, 3, 2, 1, 4], [5, 3, 2, 1, 4]) |
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
import pylab | |
import numpy | |
def show_seqs(seqs): | |
""" | |
plot color coded training sequences | |
""" | |
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
#!/usr/bin/env python2.5 | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# Written (W) 2010-2013 Christian Widmer | |
# Copyright (C) 2010-2013 Max-Planck-Society, TU-Berlin, MSKCC | |
""" |
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
import numpy as np | |
import copy | |
import random | |
import pylab | |
import scipy.cluster.hierarchy as sch | |
def create_linkage_matrix(num_tasks): | |
""" | |
create stack of matrices for |
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
#!/usr/bin/env python2.6 | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# Written (W) 2013 Christian Widmer | |
# Copyright (C) 2013 Max-Planck-Society, MSKCC, TU-Berlin | |
""" |
OlderNewer