GithubHelp home page GithubHelp logo

jizhihang / lda-matlab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kyamagu/lda-matlab

0.0 2.0 0.0 48 KB

Latent Dirichlet Allocation for Matlab

License: GNU Lesser General Public License v2.1

MATLAB 6.01% Makefile 1.02% C++ 56.87% C 36.10%

lda-matlab's Introduction

Latent Dirichlet Allocation for Matlab

This is a Matlab version of the David Blei's original implementation of Latent Dirichlet Allocation written in C.

http://www.cs.columbia.edu/~blei/lda-c/

The package includes a few API functions that internally calls the original C implementation by mex interface.

Compile the code with lda.make function in Matlab before using the package. Here is a quick usage example:

corpus = lda.load_corpus('ap/ap.dat');
[model, distribution] = lda.estimate(corpus, 'seeded', ...
                                     'num_topics', 100, ...
                                     'initial_alpha', 0.05);
distribution = lda.infer(corpus, model);

The corpus is sparse row vectors of word count. corpus(d, w) is a count of word w in document d. The resulting distribution contains row vectors of topic weights for each document at each row.

The same example is in the main.m demo function.

API

All functions are scoped under lda namespace.

estimate     Run the EM algorithm to estimate topics and distribution.
infer        Run inference on new samples using a learned LDA model.
load_corpus  Load dataset in lda-c file format into a sparse matrix.
save_corpus  Save dataset in lda-c file format from a sparse matrix.
make         Build a mex file.

Check help of each function for details.

License

The code may be redistributed under LGPL v2.1 license.

lda-matlab's People

Contributors

jordanbcs avatar kyamagu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.