- machine-learning: 5881 (vs machine-learning: 1281812819 on CV)
- python python: 3219 (vs python: 25312529 on CV)
- neural-network: 2511 (vs neural-networks: 47094711 on CV)
- deep-learning deep-learning: 23372338 (vs deep-learning: 2077 on CV)
- classification: 1623 (vs classification: 4859 on CV)
- keras keras: 1385 (doesn't exist?)
- scikit-learn: 1084 (vs scikit-learn: 1133 on CV)
- r: 10121011 (vs r: 2039220394 on CV)
- tensorflow tensorflow: 997 (doesn't exist?)
- nlp nlp: 954 (doesn't exist?)
- r r: 2039220394 (vs r: 10121011 on CVDS)
- regression regression: 1872618727 (vs regression: 726 on CVDS)
- machine-learning: 1281812819 (vs machine-learning: 5881 on CVDS)
- time-series time-series: 9621 (vs time-series: 835 on CVDS)
- probability probability: 7606 (vs probability: 159 on CVDS)
- hypothesis-testing hypothesis-testing: 6468 (doesn't exist?)
- distributions distributions: 62106212 (doesn't exist?)
- self-study: 6171 (doesn't exist?)
- logistic: 5170 (doesn't exist?)
- bayesian: 50475048 (doesn't exist?)
import requests
def get_api_result(uri):
resp = requests.get(uri)
return resp.json()
def get_toplist(ds, other, ds_tags, cv_tag_dict):
ds2cv_tagname = {"neural-network": "neural-networks"}
print(f"Top tags of {ds}")
for i, tag in enumerate(ds_tags["items"], start=1):
new_tagname = ds2cv_tagname.get(tag['name'], tag['name'])
tag_cv = cv_tag_dict.get(new_tagname, None)
if tag_cv is None:
vs_string = "doesn't exist?"
else:
vs_string = f"vs {new_tagname}: {tag_cv} on CV"{other}"
print(f"{i}. {tag['name']}: {tag['count']} ({vs_string})")
if i == 10:
break
base = "https://api.stackexchange.com/2.2"
fstring = "{base}/tags?page=1&pagesize=100&order=desc&sort=popular&site={site}"
ds_tags = get_api_result(fstring.format(base=base, site="datascience"))
cv_tags = get_api_result(fstring.format(base=base, site="stats"))
ds_tag_dict = {tag['name']: tag['count'] for tag in ds_tags['items']}
cv_tag_dict = {tag['name']: tag['count'] for tag in cv_tags['items']}
get_toplist(ds="DS", other="CV", ds_tags=ds_tags, cv_tag_dict=cv_tag_dict)
get_toplist(ds="CV", other="DS", ds_tags=cv_tags, cv_tag_dict=ds_tag_dict)