Skip to content

Instantly share code, notes, and snippets.

@cbganap
cbganap / nmf_cd.py
Created October 30, 2018 20:10 — forked from mblondel/nmf_cd.py
NMF by coordinate descent
"""
NMF by coordinate descent, designed for sparse data (without missing values)
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
import numba
@cbganap
cbganap / lda_gibbs.py
Created October 30, 2018 20:09 — forked from mblondel/lda_gibbs.py
Latent Dirichlet Allocation with Gibbs sampler
"""
(C) Mathieu Blondel - 2010
License: BSD 3 clause
Implementation of the collapsed Gibbs sampler for
Latent Dirichlet Allocation, as described in
Finding scientifc topics (Griffiths and Steyvers)
"""