This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 103 Blocks are allocated: | |
| Memory block at 0x880d9b8 of size 1472 bytes (allocated in modshogun_wrap.cxx line 191453) | |
| SGObject 'SimpleFeatures' at 0x880d3f0 of size 120 bytes with 2 ref's | |
| Object at 0x878f488 of size 28 bytes | |
| Memory block at 0x880d470 of size 4 bytes (allocated in ../shogun/base/DynArray.h line 49) | |
| Object at 0x8789d38 of size 28 bytes | |
| Memory block at 0x880d678 of size 4 bytes (allocated in ../shogun/base/DynArray.h line 49) | |
| Object at 0x878a030 of size 32 bytes | |
| Object at 0x880d898 of size 32 bytes | |
| Object at 0x880d8f0 of size 32 bytes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Compiling with g++ Shogun.cpp -lshogun -o shoguntest | |
| #include <shogun/features/Labels.h> | |
| #include <shogun/features/SimpleFeatures.h> | |
| #include <shogun/kernel/GaussianKernel.h> | |
| #include <shogun/classifier/svm/LibSVM.h> | |
| #include <shogun/base/init.h> | |
| #include <shogun/lib/common.h> | |
| #include <shogun/io/SGIO.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy | |
| def calcroc(out, lab): | |
| """ | |
| Computes the ROC curve. | |
| Expects labels to be +/-1 and real-valued predictions | |
| """ | |
| idx = numpy.argsort(out) | |
| tp=numpy.concatenate( ([1], 1-numpy.cumsum(lab[idx]>0)/float(numpy.sum(lab > 0))) ) | |
| fp=numpy.concatenate( ([1], 1-numpy.cumsum(lab[idx]<0)/float(numpy.sum(lab < 0))) ) | |
| score = 0.5*numpy.sum((fp[:-1]-fp[1:])*(tp[:-1]+tp[1:])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| call pathogen#infect() | |
| syntax on | |
| filetype plugin indent on | |
| let g:load_doxygen_syntax=1 | |
| set ruler | |
| set smartindent | |
| set ai | |
| set showmatch | |
| set rulerformat=%(%l,%c\ %p%%%) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from modshogun import * | |
| from numpy import * | |
| import random | |
| tree_adj = genfromtxt('tree.tsv', skiprows=1)[:,1:] | |
| features = genfromtxt('features.tsv',skiprows=1)[:,1:] | |
| labels = genfromtxt('labels.tsv',dtype=float)[:,1:].flatten() | |
| n_dims, n_vecs = features.shape | |
| norm = NormOne() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <eigen3/Eigen/Dense> | |
| #include <cblas.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <time.h> | |
| using namespace Eigen; | |
| static double loop_dot(double* a, double* b, int d) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pylab import * | |
| from numpy import * | |
| from scipy.optimize import fmin_l_bfgs_b,check_grad | |
| import time | |
| random.seed(7) | |
| N=25 | |
| X=hstack([random.randn(2,N)-1.5,random.randn(2,N)+1.5]) | |
| mean = X.mean(1) | |
| for i in xrange(N*2): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| import numpy | |
| import time | |
| class operation(): | |
| def __init__(self, msg): | |
| self.msg = msg | |
| def __enter__(self): | |
| print 'Starting %s' % self.msg | |
| self.start = time.time() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| import numpy | |
| import time | |
| import modshogun | |
| vars = {} | |
| class operation(): | |
| def __init__(self, msg, *args): | |
| self.msg = msg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| import numpy | |
| import time,datetime | |
| import modshogun | |
| import cPickle | |
| vars = {} | |
| # operational context | |
| class operation(object): |
OlderNewer