├── cpdetect ├── tests │ ├── __init__.py │ ├── files │ │ ├── data.npy │ │ └── data2.npz │ ├── utils.py │ └── test_cp_detector.py ├── __init__.py ├── utils.py ├── nonlinear_filter.py └── cp_detector.py ├── attic ├── figure.pdf ├── conv2math.py ├── show_plot.py ├── test_cpd.py ├── README.txt ├── test_2stateweights.py ├── 100pts.txt ├── test_splitter.py ├── data.txt ├── trajectoryGenerator.py ├── oldtype-detectionScript.py ├── poissonDetect.py ├── detectionScript.py ├── old-cpDetect.py ├── old2cpDetect.py ├── cpDetect.py └── trajectory.dat ├── examples ├── synthetic.pdf ├── true_ts.pickle ├── confusion_matrix.pdf ├── confusion_matrix.png ├── test_refinement.pdf ├── step_synthetic.pickle ├── synthetic_trajs.np.npy ├── Confusion_matrix_filtered.pdf ├── refined_confusion_matrix.png ├── ts_log_odds.csv ├── README.md ├── example_nonfiltered.py ├── example_filtered.py └── Confusion_matrix.ipynb ├── setup.py ├── README.md └── LICENSE /cpdetect/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cpdetect/__init__.py: -------------------------------------------------------------------------------- 1 | from cpdetect.cp_detector import Detector as cpDetector -------------------------------------------------------------------------------- /attic/figure.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/attic/figure.pdf -------------------------------------------------------------------------------- /examples/synthetic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/examples/synthetic.pdf -------------------------------------------------------------------------------- /examples/true_ts.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/examples/true_ts.pickle -------------------------------------------------------------------------------- /cpdetect/tests/files/data.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/cpdetect/tests/files/data.npy -------------------------------------------------------------------------------- /examples/confusion_matrix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/examples/confusion_matrix.pdf -------------------------------------------------------------------------------- /examples/confusion_matrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/examples/confusion_matrix.png -------------------------------------------------------------------------------- /examples/test_refinement.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/examples/test_refinement.pdf -------------------------------------------------------------------------------- /cpdetect/tests/files/data2.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/cpdetect/tests/files/data2.npz -------------------------------------------------------------------------------- /examples/step_synthetic.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/examples/step_synthetic.pickle -------------------------------------------------------------------------------- /examples/synthetic_trajs.np.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/examples/synthetic_trajs.np.npy -------------------------------------------------------------------------------- /examples/Confusion_matrix_filtered.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/examples/Confusion_matrix_filtered.pdf -------------------------------------------------------------------------------- /examples/refined_confusion_matrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choderalab/cpdetect/HEAD/examples/refined_confusion_matrix.png -------------------------------------------------------------------------------- /attic/conv2math.py: -------------------------------------------------------------------------------- 1 | 2 | #!/usr/bin/python 3 | from cPickle import Unpickler 4 | file=open( "trajectory-1.dat" ) 5 | out = open( "data.txt", "w" ) 6 | u = Unpickler( file ) 7 | data = u.load() 8 | for elem in data : out.write( "%f\n" % elem ) 9 | file.close() 10 | out.close() 11 | -------------------------------------------------------------------------------- /attic/show_plot.py: -------------------------------------------------------------------------------- 1 | 2 | #!/usr/bin/python 3 | 4 | import sys 5 | import cPickle 6 | import matplotlib.pyplot as plt 7 | 8 | filename = sys.argv[1] 9 | file = open( filename ) 10 | u = cPickle.Unpickler( file ) 11 | trajectory=u.load() 12 | 13 | plt.plot( trajectory, "o", color=(0,0,0) ) 14 | plt.show() 15 | -------------------------------------------------------------------------------- /attic/test_cpd.py: -------------------------------------------------------------------------------- 1 | 2 | #!/usr/bin/python 3 | 4 | from cpDetect import * 5 | 6 | data = load_testdata() 7 | #print "data:", data 8 | print "number of points:", len(data) 9 | 10 | mean_var_array=calc_mean_mss( data ) 11 | 12 | print numpy.array( mean_var_array ) 13 | print "number of points:", len(mean_var_array) 14 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup(name='cpdetect', 4 | description='Bayesian Change point detection', 5 | url='https://github.com/choderalab/cpdetect', 6 | author='Chaya D. Stern', 7 | packages=['cpdetect', 'cpdetect.tests'], 8 | install_requires=[ 9 | 'numpy', 10 | 'pandas', 11 | 'scipy' 12 | ]) -------------------------------------------------------------------------------- /examples/ts_log_odds.csv: -------------------------------------------------------------------------------- 1 | ,ts,log_odds,start_end 2 | 0,500.0,69.0431674762,"(0, 4500)" 3 | 0,1000.0,33.6929122613,"(500, 4500)" 4 | 0,1502.0,63.7269084683,"(1000, 4500)" 5 | 0,1970.0,49.1979964847,"(1502, 4500)" 6 | 0,2511.0,13.7408498616,"(1502, 3000)" 7 | 0,3000.0,1.96064583383,"(1502, 2511)" 8 | 0,3502.0,114.607239634,"(3000, 4500)" 9 | 0,3970.0,2.69324946338,"(3502, 4500)" 10 | 1,490.0,222.665465863,"(0, 1500)" 11 | 1,997.0,0.377356252234,"(0, 997)" 12 | -------------------------------------------------------------------------------- /attic/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Optimization: 3 | 4 | 1. '../fast-means/maybeMeans.py' seemed faster than '../fast-means/slowerMeans.py.' The latter just called mean() and var() 5 | methods repeatedly, while the former keeps track of stacks of numbers (which data is in which pile) and calculates only 6 | N averages, average squares, and variances. However, when implemented in cpDetect it did not seem that much faster. 7 | 8 | result: move cpDetect.py to old-cpDetect.py 9 | 10 | 2. tabulated gamma. 11 | N with table without table 12 | 1000 2.116 s 3.827 s 13 | 10000 31.329 s 60.942 s 14 | -------------------------------------------------------------------------------- /attic/test_2stateweights.py: -------------------------------------------------------------------------------- 1 | 2 | #!/usr/bin/python 3 | 4 | import scipy 5 | from cpDetect import * 6 | import matplotlib.pyplot as plt 7 | from mpmath import log, mpf 8 | 9 | FILE=open( "trajectory-1.dat", "r" ) 10 | u = cPickle.Unpickler( FILE ) 11 | trajectory = scipy.array( u.load() ) 12 | 13 | wts = calc_twostate_weights(trajectory) 14 | for i in range( len(wts) ): print i, wts[i] 15 | 16 | # normalize the weights 17 | tot = mpf( 0.0 ) 18 | for elem in wts: tot+=elem 19 | print tot 20 | 21 | logwts = [] 22 | for elem in wts : logwts.append( log(elem,10 )) 23 | 24 | for i in range( len(logwts) ): print i, logwts[i] 25 | 26 | plt.plot( logwts ) 27 | plt.show() 28 | 29 | -------------------------------------------------------------------------------- /attic/100pts.txt: -------------------------------------------------------------------------------- 1 | 2 | 1 3 | 4 4 | 1 5 | 1 6 | 1 7 | 1 8 | 2 9 | 0 10 | 0 11 | 2 12 | 13 13 | 11 14 | 14 15 | 12 16 | 7 17 | 11 18 | 17 19 | 6 20 | 9 21 | 15 22 | 9 23 | 16 24 | 10 25 | 8 26 | 12 27 | 16 28 | 9 29 | 10 30 | 15 31 | 10 32 | 10 33 | 9 34 | 12 35 | 6 36 | 12 37 | 7 38 | 6 39 | 8 40 | 13 41 | 11 42 | 10 43 | 9 44 | 8 45 | 6 46 | 10 47 | 10 48 | 10 49 | 12 50 | 6 51 | 13 52 | 6 53 | 13 54 | 13 55 | 13 56 | 7 57 | 12 58 | 11 59 | 9 60 | 7 61 | 5 62 | 5 63 | 5 64 | 5 65 | 3 66 | 4 67 | 4 68 | 5 69 | 4 70 | 3 71 | 4 72 | 8 73 | 2 74 | 2 75 | 5 76 | 4 77 | 3 78 | 8 79 | 4 80 | 5 81 | 5 82 | 1 83 | 5 84 | 3 85 | 3 86 | 4 87 | 7 88 | 4 89 | 7 90 | 6 91 | 7 92 | 7 93 | 3 94 | 1 95 | 6 96 | 2 97 | 4 98 | 3 99 | 8 100 | 3 101 | 2 102 | -------------------------------------------------------------------------------- /cpdetect/tests/utils.py: -------------------------------------------------------------------------------- 1 | from pkg_resources import resource_filename 2 | import os 3 | 4 | 5 | def get_fn(filename, written=False): 6 | """Get the full path to one of the reference files shipped for testing 7 | 8 | These files are in torsionfit/testing/reference 9 | 10 | :param 11 | name: str 12 | Name of file to load 13 | 14 | :returns 15 | fn : str 16 | full path to file 17 | """ 18 | if written: 19 | fn = resource_filename('cpdetect', os.path.join('tests', 'files', 'writes', filename)) 20 | else: 21 | fn = resource_filename('cpdetect', os.path.join('tests', 'files', filename)) 22 | 23 | #if not os.path.exists(fn): 24 | # raise ValueError('%s does not exist. If you just added it you will have to re install' % fn) 25 | 26 | return fn 27 | -------------------------------------------------------------------------------- /attic/test_splitter.py: -------------------------------------------------------------------------------- 1 | 2 | #!/usr/bin/python 3 | 4 | from cpDetect import ChangePointDetector 5 | from numpy import array, ones, column_stack 6 | from random import randint 7 | 8 | NONE = None 9 | 10 | datalen=20 11 | data = ones( datalen ) 12 | for i in range( randint(1,10 ) ) : 13 | data[ randint(0, datalen-1) ] = randint(2, 100) 14 | data[17]=101.0 15 | print "data length", len(data) 16 | timepts = array( range(datalen) ) 17 | 18 | print "arg max:", data.argmax() 19 | 20 | def function( data ): 21 | npts = len(data) 22 | if npts > 5 : 23 | max=3+data[3:-2].argmax() 24 | min=3+data[3:-2].argmin() 25 | if data[max] > data[min] : 26 | return max 27 | else: return NONE 28 | else: return NONE 29 | 30 | def function2( data ): 31 | # if the 'data' array is not empty, return 32 | if len(data)>0: 33 | amax = data.argmax() 34 | else: return NONE 35 | if data[amax] > 1: return amax 36 | else: return NONE 37 | 38 | cpd= ChangePointDetector( data, function ) 39 | cpd.split( 0, len( data ), verbose=True ) 40 | 41 | print column_stack( (data, timepts) ) 42 | #cpd.changepoints.sort() 43 | print cpd.changepoints 44 | -------------------------------------------------------------------------------- /attic/data.txt: -------------------------------------------------------------------------------- 1 | 2 | 49.680199 3 | 51.667540 4 | 50.238841 5 | 50.341118 6 | 50.247083 7 | 48.861537 8 | 52.288843 9 | 50.039305 10 | 51.254395 11 | 50.811335 12 | 49.152157 13 | 50.834970 14 | 51.450416 15 | 51.562621 16 | 51.663200 17 | 52.421306 18 | 51.128993 19 | 51.709788 20 | 52.560860 21 | 52.771587 22 | 51.887091 23 | 52.525995 24 | 52.312740 25 | 52.289705 26 | 50.979121 27 | 51.848799 28 | 51.048845 29 | 51.197734 30 | 52.238135 31 | 52.544505 32 | 51.618252 33 | 51.549746 34 | 51.305986 35 | 52.403563 36 | 53.080316 37 | 52.030125 38 | 52.679011 39 | 52.098904 40 | 52.169686 41 | 52.445361 42 | 52.262756 43 | 44.028987 44 | 49.448679 45 | 46.051843 46 | 38.944709 47 | 43.456068 48 | 45.249204 49 | 44.993101 50 | 49.017942 51 | 47.799100 52 | 49.808166 53 | 50.179213 54 | 37.723214 55 | 44.332136 56 | 39.117955 57 | 38.265214 58 | 38.490289 59 | 44.834664 60 | 43.039055 61 | 47.070771 62 | 42.509371 63 | 45.939831 64 | 44.077206 65 | 37.793076 66 | 40.543037 67 | 41.167947 68 | 48.208440 69 | 49.384098 70 | 40.241809 71 | 40.299624 72 | 44.093911 73 | 45.972379 74 | 37.362315 75 | 45.589540 76 | 41.887643 77 | 45.379447 78 | 52.574653 79 | 51.194650 80 | -------------------------------------------------------------------------------- /cpdetect/utils.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file is part of cpdetect (change point detection) 3 | 4 | Author: Chaya D. Stern 5 | Date: 11-30-2016 6 | """ 7 | 8 | import logging 9 | import sys 10 | 11 | verbose = False 12 | 13 | 14 | def logger(name='cpDetector', pattern='%(asctime)s %(levelname)s %(name)s: %(message)s', 15 | date_format='%H:%M:%S', handler=logging.StreamHandler(sys.stdout)): 16 | """ 17 | Retrieves the logger instance associated to the given name 18 | :param name: The name of the logger instance 19 | :param pattern: The associated pattern 20 | :param date_format: The date format to be used in the pattern 21 | :param handler: The logging handler 22 | :return: The logger 23 | """ 24 | _logger = logging.getLogger(name) 25 | _logger.setLevel(log_level(verbose)) 26 | 27 | if not _logger.handlers: 28 | formatter = logging.Formatter(pattern, date_format) 29 | handler.setFormatter(formatter) 30 | handler.setLevel(log_level(verbose)) 31 | _logger.addHandler(handler) 32 | _logger.propagate = False 33 | return _logger 34 | 35 | 36 | def log_level(verbose=verbose): 37 | if verbose: 38 | return logging.DEBUG 39 | else: 40 | return logging.INFO 41 | -------------------------------------------------------------------------------- /attic/trajectoryGenerator.py: -------------------------------------------------------------------------------- 1 | 2 | import cPickle 3 | import random 4 | 5 | maxnpts=5000; 6 | nstates = 3 # int( random.uniform( 5, 15) ) 7 | davg_max = random.uniform( 5, 15 ) 8 | dsig_max = 5 # random.uniform( .1, .3 ) 9 | 10 | # initial values 11 | avg=50 12 | sigma=1 13 | ptrans = 0.1 # random.uniform( 0.001, .05 ) 14 | 15 | # build the trajectory 16 | npts = 0 17 | state = 0 18 | trajectory=[] 19 | statemod=200 20 | while True : 21 | 22 | sample = random.gauss( avg, sigma ) 23 | trajectory.append( sample ) 24 | npts += 1 25 | 26 | # quit if the maximum has been reached 27 | if npts >= maxnpts : break 28 | """ 29 | # test for a new state 30 | if random.random() < ptrans : 31 | print "!! change point at %d !!" % npts 32 | ptrans = random.uniform( 0.001, .05 ) 33 | avg = avg+random.uniform( -davg_max, davg_max ) 34 | sigma = abs( sigma+random.uniform( -dsig_max, dsig_max ) ) 35 | state += 1 36 | 37 | # test if we need a new state 38 | if state > nstates: break 39 | """ 40 | try: 41 | if (npts%statemod) == 0: 42 | print "change of state!" 43 | statemod=statemod+random.randint(-100,100) 44 | avg += 10 45 | sigma += 1 46 | except ZeroDivisionError: pass 47 | 48 | 49 | FILE=open("trajectory-1.dat","w") 50 | p=cPickle.Pickler( FILE ) 51 | p.dump( trajectory ) 52 | -------------------------------------------------------------------------------- /attic/oldtype-detectionScript.py: -------------------------------------------------------------------------------- 1 | 2 | #!/usr/bin/python 3 | 4 | from time import time 5 | from old2cpDetect import * 6 | import matplotlib.pyplot as plt 7 | import scipy 8 | from numpy import ones 9 | from mpmath import mpf, gamma 10 | import cPickle 11 | 12 | FILE=open( "trajectory-1.dat", "r" ) 13 | u = cPickle.Unpickler( FILE ) 14 | trajectory = scipy.array( u.load() ) 15 | 16 | cpd = ChangePointDetector( trajectory,findGaussianChangePoint ) 17 | 18 | # the part we want to time 19 | t0 = time() 20 | print "splitting" 21 | cpd.split_init() 22 | t1 = time() 23 | print "took %3.3f seconds" % ( t1-t0 ) 24 | cpd.sort() 25 | cpd.showall() 26 | print "found %d change points" % cpd.nchangepoints() 27 | 28 | times = array( range( len(trajectory) ) ) 29 | 30 | ymax= trajectory.max() * 1.01 31 | ymin= trajectory.min() * 0.99 32 | 33 | # get the shade scale. Any cp will have log B > 0, so scale to the biggest one 34 | for i in range( cpd.nchangepoints() ): 35 | changepoint = cpd.changepoints[i] 36 | y = ( ymin, ymax ) 37 | x = changepoint * ones( len(y) ) 38 | logodds = cpd.logodds[changepoint] 39 | 40 | if logodds > 1: color=(0,0,0) # black 41 | elif logodds > 0.477: color=(.5,.5,.5) # dark gray 42 | else : color=(.7,.7,.7) # light gray 43 | 44 | print "point ", changepoint, "log odds", logodds, "color", color 45 | plt.plot( x, y, "-", color=color, linewidth=1.5 ) 46 | 47 | plt.plot( times, trajectory, "b-" ) 48 | plt.savefig( "figure.eps" ) 49 | plt.show() 50 | -------------------------------------------------------------------------------- /attic/poissonDetect.py: -------------------------------------------------------------------------------- 1 | 2 | #!/usr/bin/python 3 | 4 | import matplotlib.pyplot as plt 5 | from time import time 6 | from numpy.random import poisson 7 | from numpy import concatenate, ones 8 | from cpDetect import * 9 | from mpmath import gamma 10 | 11 | l1=5 ; l2=8 12 | n1=150 ; n2=100 13 | d1=poisson( l1, n1 ) 14 | d2=poisson( l2, n2 ) 15 | trajectory = concatenate( (d1,d2,d1,d1,d2) ) 16 | 17 | # build factorial table 18 | factorial=[] 19 | maxc = trajectory.sum()+2 20 | for i in range(1,maxc): 21 | factorial.append( gamma(i) ) 22 | 23 | cpd = ChangePointDetector( trajectory,findPoissonChangePoint,factorial) 24 | 25 | # the part we want to time 26 | t0 = time() 27 | print "splitting" 28 | cpd.split_init() 29 | t1 = time() 30 | print "took %3.3f seconds" % ( t1-t0 ) 31 | cpd.sort() 32 | cpd.showall() 33 | print "found %d change points" % cpd.nchangepoints() 34 | 35 | times = array( range( len(trajectory) ) ) 36 | 37 | ymax= trajectory.max() * 1.01 38 | ymin= trajectory.min() * 0.99 39 | 40 | # get the shade scale. Any cp will have log B > 0, so scale to the biggest one 41 | for i in range( cpd.nchangepoints() ): 42 | changepoint = cpd.changepoints[i] 43 | y = ( ymin, ymax ) 44 | x = changepoint * ones( len(y) ) 45 | logodds = cpd.logodds[changepoint] 46 | 47 | if logodds > 1: color=(0,0,0) # black 48 | elif logodds > 0.477: color=(.5,.5,.5) # dark gray 49 | else : color=(.7,.7,.7) # light gray 50 | 51 | print "point ", changepoint, "log odds", logodds, "color", color 52 | plt.plot( x, y, "-", color=color, linewidth=1.5 ) 53 | 54 | plt.plot( times, trajectory, "b-" ) 55 | plt.savefig( "figure.eps" ) 56 | plt.show() 57 | -------------------------------------------------------------------------------- /attic/detectionScript.py: -------------------------------------------------------------------------------- 1 | 2 | #!/usr/bin/python 3 | 4 | from time import time 5 | from cpDetect import * 6 | import matplotlib.pyplot as plt 7 | import scipy 8 | from numpy import ones 9 | from mpmath import mpf, gamma 10 | import cPickle 11 | 12 | FILE=open( "trajectory-1.dat", "r" ) 13 | u = cPickle.Unpickler( FILE ) 14 | trajectory = scipy.array( u.load() ) 15 | 16 | # generate gamma function table 17 | t0=time() 18 | print "generating gamma function table" 19 | gammatable=[-99,-99,-99] # first three points don't make sense 20 | for i in range(3,len(trajectory)+1): gammatable.append( gamma( 0.5*i - 1 ) ) 21 | t1=time() 22 | print "took %3.3f seconds" % ( t1-t0 ) 23 | 24 | cpd = ChangePointDetector( trajectory,findGaussianChangePoint, gammatable ) 25 | 26 | # the part we want to time 27 | t0 = time() 28 | print "splitting" 29 | cpd.split_init() 30 | t1 = time() 31 | print "took %3.3f seconds" % ( t1-t0 ) 32 | cpd.sort() 33 | cpd.showall() 34 | print "found %d change points" % cpd.nchangepoints() 35 | 36 | times = array( range( len(trajectory) ) ) 37 | 38 | ymax= trajectory.max() * 1.01 39 | ymin= trajectory.min() * 0.99 40 | 41 | # get the shade scale. Any cp will have log B > 0, so scale to the biggest one 42 | for i in range( cpd.nchangepoints() ): 43 | changepoint = cpd.changepoints[i] 44 | y = ( ymin, ymax ) 45 | x = changepoint * ones( len(y) ) 46 | logodds = cpd.logodds[changepoint] 47 | 48 | if logodds > 1: color=(0,0,0) # black 49 | elif logodds > 0.477: color=(.5,.5,.5) # dark gray 50 | else : color=(.7,.7,.7) # light gray 51 | 52 | print "point ", changepoint, "log odds", logodds, "color", color 53 | plt.plot( x, y, "-", color=color, linewidth=1.5 ) 54 | 55 | plt.plot( times, trajectory, "b-" ) 56 | plt.savefig( "figure.eps" ) 57 | plt.show() 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | cpDetect 2 | ======== 3 | 4 | Bayesian change point detection 5 | 6 | Installation 7 | ------------- 8 | Install directly from source directory. 9 | `python setup.py install` 10 | 11 | Requirement 12 | ------------- 13 | * python 2.7 14 | * NumPy 15 | * Pandas 16 | * SciPy 17 | 18 | Usage 19 | ----- 20 | 21 | To run `cpDetect`, the timeseries data needs to be a list of 1-D numpy arrays. They do not have to be of the same size 22 | First, instantiate the detector. Choose the underlying distribution (normal or log normal) and the log odds threshold 23 | (default is 0). 24 | 25 | ``` 26 | detector = cpDetector(trajs, distribution='log_normal', log_odds_threshold=0) 27 | detector.detect_cp() 28 | ``` 29 | 30 | `cpDetect` can sometimes miss fast transitions. If you find that this is the case for your data, you can try the refinement step 31 | (see `refinement.ipynb` in `examples/` for an illustration how this step works. 32 | 33 | ``` 34 | detector.refinement(threshold=-2, reject_window=20, split_windor=50) 35 | ``` 36 | 37 | The results of the refinement step are stored in the `.refined_change_point` dictionary. You can also regenerate the 38 | step function: 39 | 40 | ``` 41 | detector.regenerate_step_function() 42 | ``` 43 | 44 | Save the change points, log odds and the start, end for each segment: 45 | 46 | ``` 47 | detector.to_csv('filename.csv') 48 | ``` 49 | 50 | You can save the step function to a pandas data frame: 51 | 52 | ``` 53 | df = pd.DataFreame.from_dict(detector.step_function, orient='index') 54 | df.to_csv('step_function.csv') 55 | ``` 56 | 57 | See `examples/` for confusion matrices and more on the refinement step. 58 | 59 | Filtering 60 | --------- 61 | 62 | `nonlinear_filter.py` implements the non-linear filter from Chung and Kennedy [DOI](https://www.ncbi.nlm.nih.gov/pubmed/1795554) 63 | 64 | Reference 65 | --------- 66 | * Ensign DL and Pande VS. Bayesian Detection of Intensity Changes in Single Molecule and Molecular Dynamics Trajectories. 67 | J. Phys. Chem B 114:280 (2010) [DOI](http://pubs.acs.org/doi/abs/10.1021/jp906786b) 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | Examples 2 | ======== 3 | 4 | All examples are on randomly generated synthetic data. 5 | 6 | Manifest 7 | -------- 8 | * **Simple example:** 9 | * `example.ipynb` - simple example on 2 trajectories 10 | * `ts_log_odss.csv` - saved change points from simple example 11 | 12 | * **Synthtic Data:** 13 | * `synthetic_data.ipynb` - notebook that generated synthetic trajectories 14 | * `synthetic.pdf` - plots of all synthetic trajectories and true step functions (in red). 15 | * `synthetic_trajs.np.npy` - synthetic trajectories. 16 | * `true_ts.pickle` - pickled dictionary of true change points for synthetic trajectories. 17 | * `step_synthetic.pickle` - true step function for synthetic trajectories. 18 | 19 | * **Confusion matrices:** 20 | * `example_nonfiltered.py` - run cpDetect with several different thresholds 21 | to calculate confusion matrices for each. Data was not filtered. 22 | * `example_filtered.py` - run cpDetect on filtered data with several different 23 | thresholds. 24 | * `confusion_matrix.ipynb` - ipython notebook that calculates the confusion matrix 25 | for each threshold. Unfiltered data 26 | * `confusion_matrix_filtered.ipynb` - ipython notebook that calculates the confusion 27 | matrix for each threshold. Data is filtered. 28 | * `confusion_matrix.pdf` - confusion matrices for all 10 runs. Unfiltered data 29 | * `confusion_matrix_filtered.pdf` - confusion matrices for all 10 runs. Filtered data 30 | 31 | While cpDetect on filtered data misses less change points, it also founds many 32 | false positives. Use a higher threshold when data is filtered. 33 | 34 | * **Clean up step (refinement):** 35 | * `refinement.ipynb` - ipython notebook illustrating refinement step 36 | * `confusion_matrix.png` - confusion matrix before refinement 37 | * `refined_confusion_matrix.png` - confusion matrix after refinement 38 | * `test_refinement.pdf` - results from refinement step on synthetic trajectories. 39 | red - true step function; black - predicted step function from initial cpDetect run; 40 | green lines - change points found with refinement step. 41 | 42 | -------------------------------------------------------------------------------- /examples/example_nonfiltered.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from cpdetect import cpDetector, nonlinear_filter 3 | import pandas as pd 4 | from tqdm import * 5 | try: 6 | import cPickle as pickle 7 | except: 8 | import pickle 9 | import matplotlib.pyplot as plt 10 | import matplotlib as mpl 11 | from matplotlib.backends.backend_pdf import PdfPages 12 | 13 | 14 | # Load synthetic trajectories 15 | trajs = np.load('synthetic_trajs.np.npy') 16 | true_step = pickle.load(open('step_synthetic.pickle', 'rb')) 17 | trajs = trajs.tolist() 18 | 19 | # Run them through cpdetect for thresholds (-10, 0) 20 | for i in range(10): 21 | detector = cpDetector(trajs, distribution='log_normal', log_odds_threshold=-i) 22 | detector.detect_cp() 23 | # pickle detector 24 | pickle.dump(detector, open('detector_{}.pickle'.format(str(i)), 'wb')) 25 | # save steps 26 | df = pd.DataFrame.from_dict(detector.step_function, orient='index') 27 | df.to_csv('step_function_{}.csv'.format(str(i))) 28 | detector.to_csv('ts_log_odds_{}.csv'.format(str(i))) 29 | 30 | # Plot 31 | filename = 'synthetic_{}.pdf'.format(str(i)) 32 | fontsize = 6 33 | x_spacing = 1000 34 | time_res = 1.0 35 | chunk = len(trajs)/4 36 | with PdfPages(filename) as pdf: 37 | for i in tqdm(range(int(chunk))): 38 | fig = plt.figure() 39 | for j in range(4): 40 | ax = fig.add_subplot(2, 2, j+1) 41 | ax.plot(trajs[4*i + j], alpha=0.6) 42 | ax.plot(true_step['traj_{}'.format(4*i +j)], color='red', linewidth=1.0) 43 | ax.plot(detector.step_function['traj_{}'.format(str(4*i+j))], 'black', 44 | linewidth=1.0) 45 | if j in (2,3): 46 | #plt.xlim([0, 3580]) 47 | #ax.xaxis.limit_range_for_scale(0, 3580) 48 | #ax.xaxis.set_ticks([k*time_res*(3580/4) for k in range(5)]) 49 | ax.xaxis.set_label_text('Time (seconds)') 50 | else: 51 | #plt.xlim([0, 3580]) 52 | 53 | ax.xaxis.set_ticks([k*time_res*(3580/4) for k in range(5)]) 54 | #ax.xaxis.set_ticks([]) 55 | pdf.savefig(bbox_inches='tight') 56 | plt.close() 57 | 58 | 59 | -------------------------------------------------------------------------------- /examples/example_filtered.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from cpdetect import cpDetector, nonlinear_filter 3 | import pandas as pd 4 | from tqdm import * 5 | try: 6 | import cPickle as pickle 7 | except: 8 | import pickle 9 | import matplotlib.pyplot as plt 10 | import matplotlib as mpl 11 | from matplotlib.backends.backend_pdf import PdfPages 12 | 13 | 14 | # Load synthetic trajectories 15 | trajs = np.load('synthetic_trajs.np.npy') 16 | true_step = pickle.load(open('step_synthetic.pickle', 'rb')) 17 | 18 | # run through filter 19 | windows = [2, 4, 6, 8, 16] 20 | M = 12 21 | p = 30 22 | filtered_trajs = [] 23 | for traj in trajs: 24 | filtered_trajs.append(nonlinear_filter.nfl_filter(traj, windows, M, p)) 25 | 26 | # save filtered trajs 27 | np.save(file='filtered_trajs', arr=filtered_trajs) 28 | 29 | # Run them through cpdetect for thresholds (-10, 0) 30 | for i in range(11): 31 | detector = cpDetector(filtered_trajs, distribution='log_normal', log_odds_threshold=-i) 32 | detector.detect_cp() 33 | # pickle detector 34 | pickle.dump(detector, open('filtered_detector_{}.pickle'.format(str(i)), 'wb')) 35 | # save steps 36 | df = pd.DataFrame.from_dict(detector.step_function, orient='index') 37 | df.to_csv('filtered_step_function_{}.csv'.format(str(i))) 38 | detector.to_csv('ts_log_odds_filtered_{}.csv'.format(str(i))) 39 | 40 | # Plot 41 | filename = 'synthetic_filtered_{}.pdf'.format(str(i)) 42 | fontsize = 6 43 | x_spacing = 1000 44 | time_res = 1.0 45 | chunk = len(trajs)/4 46 | with PdfPages(filename) as pdf: 47 | for i in tqdm(range(int(chunk))): 48 | fig = plt.figure() 49 | for j in range(4): 50 | ax = fig.add_subplot(2, 2, j+1) 51 | ax.plot(trajs[4*i + j], alpha=0.6) 52 | ax.plot(true_step['traj_{}'.format(4*i +j)], color='red', linewidth=1.0) 53 | ax.plot(detector.step_function['traj_{}'.format(str(4*i+j))], 'black', 54 | linewidth=1.0) 55 | if j in (2,3): 56 | #plt.xlim([0, 3580]) 57 | #ax.xaxis.limit_range_for_scale(0, 3580) 58 | #ax.xaxis.set_ticks([k*time_res*(3580/4) for k in range(5)]) 59 | ax.xaxis.set_label_text('Time (seconds)') 60 | else: 61 | #plt.xlim([0, 3580]) 62 | 63 | ax.xaxis.set_ticks([k*time_res*(3580/4) for k in range(5)]) 64 | #ax.xaxis.set_ticks([]) 65 | pdf.savefig(bbox_inches='tight') 66 | plt.close() 67 | 68 | 69 | -------------------------------------------------------------------------------- /cpdetect/nonlinear_filter.py: -------------------------------------------------------------------------------- 1 | """ 2 | Non-linear filter adapted from Chung and Kennedy 3 | """ 4 | 5 | import numpy as np 6 | 7 | 8 | def nfl_filter(traj, windows, M, p): 9 | """ 10 | 11 | Parameters 12 | ---------- 13 | traj: numpy 1-D array 14 | trajectory 15 | windows: list of ints 16 | lenghts of windows to calculate forward and reverse predictors 17 | M: int 18 | size of window over which the predictors are to be compared 19 | p: int 20 | weighting factor 21 | 22 | 23 | Returns 24 | ------- 25 | filtered_traj: numpy 1-D arraay 26 | NLF filtered trajectory 27 | """ 28 | start_index = max(windows) + M 29 | filtered_traj = np.zeros(len(traj)-2*start_index) 30 | I_forward = np.zeros((len(windows), len(traj) - 2*start_index)) 31 | I_reverse = np.zeros((len(windows), len(traj) - 2*start_index)) 32 | for i in range(I_forward.shape[-1]): 33 | for j, k in enumerate(windows): 34 | I_forward[j,i] = forward_predictor(traj, k, i+start_index-1) 35 | I_reverse[j,i] = reverse_predictor(traj, k, i+start_index-1) 36 | for i in range(start_index, len(traj) - start_index): 37 | f_k = np.zeros(len(windows)) 38 | b_k = np.zeros(len(windows)) 39 | for j, k in enumerate(windows): 40 | for m in range(M-1): 41 | f_k[j] += (traj[i-m] - I_forward[j, i-m-start_index])**2 42 | b_k[j] += (traj[i-m] - I_reverse[j, i-m-start_index])**2 43 | f_k[j] = f_k[j]**-p 44 | b_k[j] = b_k[j]**-p 45 | c = f_k.sum() + b_k.sum() 46 | 47 | for k in range(len(windows)): 48 | filtered_traj[i-start_index] += f_k[k]*I_forward[k, i-start_index] + \ 49 | b_k[k]*I_reverse[k, i-start_index] 50 | filtered_traj[i-start_index] /= c 51 | return filtered_traj 52 | 53 | 54 | def forward_predictor(traj, N, i): 55 | """ 56 | 57 | Parameters 58 | ---------- 59 | traj: numpy array 60 | trajectory 61 | N: int 62 | size of window 63 | i: int 64 | index 65 | 66 | Returns 67 | ------- 68 | average intensity of forward window 69 | """ 70 | return sum(traj[i-N:i-1])/N 71 | 72 | 73 | def reverse_predictor(traj, N, i): 74 | """ 75 | 76 | Parameters 77 | ---------- 78 | traj: numpy array 79 | trajectory 80 | N: int 81 | size of window 82 | i: int 83 | index 84 | 85 | Returns 86 | ------- 87 | average intensity of reverse window 88 | """ 89 | return sum(traj[i+1:i+N])/N 90 | -------------------------------------------------------------------------------- /cpdetect/tests/test_cp_detector.py: -------------------------------------------------------------------------------- 1 | """ Test Change Point detector """ 2 | 3 | from cpdetect import cpDetector 4 | from cpdetect.cp_detector import (Normal, LogNormal) 5 | from cpdetect.tests.utils import get_fn 6 | import numpy as np 7 | import unittest 8 | import pandas as pd 9 | from scipy.special import gammaln 10 | 11 | data = np.load(get_fn('data.npy')) 12 | data_2 = np.load(get_fn('data2.npz')) 13 | 14 | # Convert to cpDetect format 15 | data_2 = [data_2[i] for i in data_2.files] 16 | detector = cpDetector(data_2, distribution='log_normal', log_odds_threshold=-10) 17 | 18 | 19 | class TestCpDetect(unittest.TestCase): 20 | 21 | def test_lognormal(self): 22 | """ Test Log-normal mean and variance """ 23 | 24 | mean, var = LogNormal.mean_var(data) 25 | self.assertEqual(mean, 1.0081320131891722) 26 | self.assertEqual(var, 0.010999447786412363) 27 | 28 | def test_normal(self): 29 | """Test Normal mean and variance""" 30 | 31 | mean, var = Normal.mean_var(data) 32 | self.assertEqual(mean, 2.7556468814327055) 33 | self.assertEqual(var, 0.084910408984515948) 34 | 35 | def test_detector_init(self): 36 | """ Test cp detector initiation """ 37 | 38 | self.assertEqual(detector.distribution, 'log_normal') 39 | self.assertEqual(detector.nobservations, 2) 40 | self.assertEqual(detector.observation_lengths, [2500, 3000]) 41 | self.assertEqual(detector.threshold, -10) 42 | 43 | def test_log_gamma(self): 44 | """ Test log gamma """ 45 | gammas = [-99, -99, -99] 46 | for i in range(3, max(detector.observation_lengths) + 1): 47 | gammas.append(gammaln(0.5*i - 1)) 48 | 49 | self.assertEqual(gammas, detector.loggamma) 50 | 51 | def test_split(self): 52 | """ Test split """ 53 | 54 | def test_log_odds(self): 55 | """ test log odds calculation and finding ts """ 56 | p, t, log_odds = detector._normal_lognormal_bf(data) 57 | self.assertEqual(t, 1436) 58 | self.assertAlmostEqual(log_odds, 5.1818026662176635, 2) 59 | 60 | def test_cpdetect(self): 61 | """ Test the detector """ 62 | 63 | detector.detect_cp() 64 | 65 | data = {'ts':[1500, 1019], 'log_odds': [21.322622, -6.867833], 66 | 'start_end': [(0, 2500), (0, 1500)]} 67 | df = pd.DataFrame(data, columns=['ts', 'log_odds', 'start_end']) 68 | self.assertTrue(df['ts'].equals(detector.change_points['traj_0']['ts'])) 69 | self.assertTrue(df['start_end'].equals(detector.change_points['traj_0']['start_end'])) 70 | self.assertAlmostEqual(df['log_odds'][0], detector.change_points['traj_0']['log_odds'][0], 1) 71 | self.assertTrue(len(detector.change_points['traj_0']), 2) 72 | self.assertTrue(len(detector.change_points['traj_1']), 3) 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /attic/old-cpDetect.py: -------------------------------------------------------------------------------- 1 | 2 | # function to quickly calculate the means and means sums of squares of 3 | # all the partitions of a set of points 4 | 5 | import cPickle 6 | import numpy 7 | from math import pi 8 | from scipy import array 9 | from mpmath import log, gamma, mpf # arbitrary float precision! 10 | 11 | def load_testdata( filename = "trajectory.dat" ): 12 | FILE = open( filename ) 13 | u = cPickle.Unpickler( FILE ) 14 | data = u.load() 15 | FILE.close() 16 | return data 17 | 18 | # for Gaussian noise only. For this reason, the first three points and the last two points 19 | # cannot correspond to a change point. Thus, we return an array of length (npts-5). 20 | def calc_mean_mss( data ): 21 | #data = numpy.array( data, "float64" ) 22 | npts = len( data ) 23 | 24 | mean_var_array=[] 25 | 26 | points = range( 3, npts-2 ) 27 | for i in points : 28 | dataA = data[ 0:i ] 29 | dataB = data[ i: ] 30 | 31 | lenA = len( dataA ) 32 | lenB = len( dataB ) 33 | 34 | dataA2 = dataA**2 35 | dataB2 = dataB**2 36 | 37 | mean_dataA = dataA.mean() 38 | mean_dataB = dataB.mean() 39 | 40 | mean_dataA2 = (dataA2).mean() 41 | mean_dataB2 = (dataB2).mean() 42 | 43 | mean2_dataA = mean_dataA**2 44 | mean2_dataB = mean_dataB**2 45 | 46 | varA = mean_dataA2 - mean2_dataA 47 | varB = mean_dataB2 - mean2_dataB 48 | 49 | mean_var_array.append( (lenA, mean2_dataA, varA, lenB, mean2_dataB, varB) ) 50 | return mean_var_array 51 | 52 | # uses calc_mean_mss() to compute the relative weights of the switch time 53 | def calc_twostate_weights( data ): 54 | weights=[0,0,0] # the change cannot have occurred in the last 3 points 55 | means_mss=calc_mean_mss( data ) 56 | 57 | i=0 58 | try: 59 | for nA, mean2A, varA, nB, mean2B, varB in means_mss : 60 | #print "computing for data", nA, mean2A, varA, nB, mean2B, varB 61 | numf1 = calc_alpha( nA, mean2A, varA ) 62 | numf2 = calc_alpha( nB, mean2B, varB ) 63 | denom = (varA + varB) * (mean2A*mean2B) 64 | weights.append( (numf1*numf2)/denom) 65 | i += 1 66 | except: 67 | print "failed at data", i # means_mss[i] 68 | print "---" 69 | print means_mss 70 | print "---" 71 | raise 72 | 73 | weights.extend( [0,0] ) # the change cannot have occurred at the last 2 points 74 | return array( weights ) 75 | 76 | def calc_alpha( N, x2, s2 ): 77 | first = mpf(N)**(-N/2.0 + 1.0/2.0) 78 | second = mpf(s2)**(-N/2.0 + 1.0 ) 79 | third = gamma( mpf(N)/2.0 - 1.0 ) 80 | return first*second*third 81 | 82 | def findGaussianChangePoint( data ): 83 | 84 | # the denominator. This is the easy part. 85 | N = len( data ) 86 | 87 | if N<6 : return None # can't find a cp in data this small 88 | 89 | s2 = mpf(data.var()) 90 | gpart = gamma( mpf(N)/2.0 - 1 ) 91 | denom = (pi**1.5) * mpf((N*s2))**( -N/2.0 + 0.5 ) * gpart 92 | 93 | # the numerator. A little trickier. 94 | # calc_twostate_weights() already deals with ts<3 and ts>N-2. 95 | weights=calc_twostate_weights( data ) 96 | if weights is None: return None 97 | 98 | num = 2.0**2.5 * abs(data.mean()) * weights.mean() 99 | 100 | lognum=log(num,10) 101 | logdenom=log(denom,10) 102 | logodds = lognum-logdenom 103 | 104 | print "num:", num, "log num:", lognum, "| denom:", denom, "log denom:", logdenom, "|| log odds:", logodds 105 | 106 | # If there is a change point, then logodds will be greater than 0 107 | if logodds < 0 : 108 | return None 109 | 110 | return ( weights.argmax(), logodds ) 111 | 112 | class ChangePointDetector: 113 | def __init__( self, data, function ): 114 | self.data = data 115 | self.datalen = len( self.data ) 116 | self.function = function 117 | self.changepoints = [] 118 | self.logodds = {} 119 | self.niter = 0 120 | self.maxiter = 1000000 # just in case 121 | 122 | def nchangepoints( self ): 123 | return len( self.changepoints ) 124 | 125 | def split_init( self, verbose=False ): 126 | self.split( 0, self.datalen, verbose ) 127 | 128 | def split( self, start, end, verbose=False ): 129 | if self.niter > self.maxiter : 130 | print "Change point detection error: number of iterations exceeded" 131 | print "If this is the right result, you may need to increase" 132 | print "ChangePointDetector.maxiter (currently %d)" % self.maxiter 133 | return 134 | self.niter += 1 135 | if verbose: 136 | print "\nIteration %d" % self.niter 137 | print "Trying to split the segment:", self.data[start:end], "(data from %d to %d)" % ( start, end) 138 | print self.data[start:end] 139 | 140 | # try to find a change point in the data segment 141 | try: 142 | result = self.function( self.data[ start: end ] ) 143 | except TypeError: 144 | print "trying to test data from %d to %d failed" % ( start,end ) 145 | #print self.data 146 | raise 147 | 148 | # otherwise, store the cp and call self.split on the two ends 149 | if result is not None : 150 | try: # fails if only one value is returned 151 | logodds = result[1] 152 | self.logodds[ start+result[0] ] = logodds 153 | result = start+result[0] 154 | except TypeError: # must mean it's one number? 155 | result += start 156 | 157 | if verbose: print "!! change point detected at %d !!" % result 158 | self.changepoints.append( result ) 159 | self.split( start, result, verbose ) 160 | self.split( result+1, end, verbose ) 161 | 162 | def sort( self ): self.changepoints.sort() 163 | 164 | # display the change points 165 | def show( self ): print self.changepoints 166 | 167 | # show the change points along with the log odds 168 | def showall( self ): 169 | for i in range( len( self.changepoints ) ) : 170 | changepoint = self.changepoints[i] 171 | try: 172 | logodds = self.logodds[ changepoint ] 173 | except KeyError: 174 | logodds = None 175 | print "%d (%f)" % ( changepoint, logodds ) 176 | 177 | def largest_logodds( self ): 178 | return array( self.logodds.values() ).max() 179 | -------------------------------------------------------------------------------- /attic/old2cpDetect.py: -------------------------------------------------------------------------------- 1 | 2 | # function to quickly calculate the means and means sums of squares of 3 | # all the partitions of a set of points 4 | 5 | import cPickle 6 | import numpy 7 | from math import pi 8 | from scipy import array 9 | from mpmath import log, gamma, mpf # arbitrary float precision! 10 | import sys 11 | 12 | def load_testdata( filename = "trajectory.dat" ): 13 | FILE = open( filename ) 14 | u = cPickle.Unpickler( FILE ) 15 | data = u.load() 16 | FILE.close() 17 | return data 18 | 19 | # for Gaussian noise only. For this reason, the first three points and the last two points 20 | # cannot correspond to a change point. Thus, we return an array of length (npts-5). 21 | def calc_mean_mss( data ): 22 | #data = numpy.array( data, "float64" ) 23 | npts = len( data ) 24 | 25 | #initialize 26 | data2=data**2 27 | dataA=data[0:3] 28 | dataA2=data2[0:3] 29 | NA = len(dataA) 30 | dataB=data[3:] 31 | dataB2=data2[3:] 32 | NB = len(dataB) 33 | 34 | sumA=dataA.sum() ; sumsqA=dataA2.sum() 35 | sumB=dataB.sum() ; sumsqB=dataB2.sum() 36 | 37 | mean_var_array=[] 38 | 39 | # first data point 40 | meanA=sumA/NA 41 | meanB=sumB/NB 42 | meansumsqA = sumsqA/NA 43 | meansumsqB = sumsqB/NB 44 | meanA2 = meanA**2 45 | meanB2 = meanB**2 46 | sA2=meansumsqA-meanA2 47 | sB2=meansumsqB-meanB2 48 | mean_var_array.append( (3, meanA2, sA2, npts-3, meanB2, sB2 ) ) 49 | 50 | for i in range( 3, npts-3 ): 51 | NA += 1 ; NB -= 1 52 | next = data[i] 53 | sumA += next ; sumB -= next 54 | nextsq = data2[i] 55 | sumsqA += nextsq; sumsqB -= nextsq 56 | 57 | meanA=sumA/NA 58 | meanB=sumB/NB 59 | meansumsqA=sumsqA/NA 60 | meansumsqB=sumsqB/NB 61 | meanA2=meanA**2 62 | meanB2=meanB**2 63 | sA2=meansumsqA-meanA2 64 | sB2=meansumsqB-meanB2 65 | mean_var_array.append( (NA, meanA2, sA2, NB, meanB2, sB2) ) 66 | 67 | return mean_var_array 68 | 69 | # uses calc_mean_mss() to compute the relative weights of the switch time 70 | def calc_twostate_weights( data ): 71 | weights=[0,0,0] # the change cannot have occurred in the last 3 points 72 | means_mss=calc_mean_mss( data ) 73 | 74 | i=0 75 | try: 76 | for nA, mean2A, varA, nB, mean2B, varB in means_mss : 77 | #print "computing for data", nA, mean2A, varA, nB, mean2B, varB 78 | numf1 = calc_alpha( nA, mean2A, varA ) 79 | numf2 = calc_alpha( nB, mean2B, varB ) 80 | denom = (varA + varB) * (mean2A*mean2B) 81 | weights.append( (numf1*numf2)/denom) 82 | i += 1 83 | except: 84 | print "failed at data", i # means_mss[i] 85 | print "---" 86 | #print means_mss 87 | print "---" 88 | raise 89 | 90 | weights.extend( [0,0] ) # the change cannot have occurred at the last 2 points 91 | return array( weights ) 92 | 93 | def calc_alpha( N, x2, s2 ): 94 | first = mpf(N)**(-N/2.0 + 1.0/2.0) 95 | second = mpf(s2)**(-N/2.0 + 1.0 ) 96 | third = gamma( mpf(N)/2.0 - 1.0 ) 97 | return first*second*third 98 | 99 | def findGaussianChangePoint( data ): 100 | 101 | # the denominator. This is the easy part. 102 | N = len( data ) 103 | 104 | if N<6 : return None # can't find a cp in data this small 105 | 106 | # set up gamma function table 107 | #for i in range(N): 108 | 109 | 110 | s2 = mpf(data.var()) 111 | gpart = gamma( mpf(N)/2.0 - 1 ) 112 | denom = (pi**1.5) * mpf((N*s2))**( -N/2.0 + 0.5 ) * gpart 113 | 114 | # the numerator. A little trickier. 115 | # calc_twostate_weights() already deals with ts<3 and ts>N-2. 116 | weights=calc_twostate_weights( data ) 117 | if weights is None: return None 118 | 119 | num = 2.0**2.5 * abs(data.mean()) * weights.mean() 120 | 121 | logodds = log( num ) - log( denom ) 122 | 123 | print "num:", num, "log num:", log(num), "| denom:", denom, "log denom:", log(denom), "|| log odds:", logodds 124 | 125 | # If there is a change point, then logodds will be greater than 0 126 | if logodds < 0 : 127 | return None 128 | 129 | return ( weights.argmax(), logodds ) 130 | 131 | class ChangePointDetector: 132 | def __init__( self, data, function ): 133 | self.data = data 134 | self.datalen = len( self.data ) 135 | self.function = function 136 | self.changepoints = [] 137 | self.logodds = {} 138 | self.niter = 0 139 | self.maxiter = 1000000 # just in case 140 | 141 | def nchangepoints( self ): 142 | return len( self.changepoints ) 143 | 144 | def split_init( self, verbose=False ): 145 | self.split( 0, self.datalen, verbose ) 146 | 147 | def split( self, start, end, verbose=False ): 148 | if self.niter > self.maxiter : 149 | print "Change point detection error: number of iterations exceeded" 150 | print "If this is the right result, you may need to increase" 151 | print "ChangePointDetector.maxiter (currently %d)" % self.maxiter 152 | return 153 | self.niter += 1 154 | if verbose: 155 | print "\nIteration %d" % self.niter 156 | print "Trying to split the segment:", self.data[start:end], "(data from %d to %d)" % ( start, end) 157 | print self.data[start:end] 158 | 159 | # try to find a change point in the data segment 160 | try: 161 | result = self.function( self.data[ start: end ] ) 162 | except TypeError: 163 | print "trying to test data from %d to %d failed" % ( start,end ) 164 | #print self.data 165 | raise 166 | 167 | # otherwise, store the cp and call self.split on the two ends 168 | if result is not None : 169 | try: # fails if only one value is returned 170 | logodds = result[1] 171 | self.logodds[ start+result[0] ] = logodds 172 | result = start+result[0] 173 | except TypeError: # must mean it's one number? 174 | result += start 175 | 176 | if verbose: print "!! change point detected at %d !!" % result 177 | self.changepoints.append( result ) 178 | self.split( start, result, verbose ) 179 | self.split( result+1, end, verbose ) 180 | 181 | def sort( self ): self.changepoints.sort() 182 | 183 | # display the change points 184 | def show( self ): print self.changepoints 185 | 186 | # show the change points along with the log odds 187 | def showall( self ): 188 | for i in range( len( self.changepoints ) ) : 189 | changepoint = self.changepoints[i] 190 | try: 191 | logodds = self.logodds[ changepoint ] 192 | except KeyError: 193 | logodds = None 194 | print "%d (%f)" % ( changepoint, logodds ) 195 | 196 | def largest_logodds( self ): 197 | return array( self.logodds.values() ).max() 198 | -------------------------------------------------------------------------------- /attic/cpDetect.py: -------------------------------------------------------------------------------- 1 | 2 | # function to quickly calculate the means and means sums of squares of 3 | # all the partitions of a set of points 4 | 5 | import cPickle 6 | import numpy 7 | from math import pi 8 | from scipy import array, zeros 9 | from mpmath import log, gamma, mpf # arbitrary float precision! 10 | import sys 11 | 12 | inv_log10=1.0/log(10) 13 | 14 | def load_testdata( filename = "trajectory.dat" ): 15 | FILE = open( filename ) 16 | u = cPickle.Unpickler( FILE ) 17 | data = u.load() 18 | FILE.close() 19 | return data 20 | 21 | def findPoissonChangePoint( data, factorial ): 22 | # data is a list of counts in each time period, uniformly spaced 23 | 24 | # the denominator (including both P(D|H1) and constant parts of P(D|H2) ) 25 | C = data.sum() 26 | N = mpf(len(data)) 27 | denominator = factorial[C-1] * pi / ( 2 * N**C ) 28 | 29 | # the numerator (trickier) 30 | # this needs to be averaged over the possible change points 31 | weights = zeros(N,dtype=object) 32 | CA = 0 33 | CB = C 34 | for i in range(1,N) : 35 | # points up through i are in data set A; the rest are in B 36 | datapoint = data[i-1] 37 | NA = mpf(i) ; CA += datapoint 38 | NB = mpf(N-i) ; CB -= datapoint 39 | 40 | fraction_num = factorial[CA] * factorial[CB] 41 | fraction_den = NA**(CA+1) * NB**(CB+1) * ( (CA/NA)**2 + (CB/NB)**2 ) 42 | #weights.append( fraction_num/fraction_den ) 43 | weights[i-1] = mpf(fraction_num)/fraction_den 44 | 45 | numerator = weights.mean() 46 | lognum= inv_log10 * log( numerator ) 47 | logden= inv_log10 * log( denominator ) 48 | logodds = lognum - logden 49 | print "num:",numerator, "log num:", lognum, "| denom:", denominator, "log denom:", logden, "|| log odds:", logodds 50 | 51 | # If there is a change point, then logodds will be greater than 0 52 | if logodds < 0 : return None 53 | return ( weights.argmax(), logodds ) 54 | 55 | def findGaussianChangePoint( data, gammatable ): 56 | N = len( data ) 57 | if N<6 : return None # can't find a cp in data this small 58 | 59 | # the denominator. This is the easy part. 60 | denom = (pi**1.5) * mpf(( N*data.var() ))**( -N/2.0 + 0.5 ) * gammatable[N] 61 | 62 | # BEGIN weight calculation 63 | # the numerator. A little trickier. 64 | weights=[0,0,0] # the change cannot have occurred in the last 3 points 65 | data2=data**2 66 | 67 | #initialize 68 | dataA=data[0:3] ; dataA2=data2[0:3] ; NA = len(dataA) 69 | dataB=data[3:] ; dataB2=data2[3:] ; NB = len(dataB) 70 | sumA=dataA.sum() ; sumsqA=dataA2.sum() 71 | sumB=dataB.sum() ; sumsqB=dataB2.sum() 72 | 73 | # first data point--this could be done in the loop but it's okay here 74 | meanA=sumA/NA ; meansumsqA = sumsqA/NA ; meanA2 = meanA**2 ; sA2=meansumsqA-meanA2 75 | meanB=sumB/NB ; meansumsqB = sumsqB/NB ; meanB2 = meanB**2 ; sB2=meansumsqB-meanB2 76 | 77 | wnumf1 = mpf(NA)**(-0.5*NA + 0.5 ) * mpf(sA2)**(-0.5*NA + 1) * gammatable[NA] 78 | wnumf2 = mpf(NB)**(-0.5*NB + 0.5 ) * mpf(sB2)**(-0.5*NB + 1) * gammatable[NB] 79 | wdenom = (sA2 + sB2) * (meanA2*meanB2) 80 | weights.append( (wnumf1*wnumf2)/wdenom ) 81 | 82 | for i in range( 3, N-3 ): 83 | NA += 1 ; NB -= 1 84 | next = data[i] 85 | sumA += next ; sumB -= next 86 | nextsq = data2[i] 87 | sumsqA += nextsq; sumsqB -= nextsq 88 | meanA=sumA/NA ; meansumsqA = sumsqA/NA ; meanA2 = meanA**2 ; sA2=meansumsqA-meanA2 89 | meanB=sumB/NB ; meansumsqB = sumsqB/NB ; meanB2 = meanB**2 ; sB2=meansumsqB-meanB2 90 | wnumf1 = mpf(NA)**(-0.5*NA + 0.5 ) * mpf(sA2)**(-0.5*NA + 1) * gammatable[NA] 91 | wnumf2 = mpf(NB)**(-0.5*NB + 0.5 ) * mpf(sB2)**(-0.5*NB + 1) * gammatable[NB] 92 | wdenom = (sA2 + sB2) * (meanA2*meanB2) 93 | weights.append( (wnumf1*wnumf2)/wdenom) 94 | weights.extend( [0,0] ) # the change cannot have occurred at the last 2 points 95 | weights=array(weights) 96 | # END weight calculation 97 | 98 | num = 2.0**2.5 * abs(data.mean()) * weights.mean() 99 | logodds = log( num ) - log( denom ) 100 | print "num:", num, "log num:", log(num), "| denom:", denom, "log denom:", log(denom), "|| log odds:", logodds 101 | 102 | # If there is a change point, then logodds will be greater than 0 103 | if logodds < 0 : return None 104 | return ( weights.argmax(), logodds ) 105 | 106 | class ChangePointDetector: 107 | def __init__( self, data, function, table=None ): 108 | self.data = data 109 | self.datalen = len( self.data ) 110 | self.function = function 111 | self.table=table 112 | self.changepoints = [] 113 | self.logodds = {} 114 | self.niter = 0 115 | self.maxiter = 1000000 # just in case 116 | 117 | def nchangepoints( self ): 118 | return len( self.changepoints ) 119 | 120 | def split_init( self, verbose=False ): 121 | self.split( 0, self.datalen, verbose ) 122 | 123 | def split( self, start, end, verbose=False ): 124 | if self.niter > self.maxiter : 125 | print "Change point detection error: number of iterations exceeded" 126 | print "If this is the right result, you may need to increase" 127 | print "ChangePointDetector.maxiter (currently %d)" % self.maxiter 128 | return 129 | self.niter += 1 130 | if verbose: 131 | print "\nIteration %d" % self.niter 132 | print "Trying to split the segment:", self.data[start:end], "(data from %d to %d)" % ( start, end) 133 | print self.data[start:end] 134 | 135 | # try to find a change point in the data segment 136 | try: 137 | result = self.function( self.data[ start: end ], self.table ) 138 | except TypeError: 139 | print "trying to test data from %d to %d failed" % ( start,end ) 140 | #print self.data 141 | raise 142 | 143 | # otherwise, store the cp and call self.split on the two ends 144 | if result is not None : 145 | try: # fails if only one value is returned 146 | logodds = result[1] 147 | self.logodds[ start+result[0] ] = logodds 148 | result = start+result[0] 149 | except TypeError: # must mean it's one number? 150 | result += start 151 | 152 | if verbose: print "!! change point detected at %d !!" % result 153 | self.changepoints.append( result ) 154 | self.split( start, result, verbose ) 155 | self.split( result+1, end, verbose ) 156 | 157 | def sort( self ): self.changepoints.sort() 158 | 159 | # display the change points 160 | def show( self ): print self.changepoints 161 | 162 | # show the change points along with the log odds 163 | def showall( self ): 164 | for i in range( len( self.changepoints ) ) : 165 | changepoint = self.changepoints[i] 166 | try: 167 | logodds = self.logodds[ changepoint ] 168 | except KeyError: 169 | logodds = None 170 | print "%d (%f)" % ( changepoint, logodds ) 171 | 172 | def largest_logodds( self ): 173 | return array( self.logodds.values() ).max() 174 | -------------------------------------------------------------------------------- /cpdetect/cp_detector.py: -------------------------------------------------------------------------------- 1 | """ 2 | Bayesian change point detection. Implementation of Ensign And Pande, J. Phys. Chem. B 2010, 114, 280-292 for 3 | a normal and log-normal distribution 4 | 5 | Author: Chaya D. Stern 6 | """ 7 | 8 | import numpy as np 9 | import copy 10 | from cpdetect.utils import logger 11 | import time 12 | import pandas as pd 13 | import math 14 | from scipy.special import gammaln 15 | from collections import OrderedDict 16 | from scipy.misc import logsumexp 17 | 18 | 19 | class Detector(object): 20 | """ 21 | Bayesian change point detection. 22 | 23 | Attributes 24 | ---------- 25 | change_points: dict of pandas dataframes 26 | This dictionary maps the trajectory to time point split, the log_odds, start, end and probability of the time points 27 | no_split: dict of pandas dataframes 28 | This dictionary maps trajectory to time points that have a peak in probability of splitting but is below the threshold. 29 | This is used for the refinement step 30 | state_emission: dict of pandas dataframes 31 | This dict maps trajectories to the sampel mu and sigma of the split segment. It's used to generate the step function 32 | log_gamme: log gamma for all Ns 33 | threshold: int 34 | log odds threshold to split. Default is 0. The lower the threshold, the more sensitive the splitting 35 | step_function: dict of arrays 36 | maps trajectory to numpy array of step function 37 | refined_change_point: dict of pandas dataframes 38 | If the refinment function is used, this dictionary will be populated with the new splits found 39 | window_size: int 40 | How many datapoints to include in the moving window. Defualt is None. When the default is none, no moving window 41 | is used 42 | stride: int 43 | The stride of the moving window. If None, no moving window is used. Default is None 44 | 45 | """ 46 | 47 | def __init__(self, observations, distribution, log_odds_threshold=0, window_size=None, stride=None): 48 | """ 49 | 50 | :param observations: list of numpy arrays 51 | list of observation trajectories 52 | :param distribution: str 53 | distribution of process (log_normal or normal) 54 | """ 55 | self._observations = copy.deepcopy(observations) 56 | self._nobs = len(observations) 57 | self._Ts = [len(o) for o in observations] 58 | self.change_points = {} # Dictionary containing change point time and its likelihood 59 | self.no_split = {} 60 | self.state_emission = {} # Dictionary containing state's mean and sigma for segment 61 | self.loggamma = [-99, -99, -99] 62 | self.threshold = log_odds_threshold 63 | self.step_function = {} 64 | self.refined_change_points = {} # Dictionary containing new change points found during refinement. 65 | 66 | self.window_size = window_size 67 | self.stride = stride 68 | self.moving_window = False 69 | if window_size is not None: 70 | self.moving_window = True 71 | 72 | if distribution == 'log_normal': 73 | self._distribution = LogNormal() 74 | self.distribution = 'log_normal' 75 | elif distribution == 'normal' or distribution == 'gaussian': 76 | self._distribution = Normal() 77 | self.distribution = 'normal' 78 | else: 79 | raise ValueError('Use log_normal or normal distribution. I got something else') 80 | 81 | # Generate gamma table 82 | self._generate_loggamma_table() 83 | 84 | @property 85 | def nobservations(self): 86 | """ Number of observation trajectories """ 87 | return self._nobs 88 | 89 | @property 90 | def observation_lengths(self): 91 | """ Return lengths of trajectories""" 92 | return self._Ts 93 | 94 | def _normal_lognormal_bf(self, obs): 95 | """ 96 | Calculate Bayes factor P(D|H_2) / P(D|H_1) for normal or log-normal data 97 | 98 | :parameter: 99 | obs: np.array 100 | segment of trajectory to calculate Bayes factor 101 | :return: 102 | ts: int 103 | time point for split (argmax) 104 | log_odds: float 105 | 106 | """ 107 | n = len(obs) 108 | if n < 6: 109 | logger().debug('Segment is less than 6 points') 110 | return None # can't find a cp in data this small 111 | 112 | # Calculate mean and var 113 | mean, var = self._distribution.mean_var(obs) 114 | 115 | # the denominator. This is the easy part. 116 | denom = 1.5*np.log(np.pi) + (-n/2.0 + 0.5)*(np.log(n*var)) + self.loggamma[n] 117 | 118 | # BEGIN weight calculation 119 | # the numerator. A little trickier. 120 | weights = [0, 0, 0] # the change cannot have occurred in the last 3 points 121 | 122 | for i in range(3, n-2): 123 | data_a = obs[0:i] 124 | n_a = len(data_a) 125 | data_b = obs[i:] 126 | n_b = len(data_b) 127 | 128 | mean_a, var_a = self._distribution.mean_var(data_a) 129 | mean_b, var_b = self._distribution.mean_var(data_b) 130 | 131 | mean_a2 = mean_a**2 132 | mean_b2 = mean_b**2 133 | 134 | wnumf1 = (-0.5*n_a + 0.5)*np.log(n_a) + (-0.5*n_a + 1)*np.log(var_a) + self.loggamma[n_a] 135 | wnumf2 = (-0.5*n_b + 0.5)*np.log(n_b) + (-0.5*n_b + 1)*np.log(var_b) + self.loggamma[n_b] 136 | 137 | wdenom = np.log(var_a + var_b) + np.log(mean_a2*mean_b2) 138 | 139 | weights.append((wnumf1 + wnumf2) - wdenom) 140 | 141 | weights.extend([0, 0]) # the change cannot have occurred at the last 2 points 142 | weights = np.array(weights) 143 | # END weight calculation 144 | num = 2.5*np.log(2.0) + np.log(abs(mean)) + weights.mean() 145 | log_odds = num - denom 146 | # Replace points where change cannot occur with negative infinity so that they cannot be argmax 147 | weights[0] = weights[1] = weights[2] = weights[-1] = weights[-2] = -np.inf 148 | logger().debug(' log num: ' + str(num)) 149 | logger().debug(' denom: ' + str(denom)) 150 | logger().debug(' log odds: ' + str(log_odds)) 151 | 152 | norm = logsumexp(weights[3:-2]) 153 | normalized_prob = np.exp(weights[3:-3] - norm) 154 | 155 | # If there is a change point, then logodds will be greater than 0 156 | # Check for nan. This comes up if using log normal for a normal distribution. 157 | if math.isnan(log_odds): 158 | raise ValueError('Are you using the correct distribution?') 159 | if log_odds < self.threshold: 160 | 161 | logger().debug(' Log Odds: ' + str(log_odds) + ' is less than threshold ' + str(self.threshold) + 162 | '. No change point found') 163 | return normalized_prob, weights.argmax(), log_odds, None 164 | 165 | return normalized_prob, weights.argmax(), log_odds 166 | 167 | def _generate_loggamma_table(self): 168 | """ 169 | calculate log gamma for all N 170 | """ 171 | for i in range(3, max(self._Ts) + 1): 172 | self.loggamma.append(gammaln(0.5*i - 1)) 173 | 174 | def detect_cp(self): 175 | """ 176 | Bayesian detection of Intensity changes. This function detects the changes, their timepoints and then 177 | finds the state emission for each segment to draw the step function 178 | """ 179 | 180 | logger().info('=======================================') 181 | logger().info('Running change point detector') 182 | logger().info('=======================================') 183 | logger().info(' input observations: '+str(self.nobservations)+ ' of length ' + str(self.observation_lengths)) 184 | 185 | initial_time = time.time() 186 | 187 | for k in range(self._nobs): 188 | logger().info('Running cp detector on traj ' + str(k)) 189 | logger().info('---------------------------------') 190 | self.change_points['traj_%s' %str(k)] = pd.DataFrame(columns=['ts', 'log_odds', 'start_end']) 191 | self.change_points['traj_%s' % str(k)]['ts'] = self.change_points['traj_%s' %str(k)]['ts'].astype(int) 192 | self.no_split['traj_%s' %str(k)] = pd.DataFrame(columns=['ts', 'log_odds', 'start_end']) 193 | self.no_split['traj_%s' % str(k)]['ts'] = self.no_split['traj_%s' %str(k)]['ts'].astype(int) 194 | obs_full = self._observations[k] 195 | if self.window_size: 196 | # Iterate splitting algorithm over window 197 | chunks = (obs_full.shape[0]-self.window_size)/self.stride + 1 198 | indexer = np.arange(self.window_size)[None, :] + self.stride*np.arange(int(chunks))[:, None] 199 | observations = obs_full[indexer] 200 | for obs, index in zip(observations, indexer): 201 | self._split(obs, 0, self.window_size-1, k, indexer=index) 202 | else: 203 | self._split(obs_full, 0, self.observation_lengths[k], k) 204 | logger().info('Generating step fucntion') 205 | logger().info('---------------------------------') 206 | self._generate_step_function(obs_full, k) 207 | 208 | final_time = time.time() 209 | 210 | logger().info('Elapsed time: ' + str(final_time-initial_time)) 211 | 212 | def _split(self, obs, start, end, itraj, indexer=None): 213 | """ 214 | This function takes an array of observations and checks if it should be split 215 | 216 | :param obs: np.array 217 | trajectory to check for change point 218 | :param start: int 219 | start of segment to check for change point 220 | :param end: int 221 | end of segment 222 | :param itraj: int 223 | index of trajectory 224 | """ 225 | # recursive function to find all ts and logg odds 226 | logger().debug(' Trying to split segment start at ' + str(start) + ' end ' + str(end)) 227 | result = self._normal_lognormal_bf(obs[start:end]) 228 | if result is None: 229 | logger().debug(" Can't split segment with less than 6 points.") 230 | return 231 | elif result[-1] is None: 232 | ts = start + result[1] 233 | if indexer is not None: 234 | ts = indexer[ts] 235 | start = indexer[start] 236 | end = indexer[end] 237 | logger().debug(" Can't split segment start at " + str(start) + " end at " + str(end)) 238 | self.no_split['traj_%s' % str(itraj)] = self.no_split['traj_%s' % str(itraj)].append({'ts': ts, 239 | 'log_odds': result[2], 'start_end': (start, end), 'prob_ts': result[0]}, ignore_index=True) 240 | return 241 | else: 242 | log_odds = result[-1] 243 | ts = start + result[1] 244 | prob_ts = result[0] 245 | if indexer is None: 246 | self.change_points['traj_%s' % str(itraj)] = self.change_points['traj_%s' % str(itraj)].append( 247 | {'ts': ts, 'log_odds': log_odds, 'start_end': (start, end), 'prob_ts': prob_ts}, ignore_index=True) 248 | else: 249 | self.change_points['traj_%s' % str(itraj)] = self.change_points['traj_%s' % str(itraj)].append( 250 | {'ts': indexer[ts], 'log_odds': log_odds, 'start_end': (indexer[start], indexer[end]), 'prob_ts': prob_ts}, ignore_index=True) 251 | 252 | logger().info(' Found a new change point at: ' + str(ts) + '!!') 253 | self._split(obs, start, ts, itraj, indexer) 254 | self._split(obs, ts, end, itraj, indexer) 255 | 256 | def _generate_step_function(self, obs, itraj, refined=False): 257 | """Draw step function based on sample mean 258 | 259 | :parameter obs 260 | trajectory 261 | :parameter itraj: int 262 | index of trajectory 263 | """ 264 | 265 | self.state_emission['traj_%s' % str(itraj)] = pd.DataFrame(columns=['partition', 'sample_mu', 'sample_sigma']) 266 | 267 | # First sort ts of traj 268 | ts = self.change_points['traj_%s' % str(itraj)]['ts'] 269 | if refined: 270 | ts = ts.append(self.refined_change_points['traj_{}'.format(itraj)]['ts']) 271 | if len(ts) == 0: 272 | logger().info('No change point was found') 273 | self.step_function['traj_%s' % str(itraj)] = np.ones(self.observation_lengths[itraj]-1) 274 | mean, var = self._distribution.mean_var(obs) 275 | self.step_function['traj_%s' % str(itraj)] = self.step_function['traj_%s' % str(itraj)]*np.exp(mean) 276 | return 277 | ts = ts.drop_duplicates().sort_values().values 278 | # populate data frame with partitions, sample mean and sigma 279 | partitions = [(0, int(ts[0]))] 280 | mean, var = self._distribution.mean_var(obs[0:ts[0]]) 281 | means = [mean] 282 | sigmas = [var] 283 | for i, j in enumerate(ts): 284 | try: 285 | partitions.append((int(j+1), int(ts[i+1]))) 286 | mean, var = self._distribution.mean_var(obs[j+1:ts[i+1]]) 287 | means.append(mean) 288 | sigmas.append(var) 289 | 290 | except IndexError: 291 | partitions.append((int(ts[-1]+1), int(self.observation_lengths[itraj]-1))) 292 | mean, var = self._distribution.mean_var(obs[ts[-1]+1:len(obs)-1]) 293 | means.append(mean) 294 | sigmas.append(var) 295 | 296 | except ValueError: 297 | pass 298 | self.state_emission['traj_%s' % str(itraj)]['partition'] = partitions 299 | self.state_emission['traj_%s' % str(itraj)]['sample_mu'] = means 300 | self.state_emission['traj_%s' % str(itraj)]['sample_sigma'] = sigmas 301 | 302 | # generate step function 303 | self.step_function['traj_%s' % str(itraj)] = np.ones(self.observation_lengths[itraj]) 304 | for index, row in self.state_emission['traj_%s' % str(itraj)].iterrows(): 305 | self.step_function['traj_%s' % str(itraj)][row['partition'][0]:row['partition'][1]+1] = \ 306 | np.exp(row['sample_mu']) 307 | 308 | def refinement(self, threshold=0, split_window=50, reject_window=10): 309 | """ 310 | This function goes through all rejected splits and recalculates the Bayes factor on splits of the segments. The 311 | splits are given by the ts + and - the split window. If a new change point is found, it will be accepted given 312 | that the log odds are above the threshold and there is no other predicted change point within the reject window. 313 | 314 | Parameters 315 | ---------- 316 | threshold : float or int 317 | log odds threshold to accept a split 318 | split_window : int 319 | how many points out of rejected split to calculate Bayes Factor 320 | reject_window : int 321 | The window for which another predicted change point will be considered equal to a new change point 322 | 323 | """ 324 | 325 | for t in range(self.nobservations): 326 | self.refined_change_points['traj_{}'.format(str(t))] = pd.DataFrame(columns=['ts', 'log_odds', 'start_end']) 327 | self.refined_change_points['traj_%s' % str(t)]['ts'] = self.refined_change_points['traj_%s' 328 | % str(t)]['ts'].astype(int) 329 | predicted_ts = np.array(self.change_points['traj_{}'.format(t)]['ts']) 330 | for index, row in self.no_split['traj_{}'.format(t)].iterrows(): 331 | start, end = row['start_end'] 332 | ts = row['ts'] 333 | new_splits = [(start, ts + split_window), (ts - split_window, end)] 334 | obs1 = self._observations[t][new_splits[0][0]:new_splits[0][1]] 335 | obs2 = self._observations[t][new_splits[1][0]:new_splits[1][1]] 336 | bf = self._normal_lognormal_bf(obs1) 337 | 338 | if bf is not None and bf[2] > threshold: 339 | new_ts = bf[1] + new_splits[0][0] 340 | if not np.any((predicted_ts < new_ts + reject_window) & (predicted_ts > new_ts - reject_window)): 341 | logger().info('Found a new change point in traj {} at {}'.format(t, new_ts)) 342 | self.refined_change_points['traj_{}'.format(str(t))] = self.refined_change_points[ 343 | 'traj_{}'.format(t)].append({'ts': new_ts, 'log_odds': bf[2], 'start_end': new_splits[0]}, 344 | ignore_index=True) 345 | 346 | bf = self._normal_lognormal_bf(obs2) 347 | if bf is not None and bf[2] > threshold: 348 | new_ts = bf[1] + new_splits[1][0] 349 | if not np.any((predicted_ts < new_ts + reject_window) & (predicted_ts > new_ts - reject_window)): 350 | logger().info('Found a new change point in traj {} at {}'.format(t, new_ts)) 351 | self.refined_change_points['traj_{}'.format(str(t))] = self.refined_change_points[ 352 | 'traj_{}'.format(t)].append({'ts': new_ts, 'log_odds': bf[2], 'start_end': new_splits[1]}, 353 | ignore_index=True) 354 | 355 | self.refined_change_points['traj_{}'.format(str(t))]['ts'].drop_duplicates(inplace=True) 356 | 357 | def regenerate_step_function(self): 358 | for t in range(self.nobservations): 359 | obs = self._observations[t] 360 | self._generate_step_function(obs, t, refined=True) 361 | 362 | def to_csv(self, filename=None): 363 | """ 364 | export change_points data frame to csv file 365 | :parameter: 366 | filename: str 367 | 368 | :return: 369 | csv if no filename given. Otherwise, saves csv file 370 | """ 371 | frames = [] 372 | keys = [] 373 | for i in self.change_points: 374 | keys.append(i) 375 | frames.append(self.change_points[i]) 376 | all_f = pd.concat(frames, keys=keys) 377 | 378 | if filename: 379 | all_f.to_csv(filename) 380 | else: 381 | return all.to_csv() 382 | 383 | 384 | class LogNormal(object): 385 | 386 | @classmethod 387 | def mean_var(cls, data): 388 | """ 389 | calculate log normal mean and variance (loc and scale) 390 | :parameter: 391 | data: np.array 392 | data points to calculate mean and var 393 | 394 | :return: (float, float) 395 | loc, scale of data 396 | """ 397 | n = len(data) 398 | logx = np.log(data) 399 | loc = logx.sum()/n 400 | scale = ((logx - loc)**2).sum()/n 401 | return loc, scale 402 | 403 | 404 | class Normal(object): 405 | 406 | @classmethod 407 | def mean_var(cls, data): 408 | return data.mean(), data.var() 409 | -------------------------------------------------------------------------------- /attic/trajectory.dat: -------------------------------------------------------------------------------- 1 | 2 | (lp1 3 | F50.275547440231023 4 | aF51.791625880721611 5 | aF49.684985565970329 6 | aF49.34984584006699 7 | aF49.98997797686696 8 | aF49.910605202345167 9 | aF49.424888610493937 10 | aF50.756859876700645 11 | aF51.434684516073261 12 | aF50.335890278414119 13 | aF50.112353522081207 14 | aF49.07397590749779 15 | aF52.977858133439327 16 | aF48.131329833779795 17 | aF50.01719929909904 18 | aF49.294792261668213 19 | aF49.927953396299571 20 | aF49.77909330257993 21 | aF48.687443500916302 22 | aF50.413377091913922 23 | aF50.408202102849842 24 | aF49.587981442294733 25 | aF51.760343541992441 26 | aF48.97774976067813 27 | aF50.03565460113002 28 | aF51.384082986960934 29 | aF50.487410581613794 30 | aF53.797596218048014 31 | aF51.273423517441444 32 | aF49.713542574044467 33 | aF51.024844612103763 34 | aF49.862855611535878 35 | aF51.497052375017347 36 | aF51.504675607088977 37 | aF52.285486785054623 38 | aF51.270876547734467 39 | aF51.119322487040968 40 | aF49.076429194165797 41 | aF50.923136918523603 42 | aF50.088701991472618 43 | aF50.96626998956291 44 | aF51.159564401584269 45 | aF49.081831876100438 46 | aF51.992765646470708 47 | aF50.807212240900796 48 | aF49.073334927494336 49 | aF50.155274098461973 50 | aF50.516952043294914 51 | aF51.988869889685468 52 | aF48.362197057558731 53 | aF52.209408077908776 54 | aF49.547030571852559 55 | aF52.652555954924601 56 | aF51.535502602697981 57 | aF48.788054454419559 58 | aF51.99556290033685 59 | aF52.476753906877072 60 | aF50.385929915634911 61 | aF49.132989179901564 62 | aF49.844442753656963 63 | aF50.176363436294061 64 | aF49.735811707754664 65 | aF52.081509293525961 66 | aF50.162430834554797 67 | aF49.103887525704593 68 | aF49.687860832844279 69 | aF50.879559114084906 70 | aF49.2296464422556 71 | aF52.154099831027324 72 | aF51.87678175945608 73 | aF41.551577051489268 74 | aF41.906293807405682 75 | aF42.290129644194607 76 | aF42.270266298581639 77 | aF41.969858045002852 78 | aF41.763508499310454 79 | aF43.2424518726245 80 | aF42.209490489110422 81 | aF40.930190373551966 82 | aF42.603447065931945 83 | aF42.499957484502566 84 | aF42.924243503938094 85 | aF43.267414572936964 86 | aF43.603526396346226 87 | aF42.308979417071257 88 | aF41.860177674481456 89 | aF43.300368781447702 90 | aF42.015025004961352 91 | aF43.322751068355416 92 | aF43.110788448704767 93 | aF43.296587081841643 94 | aF41.277445900769585 95 | aF42.008540368506715 96 | aF42.616072250154545 97 | aF42.994395355450564 98 | aF35.985407968035112 99 | aF39.040051961044838 100 | aF39.472907236087352 101 | aF37.067217280984678 102 | aF37.737882096051841 103 | aF37.289538753841306 104 | aF37.375182752998789 105 | aF38.202387055291339 106 | aF38.420615626723198 107 | aF38.742855666959798 108 | aF37.903433588364521 109 | aF37.171711338048453 110 | aF36.536314600090662 111 | aF38.515521693474277 112 | aF36.79792623040597 113 | aF36.980741632652446 114 | aF37.208590759545814 115 | aF37.727559064579978 116 | aF37.204060900189809 117 | aF36.007831995727251 118 | aF37.488974071786537 119 | aF37.563812838978173 120 | aF37.632370971729415 121 | aF38.263420418948044 122 | aF36.380794151432383 123 | aF38.583654278910458 124 | aF38.48135286680612 125 | aF36.134033105060283 126 | aF38.270791828660521 127 | aF37.993546185413543 128 | aF38.859066656751125 129 | aF38.128547358591675 130 | aF36.175614301283638 131 | aF40.123345427416574 132 | aF36.211935444320915 133 | aF38.531909423597902 134 | aF38.382873091313087 135 | aF37.207267242245337 136 | aF38.512877921713581 137 | aF38.753347236949082 138 | aF36.635808051350743 139 | aF37.445421281879668 140 | aF36.852113343637591 141 | aF38.524816726295398 142 | aF39.253073810872955 143 | aF38.862504486261301 144 | aF37.754343074776834 145 | aF36.481745059537211 146 | aF36.912168570986388 147 | aF28.171895300846693 148 | aF32.808391998170599 149 | aF28.623126263223519 150 | aF32.038652515152563 151 | aF34.060517509182581 152 | aF32.566085509360242 153 | aF34.355177762300634 154 | aF34.188905817435504 155 | aF33.101329112071625 156 | aF35.84608667097659 157 | aF32.096127896366127 158 | aF31.793424632456983 159 | aF31.111993820671007 160 | aF35.545146673462831 161 | aF29.890342413695798 162 | aF31.571600297155296 163 | aF34.346921071066184 164 | aF31.784367089630823 165 | aF29.036211829009055 166 | aF32.631933261005777 167 | aF29.465090453521782 168 | aF30.718691670264388 169 | aF33.863517211722147 170 | aF32.474088794592667 171 | aF33.137513297479025 172 | aF31.269995636212535 173 | aF33.153956574137851 174 | aF33.052047475498647 175 | aF33.43155834353874 176 | aF30.084429259578439 177 | aF31.930457045138247 178 | aF32.835609106644178 179 | aF28.921836588151244 180 | aF31.961267966524296 181 | aF30.624090324313581 182 | aF32.373055715322309 183 | aF30.252360288684276 184 | aF29.857617527785777 185 | aF33.056214228522407 186 | aF33.589789539485018 187 | aF30.870865697841396 188 | aF30.090379278937728 189 | aF34.998072570027453 190 | aF33.242880772547849 191 | aF32.710080067542627 192 | aF31.865897190004343 193 | aF33.520367804793246 194 | aF33.673934522399428 195 | aF34.683235382453738 196 | aF33.202561513106794 197 | aF30.792932052618553 198 | aF34.367426496358171 199 | aF35.73683278714109 200 | aF30.897156533998704 201 | aF31.736591206237939 202 | aF33.059106854951203 203 | aF32.780607764334903 204 | aF36.22484467791336 205 | aF30.875626523257175 206 | aF29.788664120753928 207 | aF35.226370097252428 208 | aF32.495123361535732 209 | aF30.279450650883579 210 | aF33.539927908009844 211 | aF31.805856870129453 212 | aF32.657247333454386 213 | aF34.168472579455589 214 | aF31.045704625327133 215 | aF33.655983108392732 216 | aF30.461443010295259 217 | aF34.586718773261602 218 | aF31.26066315010365 219 | aF32.505319249266925 220 | aF31.403073900677867 221 | aF33.623482291446848 222 | aF32.567793088342356 223 | aF32.466725300279371 224 | aF30.812453426490368 225 | aF34.673059874428574 226 | aF33.566193146752191 227 | aF33.369242964694102 228 | aF32.507718074488828 229 | aF33.308935811763838 230 | aF30.603800041682454 231 | aF33.898245658167482 232 | aF32.976790146911434 233 | aF32.807256051983593 234 | aF33.425996405695422 235 | aF32.251349417424819 236 | aF31.258440222397862 237 | aF30.807300842007493 238 | aF31.762565223934391 239 | aF32.672236370583725 240 | aF31.569850642624044 241 | aF31.817077108972736 242 | aF30.839644941068904 243 | aF31.692472750258034 244 | aF29.131848489151398 245 | aF29.709112287610154 246 | aF30.602010136483095 247 | aF33.801398077126585 248 | aF32.51561246087801 249 | aF33.624590786535727 250 | aF33.188448905913866 251 | aF32.013987797176448 252 | aF32.521937657711959 253 | aF34.162448384074665 254 | aF32.236086192184189 255 | aF32.982600581811376 256 | aF32.223388466183046 257 | aF33.909777034278846 258 | aF30.932317175503464 259 | aF35.42460902139247 260 | aF32.882587077584844 261 | aF36.424614037330542 262 | aF28.06356006918109 263 | aF31.525851609703778 264 | aF31.766983422122983 265 | aF32.761476718208073 266 | aF28.294515311005494 267 | aF31.567463795909045 268 | aF34.040650689486149 269 | aF33.182583364394873 270 | aF32.492762547596826 271 | aF30.427663511894664 272 | aF31.132882594746103 273 | aF34.705112370686415 274 | aF32.590085239776663 275 | aF30.001250692672549 276 | aF32.358081296528205 277 | aF31.791903595580646 278 | aF32.969805859772812 279 | aF31.792279199628446 280 | aF31.179819756612211 281 | aF31.559360918015873 282 | aF32.921798661417085 283 | aF31.191324996378722 284 | aF31.872213185654282 285 | aF32.921789822359962 286 | aF32.082359655644176 287 | aF32.006921719201415 288 | aF30.795524065860238 289 | aF33.950482593307882 290 | aF36.614809401206287 291 | aF32.621167293204394 292 | aF32.652981437921085 293 | aF31.400716498967384 294 | aF30.608379755848652 295 | aF31.733740501147928 296 | aF33.406747266728452 297 | aF32.522230750316268 298 | aF31.904934965616956 299 | aF33.608987042172082 300 | aF32.098840929841145 301 | aF35.160805151381339 302 | aF28.237031051218988 303 | aF30.437018790162256 304 | aF30.616621601979922 305 | aF31.671145411003298 306 | aF32.00564690612044 307 | aF32.406966067260498 308 | aF31.196479978893105 309 | aF31.182441176105481 310 | aF31.142256773351452 311 | aF32.011036087690748 312 | aF31.035681646342063 313 | aF32.137925943982339 314 | aF32.169530325936698 315 | aF33.821064147834925 316 | aF31.653970582869157 317 | aF30.762069193778288 318 | aF31.759738700885197 319 | aF29.459485299742191 320 | aF31.723721541840867 321 | aF30.225509461070239 322 | aF33.576124243535382 323 | aF34.628962053546203 324 | aF31.878635752106309 325 | aF34.999533655987243 326 | aF33.198717723540028 327 | aF31.962779152937127 328 | aF33.479125713818284 329 | aF31.252400109842331 330 | aF34.16880221861242 331 | aF32.356120428603866 332 | aF35.477428565959052 333 | aF32.666974716337769 334 | aF34.514158334605597 335 | aF32.499177654706997 336 | aF32.382214140029923 337 | aF32.007346430033095 338 | aF32.514855855563695 339 | aF35.351418363895228 340 | aF30.38125442469136 341 | aF31.547426103706155 342 | aF31.763840287520818 343 | aF34.408971642168787 344 | aF31.711670827723427 345 | aF31.165060801307106 346 | aF31.861593595917711 347 | aF33.3642391236178 348 | aF32.876427116588076 349 | aF31.574949383727308 350 | aF33.224766270309075 351 | aF31.694223599655707 352 | aF28.979333579909419 353 | aF28.950855960541357 354 | aF31.477813906206546 355 | aF31.354893696928141 356 | aF31.468502913904842 357 | aF31.415188081150042 358 | aF33.560926336131054 359 | aF29.578231248285206 360 | aF32.648215035977287 361 | aF30.072797267572028 362 | aF32.562108159917663 363 | aF30.888087188823913 364 | aF29.63411475678102 365 | aF31.23104305695691 366 | aF31.695922999356497 367 | aF32.866170187899456 368 | aF33.971590457370077 369 | aF30.232724431466789 370 | aF32.472953638244491 371 | aF31.345942485013179 372 | aF33.60973011787123 373 | aF30.839444648285994 374 | aF32.009073632919318 375 | aF34.514453998756736 376 | aF30.285560451894447 377 | aF33.179148586733234 378 | aF29.43321574380402 379 | aF34.222160440627952 380 | aF31.053677366123118 381 | aF30.662630245725392 382 | aF31.739063479551774 383 | aF31.28893127756195 384 | aF30.625507652922739 385 | aF31.716336654522586 386 | aF32.717181253339753 387 | aF31.441862687242921 388 | aF32.06271541710742 389 | aF29.333074742777541 390 | aF28.31266502241365 391 | aF30.726286065236824 392 | aF31.847861112515815 393 | aF32.930504401403667 394 | aF32.303738540617211 395 | aF34.006003261568587 396 | aF29.387602602406069 397 | aF29.753052141616614 398 | aF33.259757579741951 399 | aF32.954945812948154 400 | aF32.758292268866981 401 | aF31.669700710107787 402 | aF32.316034163107609 403 | aF31.662617799577212 404 | aF33.457101581870965 405 | aF32.689842616992941 406 | aF32.881719390423392 407 | aF31.335123210605346 408 | aF35.198123806784523 409 | aF31.811593227836109 410 | aF30.851094900335976 411 | aF31.325900373148695 412 | aF31.531721002554001 413 | aF30.508731136600158 414 | aF33.179427485360677 415 | aF32.511264527663712 416 | aF34.17582462364102 417 | aF32.189268429025788 418 | aF31.623634382396659 419 | aF31.049782737940937 420 | aF31.726618566130973 421 | aF35.922891883468822 422 | aF36.031371258933447 423 | aF37.603885319972967 424 | aF34.500375557605018 425 | aF37.249904194968849 426 | aF36.644675074854163 427 | aF34.91553184325312 428 | aF33.985264996108548 429 | aF39.04434373988137 430 | aF35.633721978186983 431 | aF37.336338453438586 432 | aF35.336668118565207 433 | aF37.804280430773673 434 | aF37.5311304110378 435 | aF37.629505608338306 436 | aF38.202554752080594 437 | aF36.725132378645377 438 | aF36.607610590303878 439 | aF35.428069646607192 440 | aF35.564331848037057 441 | aF37.653893119471064 442 | aF37.075390642162738 443 | aF37.487568938287559 444 | aF37.46333280974558 445 | aF36.895259359543473 446 | aF36.452730596123104 447 | aF38.179814915389798 448 | aF35.585417670183965 449 | aF37.462348789259963 450 | aF38.041533417707313 451 | aF37.672808005366363 452 | aF37.757576226792388 453 | aF36.762712537751398 454 | aF36.71485478876015 455 | aF36.396703154757127 456 | aF38.164273698603161 457 | aF36.536895842660684 458 | aF36.813334843403027 459 | aF35.128691343844352 460 | aF36.600761731739297 461 | aF35.836758290321974 462 | aF45.792704357023581 463 | aF44.081430922890341 464 | aF44.932862333185 465 | aF44.758151273324692 466 | aF44.711076336030196 467 | aF43.342565914952637 468 | aF42.653293725000815 469 | aF44.081812748217907 470 | aF44.246991183794016 471 | aF44.833953221643185 472 | aF44.814593015181096 473 | aF44.921088954092518 474 | aF43.105882913168273 475 | aF44.07788875503924 476 | aF45.773594829942233 477 | aF45.123988385980468 478 | aF42.81102917685638 479 | aF45.083250962848055 480 | aF45.889935501343054 481 | aF43.970893949956533 482 | aF43.605446952654368 483 | aF44.659163365135335 484 | aF43.616386070129337 485 | aF45.169572443451401 486 | aF42.411604787467319 487 | aF45.653383054665724 488 | aF45.727812070961086 489 | aF48.090960649811784 490 | aF43.258652397049325 491 | aF46.574913862028438 492 | aF44.064728219651499 493 | aF44.526617035224319 494 | aF44.673318402550528 495 | aF45.82399102126702 496 | aF41.204922913243507 497 | aF41.697929908760173 498 | aF45.832676751333636 499 | aF44.39492289865936 500 | aF48.989115791685535 501 | aF47.923089330906187 502 | aF47.011697065216715 503 | aF46.851577803994886 504 | aF48.71175839537743 505 | aF47.378384958476055 506 | aF46.515883235018798 507 | aF46.666127554429963 508 | aF48.279416994357987 509 | aF47.261741225855424 510 | aF45.726206251812563 511 | aF46.343946131940555 512 | aF46.685545132135367 513 | aF47.826134258634646 514 | aF46.577097438863497 515 | aF46.607561496186236 516 | aF44.436964249124422 517 | aF45.98615327229583 518 | aF48.162199279446945 519 | aF48.099768637981512 520 | aF46.404347582055202 521 | aF47.062582596517444 522 | aF49.010425140906634 523 | aF48.060858515695465 524 | aF45.838169389484683 525 | aF45.026745848746927 526 | aF48.82181263746115 527 | aF47.292950804364047 528 | aF45.02843671584867 529 | aF48.015632329107888 530 | aF49.718630460894381 531 | aF47.875859423306295 532 | aF46.995875995011637 533 | aF46.476718637847341 534 | aF46.415929887636615 535 | aF46.725490209844544 536 | aF46.770826277197543 537 | aF45.768486081615414 538 | aF47.040590610664836 539 | aF44.646243775708307 540 | aF46.963633027685169 541 | aF46.6847858738208 542 | aF46.7199458845026 543 | aF48.341804966373651 544 | aF47.982780113595958 545 | aF47.520961745753631 546 | aF48.38153051254622 547 | aF48.87876468368372 548 | aF46.242692271515942 549 | aF47.545837925912252 550 | aF47.118590716447592 551 | aF47.510442832285563 552 | aF47.901200935888248 553 | aF45.923833444489006 554 | aF47.604515096344635 555 | aF46.292285263914188 556 | aF46.81690585034881 557 | aF46.821380348071216 558 | aF47.697255595105425 559 | aF46.32075714055982 560 | aF49.390815470436323 561 | aF47.293443648765368 562 | aF46.436200035320027 563 | aF46.452132919062016 564 | aF45.998757114015007 565 | aF46.287687319878842 566 | aF46.259995933450803 567 | aF46.576464453909729 568 | aF48.011206685045352 569 | aF47.438032133597808 570 | aF47.375052385008686 571 | aF46.917893843373449 572 | aF47.637451839989644 573 | aF47.582453383075652 574 | aF47.658665963942859 575 | aF47.100677802844245 576 | aF46.16145772759382 577 | aF48.020766535291742 578 | aF46.394606029825361 579 | aF47.87898517678525 580 | aF46.55659262446968 581 | aF45.794714981326813 582 | aF46.464720913563795 583 | aF46.685432373182415 584 | aF46.406962422067551 585 | aF47.24065219156499 586 | aF47.596560722662495 587 | aF47.985709951512753 588 | aF47.310054970737255 589 | aF48.468886072244658 590 | aF48.329020187665414 591 | aF48.588142375065118 592 | aF46.993147941591779 593 | aF47.275572792354737 594 | aF48.40186423037067 595 | aF46.917385333087921 596 | aF48.239011399612927 597 | aF48.357541559857353 598 | aF46.739231725487201 599 | aF45.755957988415545 600 | aF47.926391454375931 601 | aF46.450500844473346 602 | aF46.238716042212161 603 | aF47.806006574616582 604 | aF45.033000984108227 605 | aF47.398831557421367 606 | aF46.448687978729517 607 | aF45.848005589766053 608 | aF45.801366427626149 609 | aF47.44589314008126 610 | aF49.337110298579098 611 | aF48.385019229930748 612 | aF46.619572740906548 613 | aF47.865989689470602 614 | aF46.591407864641262 615 | aF47.260099161487268 616 | aF48.611742604173969 617 | aF47.698594686509452 618 | aF46.85488005404153 619 | aF47.075893379312447 620 | aF48.342529585387759 621 | aF49.272080462014145 622 | aF48.476280427104072 623 | aF47.952306005979871 624 | aF44.987468581338128 625 | aF45.432094487375267 626 | aF47.408554655729731 627 | aF45.611740030580492 628 | aF48.372862091702281 629 | aF46.450022295649411 630 | aF48.506721316844057 631 | aF46.54269917816741 632 | aF46.645440751624534 633 | aF47.431936569752828 634 | aF46.936265616771465 635 | aF46.312455595532697 636 | aF47.171851615396598 637 | aF48.294745821885648 638 | aF47.878515306603283 639 | aF45.751258619230242 640 | aF47.282302573877189 641 | aF46.749983819301029 642 | aF46.455872264822418 643 | aF47.826276767295951 644 | aF48.501043991896097 645 | aF48.330208807673102 646 | aF47.643586865132555 647 | aF47.740674740949018 648 | aF49.390511698789446 649 | aF49.200597822846206 650 | aF48.651452201209196 651 | aF47.6208644555837 652 | aF48.314247795548781 653 | aF49.183224208359142 654 | aF50.110662697526351 655 | aF46.593108584311125 656 | aF45.839654484638324 657 | aF46.837994458098038 658 | aF45.502133777832668 659 | aF45.891823605856608 660 | aF46.842584968067861 661 | aF45.266722715476995 662 | aF45.819029559044537 663 | aF45.185181643800085 664 | aF45.424857697780666 665 | aF46.884821518714304 666 | aF45.495874016088315 667 | aF45.349027704625655 668 | aF44.54127431647364 669 | aF45.494897324964647 670 | aF45.968782884887084 671 | aF45.636884758772197 672 | aF46.401565164087579 673 | aF45.057602704107687 674 | aF45.565244598416967 675 | aF53.286041068668197 676 | aF52.803212902990687 677 | aF51.998810007676049 678 | aF55.701499827836358 679 | aF55.162652669388741 680 | aF56.151107571647934 681 | aF64.665743159790679 682 | aF63.308910182068381 683 | aF64.770559863510186 684 | aF63.977457431595809 685 | aF63.995377906703112 686 | aF66.128359651874248 687 | aF63.600610419748399 688 | aF64.494301747180955 689 | aF63.792330376366102 690 | aF63.828611286262813 691 | aF65.428905452288518 692 | aF64.425509026593758 693 | aF65.700181209322395 694 | aF62.507269894975835 695 | aF64.636369941480865 696 | aF66.384956716460835 697 | aF65.528321677698855 698 | aF64.016490623936406 699 | aF63.892018989237194 700 | aF64.558765549607003 701 | aF64.408575856479104 702 | aF63.727875231106673 703 | aF64.516958922595308 704 | aF63.52905127668916 705 | aF62.98738595529047 706 | aF64.114101049981869 707 | aF63.740811445939286 708 | aF63.474824724263641 709 | aF63.726998035843309 710 | aF63.095738245448054 711 | aF65.730204398880772 712 | aF63.939876372553542 713 | aF63.144226228654631 714 | aF63.801485483523976 715 | aF63.546899098356363 716 | aF65.810850586533036 717 | aF63.920201849525796 718 | aF63.443012470912151 719 | aF63.436203759499229 720 | aF64.096619079674099 721 | aF64.071607680030908 722 | aF62.601963066756603 723 | aF63.47210864006432 724 | aF63.937880937421475 725 | aF62.350041228670896 726 | aF63.41164288199321 727 | aF63.852772221381748 728 | aF63.51864398442477 729 | aF63.70596793993505 730 | aF63.154204397102504 731 | aF62.775437296865185 732 | aF62.796528900905685 733 | aF63.944799371466175 734 | aF63.559850754784158 735 | aF62.461252779659631 736 | aF64.228385390485954 737 | aF63.643159875404166 738 | aF62.294568421226835 739 | aF63.548675683527591 740 | aF62.646221445371232 741 | aF62.777228471954857 742 | aF62.031250633413208 743 | aF63.139352230454691 744 | aF62.921524980414944 745 | aF63.33546206144576 746 | aF63.019864289211526 747 | aF63.431712337461754 748 | aF63.611720725625567 749 | aF64.095391577655846 750 | aF63.750684019759412 751 | aF63.164925794041281 752 | aF62.459038549313526 753 | aF63.130879346400064 754 | aF63.374582113929193 755 | aF63.520780702018314 756 | aF62.260089500553249 757 | aF62.468625895951575 758 | aF63.63359196854568 759 | aF62.109224676618943 760 | aF64.124561908794902 761 | aF63.165479308257417 762 | aF63.177703041553933 763 | aF61.986173839842635 764 | aF64.090697121572219 765 | aF63.395985772412438 766 | aF63.304633119710324 767 | aF63.244056036892381 768 | aF62.863230195638025 769 | aF62.518910178152332 770 | aF63.83664024024678 771 | aF62.87236493015596 772 | aF61.90930325060733 773 | aF63.240754162766549 774 | aF63.286356177593866 775 | aF62.970759691911347 776 | aF63.843450886135848 777 | aF62.416727496042085 778 | aF62.812350836984706 779 | aF63.567045589899998 780 | aF62.567269108861382 781 | aF63.068908719449425 782 | aF63.494312994821421 783 | aF64.223676670532797 784 | aF62.213590091076668 785 | aF63.679595790404925 786 | aF63.52922398136608 787 | aF62.778823489729042 788 | aF62.624552231210103 789 | aF63.24203478192215 790 | aF62.9373737986988 791 | aF62.931055348865399 792 | aF63.070402994737506 793 | aF63.707584657985478 794 | aF63.645157451728423 795 | aF63.697964647644284 796 | aF62.978258152848262 797 | aF63.226834541459183 798 | aF62.784351611176618 799 | aF62.305742647244401 800 | aF62.224553870083547 801 | aF62.915963202983036 802 | aF63.033783611327799 803 | aF63.144720631682006 804 | aF63.965301138350334 805 | aF63.79793608193377 806 | aF63.610970033074317 807 | aF63.569829696523428 808 | aF63.174658618723079 809 | aF63.246340212829296 810 | aF62.450140691228853 811 | aF63.063228743355559 812 | aF63.53383196630508 813 | aF63.645729681715487 814 | aF63.73134412714942 815 | aF63.14078849074901 816 | aF63.484503462349132 817 | aF63.569303333316313 818 | aF62.916609651687921 819 | aF61.764062732878763 820 | aF61.843494503983443 821 | aF64.454409069720924 822 | aF62.983056352496384 823 | aF63.460213208144651 824 | aF63.562961884783512 825 | aF63.568536621971177 826 | aF63.373300974687389 827 | aF62.902163001578053 828 | aF63.252441705577695 829 | aF62.624911406531822 830 | aF63.805016731544015 831 | aF63.040901895569057 832 | aF63.112083395503674 833 | aF62.700907576257968 834 | aF61.883194221351459 835 | aF63.750022169951158 836 | aF62.56146614360874 837 | aF63.976536886119781 838 | aF63.035684595572235 839 | aF62.550905592351569 840 | aF62.852789136615741 841 | aF62.367665193649721 842 | aF62.71134121837494 843 | aF62.851377920975253 844 | aF63.157835258362958 845 | aF62.141492617649732 846 | aF63.814585267714499 847 | aF63.164351814465213 848 | aF63.428218356519992 849 | aF62.671660292057879 850 | aF63.416188632899662 851 | aF62.875119703353157 852 | aF62.38486792973557 853 | aF63.164498739511501 854 | aF61.987268121540374 855 | aF63.572530951084381 856 | aF63.085301504095803 857 | aF63.278164313783861 858 | aF63.005439020205323 859 | aF62.813403243740005 860 | aF63.191840039205651 861 | aF62.689019570768501 862 | aF62.831456305491002 863 | aF63.719449864125195 864 | aF63.300589854007093 865 | aF63.9059453204964 866 | aF63.030166793256399 867 | aF61.976361391686439 868 | aF62.4314742666635 869 | aF63.094630606648792 870 | aF62.59517735852446 871 | aF63.313357062055879 872 | aF63.691511088532238 873 | aF63.161190476847501 874 | aF64.030061578623958 875 | aF63.522228091447914 876 | aF63.164691999526362 877 | aF63.026579671510405 878 | aF62.962717087057293 879 | aF63.074618859197585 880 | aF63.473268485927122 881 | aF62.843057950519608 882 | aF64.074515122704071 883 | aF62.824349640930095 884 | aF62.674453001402163 885 | aF62.660314959620834 886 | aF63.378616282035104 887 | aF63.393369713293154 888 | aF63.403691992750652 889 | aF63.710427788645326 890 | aF63.371808935265605 891 | aF62.922077880175017 892 | aF63.784732773332422 893 | aF63.846036129109507 894 | aF62.361058057415967 895 | aF62.386778887271355 896 | aF63.395023855877433 897 | aF63.07063199256126 898 | aF63.80587407861811 899 | aF63.187788863124311 900 | aF65.592132541706263 901 | aF61.939024018745016 902 | aF62.530750579559772 903 | aF62.725981018732362 904 | aF62.790695833663456 905 | aF62.973090607040703 906 | aF63.512942082033923 907 | aF62.987170972030988 908 | aF63.508297721068338 909 | aF63.718495397770077 910 | aF62.582011863320837 911 | aF63.385676120225163 912 | aF63.634109079237099 913 | aF63.32002947317784 914 | aF62.810749338864625 915 | aF63.936519645662635 916 | aF62.677247203592934 917 | aF63.193167826680096 918 | aF63.220927445398168 919 | aF63.43972430453254 920 | aF63.57685816579184 921 | aF62.450336860907754 922 | aF63.585224580005672 923 | aF63.60465070472349 924 | aF64.424328736553363 925 | aF63.16409979988606 926 | aF63.476734619679434 927 | aF62.766138880903355 928 | aF63.614388641895232 929 | aF62.856892837817085 930 | aF62.947448146098978 931 | aF64.100349270520439 932 | aF62.875527363972154 933 | aF63.940606043702452 934 | aF63.234021687619595 935 | aF63.294628733370246 936 | aF63.029369490696617 937 | aF63.133857360254623 938 | aF63.847890358170616 939 | aF62.849773493946415 940 | aF62.882073772513976 941 | aF63.62765474679464 942 | aF62.313852528089427 943 | aF62.653850622032486 944 | aF62.599083016492514 945 | aF63.953732276759787 946 | aF62.883054841748454 947 | aF62.75166249118864 948 | aF62.614638632763658 949 | aF63.033061569236153 950 | aF62.898116211182156 951 | aF64.841656512483311 952 | aF65.371058282649685 953 | aF65.356456146192869 954 | aF65.640134591099894 955 | aF65.186427005777105 956 | aF65.372729231561621 957 | aF65.247842317453433 958 | aF65.757305569504553 959 | aF65.148663997847422 960 | aF64.885450065586269 961 | aF65.1736179004387 962 | aF65.522184444411991 963 | aF65.118771451761418 964 | aF64.967024363992664 965 | aF64.894148019359122 966 | aF65.379170598891591 967 | aF65.867999650822711 968 | aF65.262897453152448 969 | aF65.719230739526353 970 | aF64.758401260867259 971 | aF64.969914454301261 972 | a. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /examples/Confusion_matrix.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## Confusion matrix for unfiltered trajectories.\n", 8 | "This notebook computes the confusion matrix for unfiltered synthetic data for several thresholds. When the data is unfiltered, many change points are missed. However, as the threshold is lowered and the false negatives decrease, the false positive rate increases. " 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 1, 14 | "metadata": { 15 | "collapsed": true 16 | }, 17 | "outputs": [], 18 | "source": [ 19 | "%matplotlib inline\n", 20 | "import matplotlib.pyplot as plt\n", 21 | "import matplotlib as mpl\n", 22 | "import numpy as np\n", 23 | "from cpdetect import cpDetector\n", 24 | "import pandas as pd\n", 25 | "from matplotlib.backends.backend_pdf import PdfPages\n", 26 | "from tqdm import *\n", 27 | "try:\n", 28 | " import cPickle as pickle\n", 29 | "except:\n", 30 | " import pickle\n", 31 | "import os, glob" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": 2, 37 | "metadata": { 38 | "collapsed": true 39 | }, 40 | "outputs": [], 41 | "source": [ 42 | "# Load all relavant data (synthetic trajectories and pickled detectors.)\n", 43 | "trajs = np.load('synthetic_trajs.np.npy')\n", 44 | "filtered_trajs = np.load('filtered_trajs.npy')\n", 45 | "true_ts = pickle.load(open('true_ts.pickle', 'rb'))\n", 46 | "true_step = pickle.load(open('step_synthetic.pickle', 'rb'))\n", 47 | "files = [file for file in glob.glob('detector*')]\n", 48 | "detectors = {f[9:-7]: pickle.load(open(f, 'rb')) for f in files}" 49 | ] 50 | }, 51 | { 52 | "cell_type": "code", 53 | "execution_count": 4, 54 | "metadata": { 55 | "collapsed": false 56 | }, 57 | "outputs": [], 58 | "source": [ 59 | "# Calculate all confusion matrices. The rejection window here is 100 timepoints. \n", 60 | "cm = np.zeros((10, 2, 2))\n", 61 | "for d in detectors:\n", 62 | " tp = 0\n", 63 | " fp = 0\n", 64 | " fn = 0\n", 65 | " for t in range(len(trajs)):\n", 66 | " true_positive = []\n", 67 | " false_negative = true_ts['traj_{}'.format(t)][:-1]\n", 68 | " false_positive = np.asarray(detectors[d].change_points['traj_{}'.format(t)]['ts'])\n", 69 | " index_neg = []\n", 70 | " for i, t_ts in enumerate(false_negative):\n", 71 | " for j, p_ts in enumerate(false_positive):\n", 72 | " if t_ts-100 <= p_ts <= t_ts+100:\n", 73 | " true_positive.append(p_ts)\n", 74 | " index_neg.append(i)\n", 75 | " false_positive = np.delete(false_positive, j)\n", 76 | " break\n", 77 | " false_negative = np.delete(false_negative, index_neg)\n", 78 | " # sanity check\n", 79 | " assert(len(true_ts['traj_{}'.format(t)][:-1]) == (len(true_positive) + len(false_negative)))\n", 80 | " assert(len(np.asarray(detectors[d].change_points['traj_{}'.format(t)]['ts']+28)) == \n", 81 | " (len(true_positive) + len(false_positive)))\n", 82 | " tp += len(true_positive)\n", 83 | " fp += len(false_positive)\n", 84 | " fn += len(false_negative)\n", 85 | " m = int(d[-1])\n", 86 | " cm[m] = np.array(([tp, fp], [fn, 0]))" 87 | ] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": 5, 92 | "metadata": { 93 | "collapsed": false 94 | }, 95 | "outputs": [ 96 | { 97 | "data": { 98 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEKCAYAAADzQPVvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8lNXZ//HPdzJJCAkQQgIaQFB2pIpVEBWthYq2KlXb\nKtQFq63W1qp1qQtW0dpHW1v39vc8Wh+XKmq1omgf61ZrEQGRVVAUkEWIyr4EQra5fn/MnThkI8tk\ngft6v17zYubMuc8yuebKuc/cZGRmOOec27dFWnsAzjnnmp8ne+ecCwFP9s45FwKe7J1zLgQ82Tvn\nXAh4snfOuRDwZN/GSJok6YkW6Ke3JJMUbcSxx0taU8fzj0q6rWkjdPsaj+3W5cm+hUkqTLjFJBUl\nPD67tce3N5E0VNIcSTuDf4e29pjCzGM7eSQ9KOnj4HU8PxlterJvYWaWVXEDVgOnJpQ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jWHkJSZKRqjpntdlG3x/buGhLbOb0H2+iba9u52jv89dza/+/K3qSm2K7JHpO9azxP\n9m1Hfd8Qrn482bcd9Y1t/3MJzjkXAp7snXMuBDzZO+dcCHiyd865EPBk75xzIeDJ3jnnQsCTvXPO\nhYAne+ecCwFP9s45FwKe7J1zLgQ82TvnXAh4snfOuRDwZO+ccyHgyd4550LAk71zzoWAJ3vnnAsB\nT/bOORcCnuydcy4EPNk751wI+HfQNiNJ64FVzdxNLrBhj7XatpaYQy8zy2vmPkLDY7ve2kxse7Lf\ny0l6f2//Iu19YQ4u+faFuGhLc/BtHOecCwFP9s45FwKe7Pd+D7b2AJJgX5iDS759IS7azBx8zz6E\nJHUB3gwe7geUA+uDx8PNrKRVBuZcE3ls186TfchJmgQUmtkfqpSLeHzEWmVgzjWRx/bufBvHVZLU\nV9KHkp4EFgM9JW1JeH6cpL8E97tJel7S+5LekzSitcbt3J54bEO0tQfg2pyBwHlm9r6kuuLjPuD3\nZjZTUm/gZWBIC4zPucYKdWx7sndVLTez9+tR71vAgPgZMQCdJWWYWVHzDc25Jgl1bHuyd1XtSLgf\nA5TwuF3CfRHyD7zcXifUse179q5WwQdYmyX1kxQBTk94+g3g5xUPJA1t6fE511hhjG1P9m5PrgVe\nBd4F1iSU/xw4RtJCSR8CP2mNwTnXBKGKbb/00jnnQsBX9s45FwKe7J1zLgQ82TvnXAh4snfOuRDw\nZO+ccyHgyd4550LAk71zzoXA/wddoYROFdQ5kAAAAABJRU5ErkJggg==\n", 99 | "text/plain": [ 100 | "" 101 | ] 102 | }, 103 | "metadata": {}, 104 | "output_type": "display_data" 105 | }, 106 | { 107 | "data": { 108 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEKCAYAAADzQPVvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XeUFFX6//H3p3siM6QhKUGQDKIOIBkTCIoCq6goJkyL\ncc0ZddGvru7qzzWt7uq6Kib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N3ockNQE+9HYPAPKAX739vs657FoZmDFVZLFdOkv2PidpErDbOfdgkXIRio/8WhmY\nMVVksV2YLeOYMEkdJX0r6SVgKdBG0vaI42dK+qf3uoWkNyR9IWm+pP61NW5jymOxDXG1PQBT53QF\nznPOfSGprPh4FPiLc26epHbAO0CPGhifMZXl69i2ZG+KWuGc+6IC9Y4DuoTuiAFoLCnZOZdZfUMz\npkp8HduW7E1RGRGv8wFF7CdFvBY+/8LL7HN8Hdu2Zm9K5X2BtU1SJ0kB4JSIwzOBKwp2JKXX9PiM\nqSw/xrYle1Oem4H3gDnA2ojyK4BBkhZL+hb4fW0Mzpgq8FVs26OXxhjjA3Zlb4wxPmDJ3hhjfMCS\nvTHG+IAle2OM8QFL9sYY4wOW7I0xxgcs2RtjjA/8fxFEO7AITA5eAAAAAElFTkSuQmCC\n", 109 | "text/plain": [ 110 | "" 111 | ] 112 | }, 113 | "metadata": {}, 114 | "output_type": "display_data" 115 | }, 116 | { 117 | "data": { 118 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAACJCAYAAADNE5itAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGwlJREFUeJzt3Xd4FNX6wPHvu+kQWgjF0KKAFFEiRUCKQKQqXEFRUBQL\n8hNFEBARQVDkWtCLqNhQr4iKWFH0XhHxKk1AIKKAgEiXaggEkpBsyvn9sZN1SbLJJmwKmffzPPO4\nc+bMmXOWd989c3YEMcaglFKqfHOUdgeUUkoVP032SillA5rslVLKBjTZK6WUDWiyV0opG9Bkr5RS\nNqDJvowRkcdE5L0SuE60iBgRCSzCuV1F5M98js8TkRnn1kNV3mhsly5N9iVMRJI8tiwROeOxf0tp\n9+98IiLdRSRORE6JyG4RGVHafbIzjW3/EZF+IrLFeu9+FJHm59qmJvsSZowJz96A/UA/j7L3C9NW\nUWYu5YWIBAGLgNeBKsBNwCwRaVmqHbMxjW3/EJHGwPvAPUBV4Etg8bm+J5rsy6ZgEZkvIq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HwjlG032ZYevsa3/B61SStmAJnullLIBTfZKKWUDmuyVUsoGNNkrpZQNaLJXSikb\n0GSvlFI2oMleKaVsQJO9UkrZgCZ7pZSyAU32SillA5rslVLKBjTZK6WUDWiyV0opG9Bkr5RSNqDJ\nXimlbECTvVJK2YAme6WUsgFN9kopZQP6b9AWIxH5C9hXzJeJBOILrFW2lcQYGhhjahTzNWxDY9tn\nZSa2Ndmf50Rkw/n+D2mXhzEo/ysPcVGWxqDLOEopZQOa7JVSygY02Z//5pZ2B/ygPIxB+V95iIsy\nMwZds1dKKRvQmb1SStmAJnullLIBTfZKKWUDmuyVUsoGNNkrpZQN/D9mYCZCsxRoUAAAAABJRU5E\nrkJggg==\n", 119 | "text/plain": [ 120 | "" 121 | ] 122 | }, 123 | "metadata": {}, 124 | "output_type": "display_data" 125 | } 126 | ], 127 | "source": [ 128 | "# Plot confusion matrices\n", 129 | "key = [['TP', 'FN'], ['FP', 'TN']]\n", 130 | "labelx = ['True T', 'No T']\n", 131 | "labely = ['Predicted T', 'Predicted No T']\n", 132 | "filename = 'confusion_matrix.pdf'\n", 133 | "with PdfPages(filename) as pdf:\n", 134 | " for p in range(3):\n", 135 | " fig = plt.figure()\n", 136 | " for f in range(4):\n", 137 | " if p*4 + f > 9:\n", 138 | " break\n", 139 | " ax = fig.add_subplot(2, 2, f+1)\n", 140 | " confusion = ax.matshow(cm[p*4 + f], cmap='Blues')\n", 141 | " for (j, k), label in np.ndenumerate(cm[p*4+f]):\n", 142 | " l = key[k][j] + ': ' + str(int(label))\n", 143 | " ax.text(k,j,l,ha='center',va='center')\n", 144 | " plt.title('Threshold = -{}'.format(str(p*4+f)));\n", 145 | " if f in (2, 3):\n", 146 | " plt.xlabel('True')\n", 147 | " ax.set_xticklabels([])\n", 148 | " ax.set_yticklabels(['']+labely)\n", 149 | " pdf.savefig(bbox_inches='tight')\n", 150 | " " 151 | ] 152 | }, 153 | { 154 | "cell_type": "code", 155 | "execution_count": null, 156 | "metadata": { 157 | "collapsed": true 158 | }, 159 | "outputs": [], 160 | "source": [] 161 | } 162 | ], 163 | "metadata": { 164 | "kernelspec": { 165 | "display_name": "Python 3", 166 | "language": "python", 167 | "name": "python3" 168 | }, 169 | "language_info": { 170 | "codemirror_mode": { 171 | "name": "ipython", 172 | "version": 3 173 | }, 174 | "file_extension": ".py", 175 | "mimetype": "text/x-python", 176 | "name": "python", 177 | "nbconvert_exporter": "python", 178 | "pygments_lexer": "ipython3", 179 | "version": "3.5.1" 180 | } 181 | }, 182 | "nbformat": 4, 183 | "nbformat_minor": 0 184 | } 185 | --------------------------------------------------------------------------------