Skip to content

Instantly share code, notes, and snippets.

@ululh
ululh / LDApredict.py
Last active February 1, 2023 09:32
LDA (Latent Dirichlet Allocation) predicting with python scikit-learn
# derived from http://scikit-learn.org/stable/auto_examples/applications/topics_extraction_with_nmf_lda.html
# explanations are located there : https://www.linkedin.com/pulse/dissociating-training-predicting-latent-dirichlet-lucien-tardres
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import LatentDirichletAllocation
import pickle
# create a blank model
lda = LatentDirichletAllocation()
@ululh
ululh / LDAfit.py
Last active May 22, 2021 01:27
LDA (Latent Dirichlet Allocation) fitting with python scikit-learn
# derived from http://scikit-learn.org/stable/auto_examples/applications/topics_extraction_with_nmf_lda.html
# explanations are located there : https://www.linkedin.com/pulse/dissociating-training-predicting-latent-dirichlet-lucien-tardres
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import LatentDirichletAllocation
import pickle
n_features = 50
n_topics = 2
@ululh
ululh / index.html
Last active May 15, 2016 10:18 — forked from nautat/index.html
Nested tables from json
<!DOCTYPE html>
<meta charset="utf-8">
<style type="text/css">
table {
font-family: "Helvetica", "Lucida Sans", "Lucida Sans Unicode", "Luxi Sans", Tahoma, sans-serif;
box-shadow: 1px 1px 10px rgba(0,0,0,0.5);
border-collapse: collapse;
border-spacing: 0;
}
table {