Skip to content

Instantly share code, notes, and snippets.


Beatriz Albiero beatrizalbiero

View GitHub Profile
beatrizalbiero / bigrams_latex.tex
Last active Aug 20, 2019
latex equations for bigrams language model
View bigrams_latex.tex
P(t|t_{1}^{n-1}) \approx P(t|t_{n-1})
P(t_n|w_{t-1}) = \frac{C(t_{n-1}t_n)}{C(t_{n-1})}
beatrizalbiero / chain_rule_of_probability.tex
Last active Aug 19, 2019
The Chain Rule of Probability in Latex
View chain_rule_of_probability.tex
P(X_1, X_2, \cdots, X_n) = P(X_1)\cdot P(X_2|X_1)\cdot P(X_3|X_1, X_2) \cdots P(X_n|X_{n-1}, X_{n-2}, \cdots, X_1) =\notag\\
\prod_{k=1}^{n} P(X_{k}|X_{1}^{k-1})
beatrizalbiero /
Created Dec 27, 2017
copy first column to last colum of a csv file
def readCSV(filename):
f = open(filename,"r")
y = open('saida.csv',"w")
for row in f:
treat = row.strip("\n").strip("\r")+';\n'
new_list = treat.split(';') #str to list
new_list[-1] = new_list[0]
new_string = ''
for i in range(0,len(new_list)-1):
new_string = new_string + new_list[i] + ';'