{"id":13696657,"url":"https://github.com/Savvysherpa/slda","last_synced_at":"2025-05-03T17:31:49.765Z","repository":{"id":57468304,"uuid":"61390138","full_name":"Savvysherpa/slda","owner":"Savvysherpa","description":"Cython implementations of Gibbs sampling for supervised LDA","archived":false,"fork":false,"pushed_at":"2017-10-09T17:40:16.000Z","size":1802,"stargazers_count":61,"open_issues_count":7,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-03T01:21:07.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Savvysherpa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-17T17:19:01.000Z","updated_at":"2024-05-07T05:15:17.000Z","dependencies_parsed_at":"2022-09-19T08:20:48.139Z","dependency_job_id":null,"html_url":"https://github.com/Savvysherpa/slda","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Savvysherpa%2Fslda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Savvysherpa%2Fslda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Savvysherpa%2Fslda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Savvysherpa%2Fslda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Savvysherpa","download_url":"https://codeload.github.com/Savvysherpa/slda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224369663,"owners_count":17299936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T18:00:44.310Z","updated_at":"2024-11-13T00:30:46.279Z","avatar_url":"https://github.com/Savvysherpa.png","language":"Python","funding_links":[],"categories":["Models"],"sub_categories":["Supervised LDA (sLDA) [:page_facing_up:](https://papers.nips.cc/paper/2007/file/d56b9fc4b0f1be8871f5e1c40c0067e7-Paper.pdf)"],"readme":"# slda\nThis repository contains [Cython](http://cython.org/) implementations of [Gibbs\nsampling](https://en.wikipedia.org/wiki/Gibbs_sampling) for [latent Dirichlet\nallocation](https://en.wikipedia.org/wiki/Latent_Dirichlet_allocation) and\nvarious supervised LDAs:\n\n- supervised LDA (linear regression)\n- binary logistic supervised LDA (logistic regression)\n- binary logistic hierarchical supervised LDA (trees)\n- generalized relational topic models (graphs)\n\n[![Build Status](https://travis-ci.org/Savvysherpa/slda.png)](https://travis-ci.org/Savvysherpa/slda)\n\n## Installation\n\n### The easy way\nUse the conda-forge version [here](https://github.com/conda-forge/slda-feedstock).\n\n### The hard way...\n(Kept for posterity's sake.)\n\n### Dependencies\n\n#### GNU Scientific Library\nThis module depends on [GSL](http://www.gnu.org/software/gsl/), please install\nit. For macosx users using [homebrew](http://brew.sh/), this is as simple as\n```bash\n$ brew install gsl\n```\n\n#### pypolyagamma-3 and gcc\nThis package depends on [pypolyagamma-3](https://github.com/Savvysherpa/pypolyagamma),\nwhich is a bit of a pain because `pypolyagamma-3` requies a C/C++ compiler with\n[OpenMP](http://openmp.org/) support. Unfortunately for macosx users, Apple's native\ncompiler, clang, does not ship with that support, so you need to install and\nuse one that does. For macosx users using [homebrew](http://brew.sh/),\nthis is as simple as:\n ```bash\n $ brew install gcc --without-multilib\n ```\nThis will install a version of `gcc` with OpenMP support. However, Apple makes\nthings worse by aliasing gcc to point to clang! So you need to explicitly tell\nthe shell which gcc compiler to use. As of the writing of this README, brew\ninstalls major version 6 of gcc, and as a result will create a binary called\ngcc-6 in your path. So export the following to your shell\n ```bash\n $ export CC=gcc-6 CXX=g++-6\n ```\nor you can prefix the commands below with `CC=gcc-6 CXX=g++-6`.\n\nAs a result of this export, it may turn out that your shell cannot find the\nlibraries associated with gcc. If this is the case, specify the path to your gcc\nlibrary in the environment variable `DYLD_LIBRARY_PATH`. For example, if\nyou used `brew` to install gcc as above, then this is probably the right thing\nto do:\n```bash\n$ export DYLD_LIBRARY_PATH=/usr/local/Cellar/gcc/6.1.0/lib/gcc/6/\n```\n\n### Instructions\n\n#### Conda environment\n\nFirst create the conda environment by running\n ```bash\n $ conda env create\n ```\nThis will install a conda environment called `slda`, defined in\n`environment.yml`, that contains all the dependencies. Activate it by running\n ```bash\n $ source activate slda\n ```\nNext we need to compile the C code in this repository. To do this, run\n```bash\n$ python setup.py build_ext --inplace\n```\n\n#### pip install slda\n\nIf you want slda installed in your environment, run:\n```bash\n$ pip install .\n```\n\n## Tests\n\nTo run the tests, run\n```bash\n$ py.test slda\n```\nThis may take as long as 15 minutes, so be patient.\n\n## License\n\nThis code is open source under the MIT license.\n\nMany thanks to [Allen Riddell](https://github.com/ariddell) and his [LDA\nlibrary](https://github.com/ariddell/lda) for inspiration (and code :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSavvysherpa%2Fslda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSavvysherpa%2Fslda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSavvysherpa%2Fslda/lists"}