Skip to content

Instantly share code, notes, and snippets.

View sarahmul's full-sized avatar

Sarah Mullin sarahmul

View GitHub Profile
@shubham0704
shubham0704 / entity_embeddings.md
Last active October 31, 2018 20:37
Some Use Cases of Entity Embeddings

Entity Embeddings

Usage

Entity embeddings are used to map categorial variables into eucledian space. Works particularly well with features with high cardinality. i.e the categorial variable would be having a lot of discrete values.

How it works

INPUT- TABULAR DATA -> ||| ALGORITHM ||| -> OUTPUT - ENTITY EMBEDDINGS

Algorithm -

@eeddaann
eeddaann / sir_python
Last active July 14, 2021 22:12
sir model with age groups implemented in python
#!/usr/bin/env python
import numpy as np
from pylab import *
import scipy.integrate as spi
#Parameter Values
PopIn= {'g1s_young':1/12,'g1i_young':1/12,'g1r_young':1/12,'g1s_mid':1/12,'g1i_mid':1/12,'g1r_mid':1/12,'g1s_old':1/12,'g1i_old':1/12,'g1r_old':1/12,'g1s_vold':1/12,'g1i_vold':1/12,'g1r_vold':1/12}
arr = [1/12]*12
beta= 0.50
import tensorflow as tf
import numpy as np
corpus_raw = 'He is the king . The king is royal . She is the royal queen '
# convert to lower case
corpus_raw = corpus_raw.lower()
words = []
for word in corpus_raw.split():
@bxshi
bxshi / Hits_at_K_TensorFlow.py
Created January 12, 2017 21:34
Implement Hits@K evaluation metric for Knowledge Graph Completion tasks.
import tensorflow as tf
with tf.Session() as sess:
"""
idx (h,r) top_3
[ [
[0,1], [0,8,3],
[1,3], [7,2,1],
[2,4], [4,3,9],
] ]
@hubgit
hubgit / pmc-open-access-eutils.txt
Last active June 3, 2019 14:26
Useful URLs for working with the PMC Open Access Subset via EUtils
Search PubMed for articles in the PMC Open Access Subset for which free full text (i.e. XML) is available:
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&retmode=xml&term=pubmed+pmc+open+access%5Bfilter%5D+AND+free+full+text%5Bfilter%5D
Find the PMCID for an article by PMID:
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&db=pmc&retmode=xml&linkname=pubmed_pmc&id=24191168
Fetch full text article XML from PMC by PMCID:
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pmc&id=3804407
A PMC article for which the full text XML is not available: