{"id":21582421,"url":"https://github.com/ruanchaves/hdp","last_synced_at":"2026-04-27T08:31:17.867Z","repository":{"id":112176249,"uuid":"142460370","full_name":"ruanchaves/hdp","owner":"ruanchaves","description":"HDP + T-SNE + k-NN applied to topic modeling","archived":false,"fork":false,"pushed_at":"2018-11-15T15:18:15.000Z","size":1872,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T22:05:33.969Z","etag":null,"topics":["clustering","colorization","gensim","hdp","knn","lda","python","tsne-algorithm","tsne-plot"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruanchaves.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-07-26T15:32:54.000Z","updated_at":"2019-06-13T14:45:47.000Z","dependencies_parsed_at":"2023-05-10T23:30:21.552Z","dependency_job_id":null,"html_url":"https://github.com/ruanchaves/hdp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ruanchaves/hdp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanchaves%2Fhdp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanchaves%2Fhdp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanchaves%2Fhdp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanchaves%2Fhdp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruanchaves","download_url":"https://codeload.github.com/ruanchaves/hdp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanchaves%2Fhdp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32329462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["clustering","colorization","gensim","hdp","knn","lda","python","tsne-algorithm","tsne-plot"],"created_at":"2024-11-24T14:15:47.830Z","updated_at":"2026-04-27T08:31:17.810Z","avatar_url":"https://github.com/ruanchaves.png","language":"Jupyter Notebook","readme":"## HDP clusters\n\nHere is the output of t-distributed Stochastic Neighbor Embedding dimensionality reduction applied to 90-dimensional topic vectors produced by [gensim's Hierarchical Dirichlet Process](https://radimrehurek.com/gensim/models/hdpmodel.html). t-SNE is applied twice, once for 90-dimensions to 2D and once for 90-dimensions to 3D. 2D results are interpreted as x,y-coordinates and 3D results are interpreted as colors. Although a human can certainly see the clusters, a computer only knows colored x,y-points so it can't deliver the clusters upon request.\n\n![](https://i.imgur.com/3Zgeqqa.png)\n\nI solved this problem by applying k-nearest neighbors algorithm to the t-SNE result, and after kNN I deleted edges between vertices which had different colors according to a certain degree of tolerance. Then I looked for connected components and I repainted the points according to which connected component they belonged to.\n\n![](https://i.imgur.com/SYz8O0S.png)\n\nHere are the connected components when the tolerance is a little bit lower.\n\n![](https://i.imgur.com/eI8IyhS.png)\n\nHere are the connected components when the tolerance is even lower.\n\n![](https://i.imgur.com/eoIApzU.png)\n\nThis means our users won't have to directly deal with this map. When they request a certain document, they'll get a list of similar documents, that is, a list of points sorted according to their distance from the chosen point. And then they'll be able to select cluster colors ( topic categories ) to filter out the results.\n\n## Related sources\n\n[Topic Modeling and t-SNE Visualization](https://shuaiw.github.io/2016/12/22/topic-modeling-and-tsne-visualzation.html)\n\n[Plot Latent Dirichlet Allocation output using t-SNE?](https://stats.stackexchange.com/questions/305356/plot-latent-dirichlet-allocation-output-using-t-sne)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanchaves%2Fhdp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruanchaves%2Fhdp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanchaves%2Fhdp/lists"}