예제 #1
0
def calc_metrics(features, clust_idx):
    
    uni_metric = eval.univariate_metric(eval.mutual_information, 
                                          features, clust_idx)
    multi_metric = eval.k_nearest(features, clust_idx, n_pts=1000)
    
    return uni_metric, multi_metric
예제 #2
0
파일: eval_batch.py 프로젝트: btel/SortEval
def single_run(filter, spk_src, bg_src, params):
    import evaluate as eval

    sp_win    = params['sp_win']
    spadd_win = params['sp_add_win']
    pow_frac  = params['pow_frac']
    f_filter  = params['f_filter']
    type      = params['sp_type']
    thresh    = params['thresh']
    feats     = params['features']
    contacts  = params['contacts']
    n_pts     = params['n_pts']

    sp, stim, spt_real = eval.mix_cellbg(filter, spk_src, bg_src, 
                                         spadd_win, pow_frac)
    sp = eval.filter_data(sp, f_filter)

    spt, clust_idx, n_missing = eval.spike_clusters(sp, spt_real,
                                                    stim,
                                                    thresh,
                                                    type, sp_win) 
    
    features = eval.calc_features(sp, spt, sp_win, feats, contacts)
    
    uni_metric = eval.univariate_metric(eval.mutual_information, 
                                        features, clust_idx)

    multi_metric = eval.k_nearest(features, clust_idx, n_pts=n_pts)

    n_total = len(spt_real['data'])

    result_dict= {"cell" : spk_src,
                  "electrode" : bg_src,
                  "spikes_total" : n_total,
                  "spikes_missed" : n_missing,
                  "mutual_information" : uni_metric,
                  "k_nearest" : multi_metric}

    result_dict.update(params)
    
    import socket
    #from sim_manager import get_version

    result_dict['host'] = socket.gethostname()
    #result_dict['dependencies'] ={'evaluate': get_version(eval),
    #                              'spike_sort': get_version(eval.sort)}
    
    return result_dict