Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View beatrizalbiero's full-sized avatar
😁

Beatriz Albiero beatrizalbiero

😁
View GitHub Profile
@beatrizalbiero
beatrizalbiero / bigrams_latex.tex
Last active August 20, 2019 00:23
latex equations for bigrams language model
\begin{equation}
\label{eq:bigramsp}
P(t|t_{1}^{n-1}) \approx P(t|t_{n-1})
\end{equation}
\begin{equation}
\label{eq:brigrams}
P(t_n|w_{t-1}) = \frac{C(t_{n-1}t_n)}{C(t_{n-1})}
\end{equation}
@beatrizalbiero
beatrizalbiero / chain_rule_of_probability.tex
Last active August 19, 2019 18:56
The Chain Rule of Probability in Latex
\begin{equation}
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\\
\end{equation}
\begin{equation}
\prod_{k=1}^{n} P(X_{k}|X_{1}^{k-1})
\end{equation}
@beatrizalbiero
beatrizalbiero / treatcsv.py
Created December 27, 2017 18:19
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] + ';'