-
Notifications
You must be signed in to change notification settings - Fork 0
/
sb.py
84 lines (59 loc) · 1.45 KB
/
sb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#%%
import pandas as pd
import matplotlib.pyplot as plt
#%%
comp_df = pd.read_csv('all_tests_together.csv')
#%%
# what's the mean value of difference in all Wikipedia tests
x = comp_df[
(comp_df.column.str.contains('wikipedia')) &
(comp_df.category != 'all')
]
x[(comp_df.column.str.contains('results_full'))].add_inc.describe()
#x[(comp_df.column.str.contains('results_full'))]
#%%
x[(comp_df.column.str.contains('results_top_three'))].add_inc.describe()
#%%
#%%
ugc_mask = (comp_df.column.str.contains('wikipedia'))
for phrase in [
'wikipedia', 'yelp', 'tripadvisor', 'facebook',
'twitter', 'instagram', 'youtube', 'linkedin',
]:
ugc_mask = ugc_mask | (comp_df.column.str.contains(phrase))
#%%
ugc = comp_df[ugc_mask]
ugc[ugc.fisher_pval < 0.05]
#len(ugc[ugc.fisher_pval < 0.05])
#%%
len(ugc[ugc.fisher_pval < 0.05])
#%%
ugc[ugc.fisher_pval < 0.05]
#%%
comp_df[ugc_mask].add_inc.describe()
# comp_df[ugc_mask].category.value_counts()
# comp_df[ugc_mask]
#%%
comp_df[ugc_mask & (comp_df.category == 'popular')].comparison.value_counts()
#%%
df = pd.read_csv('importance_df.csv')
df.head()
#%%
full_appears = df[
(df.metric == 'domain_maps') & (df.subset == 'full')
]
len(full_appears)
#%%
set(full_appears.domain.value_counts())
#%%
#%%
top3_appears = df[
(df.metric == 'domain_appears') & (df.subset == 'top_three')
]
len(top3_appears)
#%%
set(top3_appears.domain.value_counts())
#%%
df.link_type.value_counts()
len(df)
#%%