Load necessary packages and extensions


In [1]:
%load_ext sql
import pandas as pd
import numpy as np
from sklearn.cluster import DBSCAN, KMeans
from sklearn import metrics
from collections import Counter
from __future__ import division

Get conditions data from database


In [2]:
# sql connection parameters come from connect.py
have_connect = !ls connect.py 2>/dev/null
if len(have_connect) == 0:
    !mv ../../connect.py .
from connect import *

get_ipython().magic('sql mysql://' + mysqlusername + ':' + mysqlpassword + '@' + mysqlserver + ':3306/' + mysqldbname)
conditions = %sql select nct_id, mesh_term from condition_browse
mesh_lookup = %sql select mesh_id, mesh_term from mesh_thesaurus


309589 rows affected.
54935 rows affected.

Create dictionary of mesh_terms to mesh_id's


In [3]:
mesh_terms = {mesh_id: mesh_term for mesh_id, mesh_term in mesh_lookup}
mesh_ids = {}
for id, term in mesh_lookup:
    # create term-to-id lookup
    if term not in mesh_ids: mesh_ids[term] = set()
    mesh_ids[term].add(id)

Create dictionary of condition categories to list of relevant studies


In [4]:
condition_study = {}
for studyid, cond in conditions:
    mesh_cats = set([mesh_terms[m[:7]] for m in mesh_ids[cond]])
    for m in list(mesh_cats):
        if m not in condition_study: condition_study[m] = set()
        condition_study[m].add(studyid)

Remove categories with less than 40 studies


In [5]:
for c in condition_study.keys():
    if len(condition_study[c]) < 40:
        del condition_study[c]

Define Jaccard similarity function


In [6]:
def jaccard_similarity(set1, set2):
    return float(len(set1 & set2)) / len(set1 | set2)

Generate distance matrix


In [7]:
max_dist = 10
condition_list = condition_study.keys()
num_cond = len(condition_list)
df = pd.DataFrame(index=condition_list, columns=condition_list, dtype=np.float32)
for i in range(num_cond):
    for j in range(num_cond):
        cond1 = condition_list[i]
        cond2 = condition_list[j]
        if i == j:
            dist = 0
        elif j < i:
            dist = df[cond2][cond1]
        elif len(condition_study[cond1] & condition_study[cond2]) > 0:
            sim = jaccard_similarity(condition_study[cond1], condition_study[cond2])
            dist = max([np.log10(sim), (-1 * max_dist)]) * -1
        else:
            dist = max_dist
        df[cond1][cond2] = dist

Compare performance of various parameters


In [41]:
metric_comparison = []
maxsize = 50   # 10x the highest possible eps

# create new copy of dataframe
clus_df = df.copy()
X = clus_df.as_matrix()

for s in range(15,1,-1):
    for e in range(maxsize):
        
        # fit clustering algorithm
        alt_e = (maxsize - e) / 10.0
        db = DBSCAN(eps= alt_e, min_samples=s, metric='precomputed').fit(X)
        
        # initialize variables
        labels = db.labels_
        sil = None
        largest = None
        average = None
        share_cat = None
        
        # populate variables
        valid = [v for k, v in Counter(labels).items() if k >= 0]
        n_clusters = len(valid)
        if n_clusters >= 1:
            largest = max(valid)
            average = sum(valid) / n_clusters
            share_cat = sum(valid) / len(labels)
            if n_clusters > 1:
                sil = metrics.silhouette_score(X, labels, metric='precomputed')
        metric_comparison.append({'s': s, 'e': alt_e, 'num': n_clusters, 'sil': sil, 'max': largest, 'avg': average, 'share': share_cat})
    print s


15
14
13
12
11
10
9
8
7
6
5
4
3
2

In [42]:
print '\t'.join(['minsize','eps','num_clusters','avg_size','maxsize','sil','share_cat'])
for f in metric_comparison:
    print '\t'.join(map(str,[f['s'],f['e'],f['num'],f['avg'],f['max'],f['sil'],f['share']]))


minsize	eps	num_clusters	avg_size	maxsize	sil	share_cat
15	5.0	1	204.0	204	None	1.0
15	4.9	1	204.0	204	None	1.0
15	4.8	1	204.0	204	None	1.0
15	4.7	1	204.0	204	None	1.0
15	4.6	1	204.0	204	None	1.0
15	4.5	1	204.0	204	None	1.0
15	4.4	1	204.0	204	None	1.0
15	4.3	1	204.0	204	None	1.0
15	4.2	1	204.0	204	None	1.0
15	4.1	1	204.0	204	None	1.0
15	4.0	1	204.0	204	None	1.0
15	3.9	1	204.0	204	None	1.0
15	3.8	1	204.0	204	None	1.0
15	3.7	1	204.0	204	None	1.0
15	3.6	1	204.0	204	None	1.0
15	3.5	1	204.0	204	None	1.0
15	3.4	1	204.0	204	None	1.0
15	3.3	1	204.0	204	None	1.0
15	3.2	1	204.0	204	None	1.0
15	3.1	1	204.0	204	None	1.0
15	3.0	1	204.0	204	None	1.0
15	2.9	1	204.0	204	None	1.0
15	2.8	1	204.0	204	None	1.0
15	2.7	1	204.0	204	None	1.0
15	2.6	1	203.0	203	None	0.995098039216
15	2.5	1	203.0	203	None	0.995098039216
15	2.4	1	202.0	202	None	0.990196078431
15	2.3	1	201.0	201	None	0.985294117647
15	2.2	1	201.0	201	None	0.985294117647
15	2.1	1	196.0	196	None	0.960784313725
15	2.0	1	184.0	184	None	0.901960784314
15	1.9	1	164.0	164	None	0.803921568627
15	1.8	1	153.0	153	None	0.75
15	1.7	1	129.0	129	None	0.632352941176
15	1.6	1	116.0	116	None	0.56862745098
15	1.5	2	38.5	64	-0.0442366	0.377450980392
15	1.4	1	54.0	54	None	0.264705882353
15	1.3	1	17.0	17	None	0.0833333333333
15	1.2	0	None	None	None	None
15	1.1	0	None	None	None	None
15	1.0	0	None	None	None	None
15	0.9	0	None	None	None	None
15	0.8	0	None	None	None	None
15	0.7	0	None	None	None	None
15	0.6	0	None	None	None	None
15	0.5	0	None	None	None	None
15	0.4	0	None	None	None	None
15	0.3	0	None	None	None	None
15	0.2	0	None	None	None	None
15	0.1	0	None	None	None	None
14	5.0	1	204.0	204	None	1.0
14	4.9	1	204.0	204	None	1.0
14	4.8	1	204.0	204	None	1.0
14	4.7	1	204.0	204	None	1.0
14	4.6	1	204.0	204	None	1.0
14	4.5	1	204.0	204	None	1.0
14	4.4	1	204.0	204	None	1.0
14	4.3	1	204.0	204	None	1.0
14	4.2	1	204.0	204	None	1.0
14	4.1	1	204.0	204	None	1.0
14	4.0	1	204.0	204	None	1.0
14	3.9	1	204.0	204	None	1.0
14	3.8	1	204.0	204	None	1.0
14	3.7	1	204.0	204	None	1.0
14	3.6	1	204.0	204	None	1.0
14	3.5	1	204.0	204	None	1.0
14	3.4	1	204.0	204	None	1.0
14	3.3	1	204.0	204	None	1.0
14	3.2	1	204.0	204	None	1.0
14	3.1	1	204.0	204	None	1.0
14	3.0	1	204.0	204	None	1.0
14	2.9	1	204.0	204	None	1.0
14	2.8	1	204.0	204	None	1.0
14	2.7	1	204.0	204	None	1.0
14	2.6	1	203.0	203	None	0.995098039216
14	2.5	1	203.0	203	None	0.995098039216
14	2.4	1	202.0	202	None	0.990196078431
14	2.3	1	202.0	202	None	0.990196078431
14	2.2	1	201.0	201	None	0.985294117647
14	2.1	1	199.0	199	None	0.975490196078
14	2.0	1	189.0	189	None	0.926470588235
14	1.9	1	175.0	175	None	0.857843137255
14	1.8	1	153.0	153	None	0.75
14	1.7	1	133.0	133	None	0.651960784314
14	1.6	1	117.0	117	None	0.573529411765
14	1.5	2	42.0	71	-0.0262266	0.411764705882
14	1.4	1	59.0	59	None	0.289215686275
14	1.3	1	23.0	23	None	0.112745098039
14	1.2	0	None	None	None	None
14	1.1	0	None	None	None	None
14	1.0	0	None	None	None	None
14	0.9	0	None	None	None	None
14	0.8	0	None	None	None	None
14	0.7	0	None	None	None	None
14	0.6	0	None	None	None	None
14	0.5	0	None	None	None	None
14	0.4	0	None	None	None	None
14	0.3	0	None	None	None	None
14	0.2	0	None	None	None	None
14	0.1	0	None	None	None	None
13	5.0	1	204.0	204	None	1.0
13	4.9	1	204.0	204	None	1.0
13	4.8	1	204.0	204	None	1.0
13	4.7	1	204.0	204	None	1.0
13	4.6	1	204.0	204	None	1.0
13	4.5	1	204.0	204	None	1.0
13	4.4	1	204.0	204	None	1.0
13	4.3	1	204.0	204	None	1.0
13	4.2	1	204.0	204	None	1.0
13	4.1	1	204.0	204	None	1.0
13	4.0	1	204.0	204	None	1.0
13	3.9	1	204.0	204	None	1.0
13	3.8	1	204.0	204	None	1.0
13	3.7	1	204.0	204	None	1.0
13	3.6	1	204.0	204	None	1.0
13	3.5	1	204.0	204	None	1.0
13	3.4	1	204.0	204	None	1.0
13	3.3	1	204.0	204	None	1.0
13	3.2	1	204.0	204	None	1.0
13	3.1	1	204.0	204	None	1.0
13	3.0	1	204.0	204	None	1.0
13	2.9	1	204.0	204	None	1.0
13	2.8	1	204.0	204	None	1.0
13	2.7	1	204.0	204	None	1.0
13	2.6	1	203.0	203	None	0.995098039216
13	2.5	1	203.0	203	None	0.995098039216
13	2.4	1	203.0	203	None	0.995098039216
13	2.3	1	202.0	202	None	0.990196078431
13	2.2	1	201.0	201	None	0.985294117647
13	2.1	1	201.0	201	None	0.985294117647
13	2.0	1	190.0	190	None	0.93137254902
13	1.9	1	175.0	175	None	0.857843137255
13	1.8	1	158.0	158	None	0.774509803922
13	1.7	1	137.0	137	None	0.671568627451
13	1.6	1	119.0	119	None	0.583333333333
13	1.5	2	47.0	81	-0.00804433	0.460784313725
13	1.4	1	60.0	60	None	0.294117647059
13	1.3	2	17.5	23	-0.307786	0.171568627451
13	1.2	0	None	None	None	None
13	1.1	0	None	None	None	None
13	1.0	0	None	None	None	None
13	0.9	0	None	None	None	None
13	0.8	0	None	None	None	None
13	0.7	0	None	None	None	None
13	0.6	0	None	None	None	None
13	0.5	0	None	None	None	None
13	0.4	0	None	None	None	None
13	0.3	0	None	None	None	None
13	0.2	0	None	None	None	None
13	0.1	0	None	None	None	None
12	5.0	1	204.0	204	None	1.0
12	4.9	1	204.0	204	None	1.0
12	4.8	1	204.0	204	None	1.0
12	4.7	1	204.0	204	None	1.0
12	4.6	1	204.0	204	None	1.0
12	4.5	1	204.0	204	None	1.0
12	4.4	1	204.0	204	None	1.0
12	4.3	1	204.0	204	None	1.0
12	4.2	1	204.0	204	None	1.0
12	4.1	1	204.0	204	None	1.0
12	4.0	1	204.0	204	None	1.0
12	3.9	1	204.0	204	None	1.0
12	3.8	1	204.0	204	None	1.0
12	3.7	1	204.0	204	None	1.0
12	3.6	1	204.0	204	None	1.0
12	3.5	1	204.0	204	None	1.0
12	3.4	1	204.0	204	None	1.0
12	3.3	1	204.0	204	None	1.0
12	3.2	1	204.0	204	None	1.0
12	3.1	1	204.0	204	None	1.0
12	3.0	1	204.0	204	None	1.0
12	2.9	1	204.0	204	None	1.0
12	2.8	1	204.0	204	None	1.0
12	2.7	1	204.0	204	None	1.0
12	2.6	1	203.0	203	None	0.995098039216
12	2.5	1	203.0	203	None	0.995098039216
12	2.4	1	203.0	203	None	0.995098039216
12	2.3	1	202.0	202	None	0.990196078431
12	2.2	1	201.0	201	None	0.985294117647
12	2.1	1	201.0	201	None	0.985294117647
12	2.0	1	193.0	193	None	0.946078431373
12	1.9	1	183.0	183	None	0.897058823529
12	1.8	2	85.5	161	0.106958	0.838235294118
12	1.7	1	145.0	145	None	0.710784313725
12	1.6	1	129.0	129	None	0.632352941176
12	1.5	1	108.0	108	None	0.529411764706
12	1.4	1	64.0	64	None	0.313725490196
12	1.3	2	20.0	21	-0.269022	0.196078431373
12	1.2	1	12.0	12	None	0.0588235294118
12	1.1	1	12.0	12	None	0.0588235294118
12	1.0	1	12.0	12	None	0.0588235294118
12	0.9	0	None	None	None	None
12	0.8	0	None	None	None	None
12	0.7	0	None	None	None	None
12	0.6	0	None	None	None	None
12	0.5	0	None	None	None	None
12	0.4	0	None	None	None	None
12	0.3	0	None	None	None	None
12	0.2	0	None	None	None	None
12	0.1	0	None	None	None	None
11	5.0	1	204.0	204	None	1.0
11	4.9	1	204.0	204	None	1.0
11	4.8	1	204.0	204	None	1.0
11	4.7	1	204.0	204	None	1.0
11	4.6	1	204.0	204	None	1.0
11	4.5	1	204.0	204	None	1.0
11	4.4	1	204.0	204	None	1.0
11	4.3	1	204.0	204	None	1.0
11	4.2	1	204.0	204	None	1.0
11	4.1	1	204.0	204	None	1.0
11	4.0	1	204.0	204	None	1.0
11	3.9	1	204.0	204	None	1.0
11	3.8	1	204.0	204	None	1.0
11	3.7	1	204.0	204	None	1.0
11	3.6	1	204.0	204	None	1.0
11	3.5	1	204.0	204	None	1.0
11	3.4	1	204.0	204	None	1.0
11	3.3	1	204.0	204	None	1.0
11	3.2	1	204.0	204	None	1.0
11	3.1	1	204.0	204	None	1.0
11	3.0	1	204.0	204	None	1.0
11	2.9	1	204.0	204	None	1.0
11	2.8	1	204.0	204	None	1.0
11	2.7	1	204.0	204	None	1.0
11	2.6	1	204.0	204	None	1.0
11	2.5	1	203.0	203	None	0.995098039216
11	2.4	1	203.0	203	None	0.995098039216
11	2.3	1	203.0	203	None	0.995098039216
11	2.2	1	201.0	201	None	0.985294117647
11	2.1	1	201.0	201	None	0.985294117647
11	2.0	1	196.0	196	None	0.960784313725
11	1.9	1	184.0	184	None	0.901960784314
11	1.8	2	85.5	161	0.106958	0.838235294118
11	1.7	2	79.5	148	0.109607	0.779411764706
11	1.6	1	132.0	132	None	0.647058823529
11	1.5	1	113.0	113	None	0.553921568627
11	1.4	2	39.5	71	-0.128051	0.387254901961
11	1.3	1	57.0	57	None	0.279411764706
11	1.2	1	12.0	12	None	0.0588235294118
11	1.1	1	12.0	12	None	0.0588235294118
11	1.0	1	12.0	12	None	0.0588235294118
11	0.9	0	None	None	None	None
11	0.8	0	None	None	None	None
11	0.7	0	None	None	None	None
11	0.6	0	None	None	None	None
11	0.5	0	None	None	None	None
11	0.4	0	None	None	None	None
11	0.3	0	None	None	None	None
11	0.2	0	None	None	None	None
11	0.1	0	None	None	None	None
10	5.0	1	204.0	204	None	1.0
10	4.9	1	204.0	204	None	1.0
10	4.8	1	204.0	204	None	1.0
10	4.7	1	204.0	204	None	1.0
10	4.6	1	204.0	204	None	1.0
10	4.5	1	204.0	204	None	1.0
10	4.4	1	204.0	204	None	1.0
10	4.3	1	204.0	204	None	1.0
10	4.2	1	204.0	204	None	1.0
10	4.1	1	204.0	204	None	1.0
10	4.0	1	204.0	204	None	1.0
10	3.9	1	204.0	204	None	1.0
10	3.8	1	204.0	204	None	1.0
10	3.7	1	204.0	204	None	1.0
10	3.6	1	204.0	204	None	1.0
10	3.5	1	204.0	204	None	1.0
10	3.4	1	204.0	204	None	1.0
10	3.3	1	204.0	204	None	1.0
10	3.2	1	204.0	204	None	1.0
10	3.1	1	204.0	204	None	1.0
10	3.0	1	204.0	204	None	1.0
10	2.9	1	204.0	204	None	1.0
10	2.8	1	204.0	204	None	1.0
10	2.7	1	204.0	204	None	1.0
10	2.6	1	204.0	204	None	1.0
10	2.5	1	204.0	204	None	1.0
10	2.4	1	203.0	203	None	0.995098039216
10	2.3	1	203.0	203	None	0.995098039216
10	2.2	1	203.0	203	None	0.995098039216
10	2.1	1	203.0	203	None	0.995098039216
10	2.0	1	196.0	196	None	0.960784313725
10	1.9	1	186.0	186	None	0.911764705882
10	1.8	2	86.5	162	0.113161	0.848039215686
10	1.7	2	82.5	152	0.121123	0.808823529412
10	1.6	1	137.0	137	None	0.671568627451
10	1.5	1	117.0	117	None	0.573529411765
10	1.4	2	41.5	75	-0.114877	0.406862745098
10	1.3	2	37.5	66	-0.112561	0.367647058824
10	1.2	1	29.0	29	None	0.142156862745
10	1.1	1	12.0	12	None	0.0588235294118
10	1.0	1	12.0	12	None	0.0588235294118
10	0.9	0	None	None	None	None
10	0.8	0	None	None	None	None
10	0.7	0	None	None	None	None
10	0.6	0	None	None	None	None
10	0.5	0	None	None	None	None
10	0.4	0	None	None	None	None
10	0.3	0	None	None	None	None
10	0.2	0	None	None	None	None
10	0.1	0	None	None	None	None
9	5.0	1	204.0	204	None	1.0
9	4.9	1	204.0	204	None	1.0
9	4.8	1	204.0	204	None	1.0
9	4.7	1	204.0	204	None	1.0
9	4.6	1	204.0	204	None	1.0
9	4.5	1	204.0	204	None	1.0
9	4.4	1	204.0	204	None	1.0
9	4.3	1	204.0	204	None	1.0
9	4.2	1	204.0	204	None	1.0
9	4.1	1	204.0	204	None	1.0
9	4.0	1	204.0	204	None	1.0
9	3.9	1	204.0	204	None	1.0
9	3.8	1	204.0	204	None	1.0
9	3.7	1	204.0	204	None	1.0
9	3.6	1	204.0	204	None	1.0
9	3.5	1	204.0	204	None	1.0
9	3.4	1	204.0	204	None	1.0
9	3.3	1	204.0	204	None	1.0
9	3.2	1	204.0	204	None	1.0
9	3.1	1	204.0	204	None	1.0
9	3.0	1	204.0	204	None	1.0
9	2.9	1	204.0	204	None	1.0
9	2.8	1	204.0	204	None	1.0
9	2.7	1	204.0	204	None	1.0
9	2.6	1	204.0	204	None	1.0
9	2.5	1	204.0	204	None	1.0
9	2.4	1	203.0	203	None	0.995098039216
9	2.3	1	203.0	203	None	0.995098039216
9	2.2	1	203.0	203	None	0.995098039216
9	2.1	1	203.0	203	None	0.995098039216
9	2.0	1	196.0	196	None	0.960784313725
9	1.9	1	191.0	191	None	0.936274509804
9	1.8	1	176.0	176	None	0.862745098039
9	1.7	2	83.5	154	0.119167	0.81862745098
9	1.6	1	143.0	143	None	0.700980392157
9	1.5	1	127.0	127	None	0.622549019608
9	1.4	1	95.0	95	None	0.46568627451
9	1.3	2	39.5	71	-0.100118	0.387254901961
9	1.2	1	33.0	33	None	0.161764705882
9	1.1	1	18.0	18	None	0.0882352941176
9	1.0	1	12.0	12	None	0.0588235294118
9	0.9	0	None	None	None	None
9	0.8	0	None	None	None	None
9	0.7	0	None	None	None	None
9	0.6	0	None	None	None	None
9	0.5	0	None	None	None	None
9	0.4	0	None	None	None	None
9	0.3	0	None	None	None	None
9	0.2	0	None	None	None	None
9	0.1	0	None	None	None	None
8	5.0	1	204.0	204	None	1.0
8	4.9	1	204.0	204	None	1.0
8	4.8	1	204.0	204	None	1.0
8	4.7	1	204.0	204	None	1.0
8	4.6	1	204.0	204	None	1.0
8	4.5	1	204.0	204	None	1.0
8	4.4	1	204.0	204	None	1.0
8	4.3	1	204.0	204	None	1.0
8	4.2	1	204.0	204	None	1.0
8	4.1	1	204.0	204	None	1.0
8	4.0	1	204.0	204	None	1.0
8	3.9	1	204.0	204	None	1.0
8	3.8	1	204.0	204	None	1.0
8	3.7	1	204.0	204	None	1.0
8	3.6	1	204.0	204	None	1.0
8	3.5	1	204.0	204	None	1.0
8	3.4	1	204.0	204	None	1.0
8	3.3	1	204.0	204	None	1.0
8	3.2	1	204.0	204	None	1.0
8	3.1	1	204.0	204	None	1.0
8	3.0	1	204.0	204	None	1.0
8	2.9	1	204.0	204	None	1.0
8	2.8	1	204.0	204	None	1.0
8	2.7	1	204.0	204	None	1.0
8	2.6	1	204.0	204	None	1.0
8	2.5	1	204.0	204	None	1.0
8	2.4	1	203.0	203	None	0.995098039216
8	2.3	1	203.0	203	None	0.995098039216
8	2.2	1	203.0	203	None	0.995098039216
8	2.1	1	203.0	203	None	0.995098039216
8	2.0	1	197.0	197	None	0.96568627451
8	1.9	1	193.0	193	None	0.946078431373
8	1.8	1	182.0	182	None	0.892156862745
8	1.7	1	172.0	172	None	0.843137254902
8	1.6	2	79.0	151	-0.019889	0.774509803922
8	1.5	1	137.0	137	None	0.671568627451
8	1.4	2	56.5	107	0.00388932	0.553921568627
8	1.3	1	83.0	83	None	0.406862745098
8	1.2	4	17.5	49	-0.266358	0.343137254902
8	1.1	3	14.6666666667	30	-0.293284	0.21568627451
8	1.0	2	10.0	12	-0.307264	0.0980392156863
8	0.9	1	8.0	8	None	0.0392156862745
8	0.8	0	None	None	None	None
8	0.7	0	None	None	None	None
8	0.6	0	None	None	None	None
8	0.5	0	None	None	None	None
8	0.4	0	None	None	None	None
8	0.3	0	None	None	None	None
8	0.2	0	None	None	None	None
8	0.1	0	None	None	None	None
7	5.0	1	204.0	204	None	1.0
7	4.9	1	204.0	204	None	1.0
7	4.8	1	204.0	204	None	1.0
7	4.7	1	204.0	204	None	1.0
7	4.6	1	204.0	204	None	1.0
7	4.5	1	204.0	204	None	1.0
7	4.4	1	204.0	204	None	1.0
7	4.3	1	204.0	204	None	1.0
7	4.2	1	204.0	204	None	1.0
7	4.1	1	204.0	204	None	1.0
7	4.0	1	204.0	204	None	1.0
7	3.9	1	204.0	204	None	1.0
7	3.8	1	204.0	204	None	1.0
7	3.7	1	204.0	204	None	1.0
7	3.6	1	204.0	204	None	1.0
7	3.5	1	204.0	204	None	1.0
7	3.4	1	204.0	204	None	1.0
7	3.3	1	204.0	204	None	1.0
7	3.2	1	204.0	204	None	1.0
7	3.1	1	204.0	204	None	1.0
7	3.0	1	204.0	204	None	1.0
7	2.9	1	204.0	204	None	1.0
7	2.8	1	204.0	204	None	1.0
7	2.7	1	204.0	204	None	1.0
7	2.6	1	204.0	204	None	1.0
7	2.5	1	204.0	204	None	1.0
7	2.4	1	204.0	204	None	1.0
7	2.3	1	204.0	204	None	1.0
7	2.2	1	203.0	203	None	0.995098039216
7	2.1	1	203.0	203	None	0.995098039216
7	2.0	1	199.0	199	None	0.975490196078
7	1.9	1	194.0	194	None	0.950980392157
7	1.8	1	185.0	185	None	0.906862745098
7	1.7	1	175.0	175	None	0.857843137255
7	1.6	2	81.5	152	0.0888499	0.799019607843
7	1.5	2	75.0	143	0.0991925	0.735294117647
7	1.4	3	43.6666666667	120	0.0362889	0.642156862745
7	1.3	2	50.5	94	0.0433452	0.495098039216
7	1.2	5	15.8	51	-0.242184	0.387254901961
7	1.1	4	15.0	42	-0.299771	0.294117647059
7	1.0	3	12.3333333333	20	-0.265575	0.18137254902
7	0.9	2	7.5	8	-0.339109	0.0735294117647
7	0.8	1	7.0	7	None	0.0343137254902
7	0.7	0	None	None	None	None
7	0.6	0	None	None	None	None
7	0.5	0	None	None	None	None
7	0.4	0	None	None	None	None
7	0.3	0	None	None	None	None
7	0.2	0	None	None	None	None
7	0.1	0	None	None	None	None
6	5.0	1	204.0	204	None	1.0
6	4.9	1	204.0	204	None	1.0
6	4.8	1	204.0	204	None	1.0
6	4.7	1	204.0	204	None	1.0
6	4.6	1	204.0	204	None	1.0
6	4.5	1	204.0	204	None	1.0
6	4.4	1	204.0	204	None	1.0
6	4.3	1	204.0	204	None	1.0
6	4.2	1	204.0	204	None	1.0
6	4.1	1	204.0	204	None	1.0
6	4.0	1	204.0	204	None	1.0
6	3.9	1	204.0	204	None	1.0
6	3.8	1	204.0	204	None	1.0
6	3.7	1	204.0	204	None	1.0
6	3.6	1	204.0	204	None	1.0
6	3.5	1	204.0	204	None	1.0
6	3.4	1	204.0	204	None	1.0
6	3.3	1	204.0	204	None	1.0
6	3.2	1	204.0	204	None	1.0
6	3.1	1	204.0	204	None	1.0
6	3.0	1	204.0	204	None	1.0
6	2.9	1	204.0	204	None	1.0
6	2.8	1	204.0	204	None	1.0
6	2.7	1	204.0	204	None	1.0
6	2.6	1	204.0	204	None	1.0
6	2.5	1	204.0	204	None	1.0
6	2.4	1	204.0	204	None	1.0
6	2.3	1	204.0	204	None	1.0
6	2.2	1	204.0	204	None	1.0
6	2.1	1	204.0	204	None	1.0
6	2.0	1	200.0	200	None	0.980392156863
6	1.9	1	195.0	195	None	0.955882352941
6	1.8	1	188.0	188	None	0.921568627451
6	1.7	1	176.0	176	None	0.862745098039
6	1.6	1	164.0	164	None	0.803921568627
6	1.5	1	153.0	153	None	0.75
6	1.4	3	46.6666666667	127	0.076068	0.686274509804
6	1.3	3	37.0	98	0.0291509	0.544117647059
6	1.2	2	49.5	92	0.036861	0.485294117647
6	1.1	1	74.0	74	None	0.362745098039
6	1.0	5	11.4	26	-0.2796	0.279411764706
6	0.9	4	6.5	7	-0.375754	0.127450980392
6	0.8	4	6.0	7	-0.384505	0.117647058824
6	0.7	2	6.0	6	-0.321199	0.0588235294118
6	0.6	0	None	None	None	None
6	0.5	0	None	None	None	None
6	0.4	0	None	None	None	None
6	0.3	0	None	None	None	None
6	0.2	0	None	None	None	None
6	0.1	0	None	None	None	None
5	5.0	1	204.0	204	None	1.0
5	4.9	1	204.0	204	None	1.0
5	4.8	1	204.0	204	None	1.0
5	4.7	1	204.0	204	None	1.0
5	4.6	1	204.0	204	None	1.0
5	4.5	1	204.0	204	None	1.0
5	4.4	1	204.0	204	None	1.0
5	4.3	1	204.0	204	None	1.0
5	4.2	1	204.0	204	None	1.0
5	4.1	1	204.0	204	None	1.0
5	4.0	1	204.0	204	None	1.0
5	3.9	1	204.0	204	None	1.0
5	3.8	1	204.0	204	None	1.0
5	3.7	1	204.0	204	None	1.0
5	3.6	1	204.0	204	None	1.0
5	3.5	1	204.0	204	None	1.0
5	3.4	1	204.0	204	None	1.0
5	3.3	1	204.0	204	None	1.0
5	3.2	1	204.0	204	None	1.0
5	3.1	1	204.0	204	None	1.0
5	3.0	1	204.0	204	None	1.0
5	2.9	1	204.0	204	None	1.0
5	2.8	1	204.0	204	None	1.0
5	2.7	1	204.0	204	None	1.0
5	2.6	1	204.0	204	None	1.0
5	2.5	1	204.0	204	None	1.0
5	2.4	1	204.0	204	None	1.0
5	2.3	1	204.0	204	None	1.0
5	2.2	1	204.0	204	None	1.0
5	2.1	1	204.0	204	None	1.0
5	2.0	1	201.0	201	None	0.985294117647
5	1.9	1	196.0	196	None	0.960784313725
5	1.8	1	189.0	189	None	0.926470588235
5	1.7	1	182.0	182	None	0.892156862745
5	1.6	1	170.0	170	None	0.833333333333
5	1.5	1	156.0	156	None	0.764705882353
5	1.4	3	48.0	129	0.0516125	0.705882352941
5	1.3	3	42.0	110	0.0700907	0.617647058824
5	1.2	3	36.3333333333	97	0.0240432	0.53431372549
5	1.1	2	45.0	85	0.00729017	0.441176470588
5	1.0	2	36.5	68	-0.0235831	0.357843137255
5	0.9	7	7.42857142857	17	-0.320843	0.254901960784
5	0.8	5	6.0	7	-0.401458	0.147058823529
5	0.7	2	6.0	6	-0.321199	0.0588235294118
5	0.6	1	5.0	5	None	0.0245098039216
5	0.5	0	None	None	None	None
5	0.4	0	None	None	None	None
5	0.3	0	None	None	None	None
5	0.2	0	None	None	None	None
5	0.1	0	None	None	None	None
4	5.0	1	204.0	204	None	1.0
4	4.9	1	204.0	204	None	1.0
4	4.8	1	204.0	204	None	1.0
4	4.7	1	204.0	204	None	1.0
4	4.6	1	204.0	204	None	1.0
4	4.5	1	204.0	204	None	1.0
4	4.4	1	204.0	204	None	1.0
4	4.3	1	204.0	204	None	1.0
4	4.2	1	204.0	204	None	1.0
4	4.1	1	204.0	204	None	1.0
4	4.0	1	204.0	204	None	1.0
4	3.9	1	204.0	204	None	1.0
4	3.8	1	204.0	204	None	1.0
4	3.7	1	204.0	204	None	1.0
4	3.6	1	204.0	204	None	1.0
4	3.5	1	204.0	204	None	1.0
4	3.4	1	204.0	204	None	1.0
4	3.3	1	204.0	204	None	1.0
4	3.2	1	204.0	204	None	1.0
4	3.1	1	204.0	204	None	1.0
4	3.0	1	204.0	204	None	1.0
4	2.9	1	204.0	204	None	1.0
4	2.8	1	204.0	204	None	1.0
4	2.7	1	204.0	204	None	1.0
4	2.6	1	204.0	204	None	1.0
4	2.5	1	204.0	204	None	1.0
4	2.4	1	204.0	204	None	1.0
4	2.3	1	204.0	204	None	1.0
4	2.2	1	204.0	204	None	1.0
4	2.1	1	204.0	204	None	1.0
4	2.0	1	203.0	203	None	0.995098039216
4	1.9	1	202.0	202	None	0.990196078431
4	1.8	1	194.0	194	None	0.950980392157
4	1.7	1	186.0	186	None	0.911764705882
4	1.6	2	89.0	175	0.0476394	0.872549019608
4	1.5	2	82.0	160	0.098065	0.803921568627
4	1.4	3	51.3333333333	141	0.0892567	0.754901960784
4	1.3	5	29.2	115	0.0254885	0.71568627451
4	1.2	5	26.6	106	0.0102343	0.651960784314
4	1.1	7	16.8571428571	90	-0.118801	0.578431372549
4	1.0	6	16.1666666667	76	-0.118792	0.475490196078
4	0.9	9	8.11111111111	21	-0.225569	0.357843137255
4	0.8	7	7.0	17	-0.30804	0.240196078431
4	0.7	8	4.875	7	-0.396811	0.191176470588
4	0.6	3	4.33333333333	5	-0.355013	0.0637254901961
4	0.5	2	4.0	4	-0.401164	0.0392156862745
4	0.4	1	4.0	4	None	0.0196078431373
4	0.3	1	4.0	4	None	0.0196078431373
4	0.2	0	None	None	None	None
4	0.1	0	None	None	None	None
3	5.0	1	204.0	204	None	1.0
3	4.9	1	204.0	204	None	1.0
3	4.8	1	204.0	204	None	1.0
3	4.7	1	204.0	204	None	1.0
3	4.6	1	204.0	204	None	1.0
3	4.5	1	204.0	204	None	1.0
3	4.4	1	204.0	204	None	1.0
3	4.3	1	204.0	204	None	1.0
3	4.2	1	204.0	204	None	1.0
3	4.1	1	204.0	204	None	1.0
3	4.0	1	204.0	204	None	1.0
3	3.9	1	204.0	204	None	1.0
3	3.8	1	204.0	204	None	1.0
3	3.7	1	204.0	204	None	1.0
3	3.6	1	204.0	204	None	1.0
3	3.5	1	204.0	204	None	1.0
3	3.4	1	204.0	204	None	1.0
3	3.3	1	204.0	204	None	1.0
3	3.2	1	204.0	204	None	1.0
3	3.1	1	204.0	204	None	1.0
3	3.0	1	204.0	204	None	1.0
3	2.9	1	204.0	204	None	1.0
3	2.8	1	204.0	204	None	1.0
3	2.7	1	204.0	204	None	1.0
3	2.6	1	204.0	204	None	1.0
3	2.5	1	204.0	204	None	1.0
3	2.4	1	204.0	204	None	1.0
3	2.3	1	204.0	204	None	1.0
3	2.2	1	204.0	204	None	1.0
3	2.1	1	204.0	204	None	1.0
3	2.0	1	203.0	203	None	0.995098039216
3	1.9	1	202.0	202	None	0.990196078431
3	1.8	2	100.0	197	0.11344	0.980392156863
3	1.7	3	64.6666666667	188	0.0793604	0.950980392157
3	1.6	3	62.6666666667	182	0.0851904	0.921568627451
3	1.5	6	29.8333333333	162	-0.126654	0.877450980392
3	1.4	5	33.4	154	-0.121291	0.81862745098
3	1.3	5	30.4	128	-0.0660574	0.745098039216
3	1.2	7	20.5714285714	115	-0.163179	0.705882352941
3	1.1	11	12.3636363636	98	-0.247074	0.666666666667
3	1.0	12	10.4166666667	85	-0.202494	0.612745098039
3	0.9	16	6.5625	39	-0.248657	0.514705882353
3	0.8	16	5.375	25	-0.215693	0.421568627451
3	0.7	15	4.53333333333	11	-0.274454	0.333333333333
3	0.6	16	3.3125	6	-0.34319	0.259803921569
3	0.5	10	3.2	4	-0.407608	0.156862745098
3	0.4	5	3.2	4	-0.388553	0.078431372549
3	0.3	4	3.25	4	-0.388671	0.0637254901961
3	0.2	3	3.0	3	-0.404909	0.0441176470588
3	0.1	1	3.0	3	None	0.0147058823529
2	5.0	1	204.0	204	None	1.0
2	4.9	1	204.0	204	None	1.0
2	4.8	1	204.0	204	None	1.0
2	4.7	1	204.0	204	None	1.0
2	4.6	1	204.0	204	None	1.0
2	4.5	1	204.0	204	None	1.0
2	4.4	1	204.0	204	None	1.0
2	4.3	1	204.0	204	None	1.0
2	4.2	1	204.0	204	None	1.0
2	4.1	1	204.0	204	None	1.0
2	4.0	1	204.0	204	None	1.0
2	3.9	1	204.0	204	None	1.0
2	3.8	1	204.0	204	None	1.0
2	3.7	1	204.0	204	None	1.0
2	3.6	1	204.0	204	None	1.0
2	3.5	1	204.0	204	None	1.0
2	3.4	1	204.0	204	None	1.0
2	3.3	1	204.0	204	None	1.0
2	3.2	1	204.0	204	None	1.0
2	3.1	1	204.0	204	None	1.0
2	3.0	1	204.0	204	None	1.0
2	2.9	1	204.0	204	None	1.0
2	2.8	1	204.0	204	None	1.0
2	2.7	1	204.0	204	None	1.0
2	2.6	1	204.0	204	None	1.0
2	2.5	1	204.0	204	None	1.0
2	2.4	1	204.0	204	None	1.0
2	2.3	1	204.0	204	None	1.0
2	2.2	1	204.0	204	None	1.0
2	2.1	1	204.0	204	None	1.0
2	2.0	1	203.0	203	None	0.995098039216
2	1.9	1	202.0	202	None	0.990196078431
2	1.8	2	100.0	197	0.11344	0.980392156863
2	1.7	4	49.0	188	0.0509549	0.960784313725
2	1.6	5	38.4	182	0.00435836	0.941176470588
2	1.5	10	18.7	162	-0.163006	0.916666666667
2	1.4	10	17.7	154	-0.161434	0.867647058824
2	1.3	14	12.1428571429	128	-0.267055	0.833333333333
2	1.2	16	10.125	115	-0.251674	0.794117647059
2	1.1	20	7.7	98	-0.233955	0.754901960784
2	1.0	22	6.59090909091	85	-0.210341	0.710784313725
2	0.9	30	4.43333333333	39	-0.191802	0.651960784314
2	0.8	32	3.6875	25	-0.134329	0.578431372549
2	0.7	36	3.05555555556	11	-0.111275	0.539215686275
2	0.6	37	2.56756756757	6	-0.110446	0.46568627451
2	0.5	37	2.32432432432	4	-0.124884	0.421568627451
2	0.4	26	2.23076923077	4	-0.289337	0.28431372549
2	0.3	19	2.26315789474	4	-0.382214	0.210784313725
2	0.2	11	2.27272727273	3	-0.465335	0.122549019608
2	0.1	6	2.16666666667	3	-0.431017	0.0637254901961

In [ ]: