This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from gensim.sklearn_api import LdaTransformer | |
from gensim.corpora import Dictionary | |
from sklearn.base import BaseEstimator, MetaEstimatorMixin | |
import re | |
from sklearn.pipeline import Pipeline | |
from sklearn.feature_extraction.text import CountVectorizer | |
from collections import defaultdict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Because Seaborn doesn't allow custom formatting for annotations, you have to do this crazy workaround to access the text: | |
def formatFloat(fmt, val): | |
ret = fmt % val | |
if ret.startswith("0."): | |
return ret[1:] | |
if ret.startswith("-0."): | |
return "-" + ret[2:] | |
return ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//so far, this opens a new page and embeds the video in this page. | |
javascript: | |
window.open().document.write( | |
'<iframe id = \"video\" title=\"YouTube video player\" class=\"youtube-player\" type=\"text/html\"' + | |
'width=\"560 \" height=\"315\" src=\"http://www.youtube.com/embed/ | |
' + location.search.split(/=/)[1] + '\"' + | |
'frameborder=\"0\" allowFullScreen></iframe>') |