{"id":44689713,"url":"https://github.com/lejon/T-SNE-Java","last_synced_at":"2026-02-27T19:01:21.157Z","repository":{"id":24852026,"uuid":"28267144","full_name":"lejon/T-SNE-Java","owner":"lejon","description":"Pure Java implementation of Van Der Maaten and Hinton's t-sne clustering algorithm","archived":false,"fork":false,"pushed_at":"2023-02-23T16:44:53.000Z","size":2206,"stargazers_count":199,"open_issues_count":7,"forks_count":62,"subscribers_count":19,"default_branch":"master","last_synced_at":"2026-02-01T10:38:41.526Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/lejon.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}},"created_at":"2014-12-20T13:00:28.000Z","updated_at":"2025-12-25T10:50:33.000Z","dependencies_parsed_at":"2022-08-23T06:01:28.051Z","dependency_job_id":"a260fea1-1ef0-498a-a888-239fe2f48bec","html_url":"https://github.com/lejon/T-SNE-Java","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/lejon/T-SNE-Java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lejon%2FT-SNE-Java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lejon%2FT-SNE-Java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lejon%2FT-SNE-Java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lejon%2FT-SNE-Java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lejon","download_url":"https://codeload.github.com/lejon/T-SNE-Java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lejon%2FT-SNE-Java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29909252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T17:28:36.873Z","status":"ssl_error","status_checked_at":"2026-02-27T17:28:20.970Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-02-15T07:00:30.140Z","updated_at":"2026-02-27T19:01:21.151Z","avatar_url":"https://github.com/lejon.png","language":"Java","funding_links":[],"categories":["人工智能"],"sub_categories":["机器学习"],"readme":"[![Build Status](https://travis-ci.org/lejon/T-SNE-Java.svg?branch=master)](https://travis-ci.org/lejon/T-SNE-Java)\n\n![YourKit](https://www.yourkit.com/images/yklogo.png)\n\nT-SNE-Java\n==========\n\nAbout\n=====\n\nPure Java implementation of Van Der Maaten and Hinton's t-SNE clustering algorithm.\n\n*T-SNE-Java supports __Barnes Hut__ which makes it possible to run the amazing t-SNE on much larger data sets (or much faster on small data sets:) )!*\n\nThe Barnes Hut version can also be run in parallel! We have seen from 40 % performance improvements on moderate datasets (ca 10 000 samples) to 100 % improvements on larger datasets (MNIST 60000 samples) compared to standard Barnes Hut.\n\nThe t-SNE part of running the parallel Barnes Hut t-SNE on MNIST 60000 takes 18.3 minutes on a 2013 Macbook Pro (theta=0.5, perplexity = 50, 1000 iterations)\n\nBoth standard and parallel Barnes Hut is of course magnitudes faster than vanilla t-SNE. \n\nGreat research by Dr. Maaten!!\n\nThis project is divided into two separate Maven projects, one for the core t-SNE and one for the demos (stand-alone executables that can be run from command line).\n\n\nBasic command line usage\n------------------------\n\nIf you just want to use TSne as a command line tool, you should use BarnesHutTSneCsv for the \nBarnes Hut version or TSneCsv for the classic version. \n\nYou must then first build and install 'tsne' and  'tsne-demos' (mvn install).\nThen use the tsne-demos JAR you just build according to the examples below. \n\nYou can also download the pre-build binary JAR from the release page.\n\nExamples:\n\nRun TSne on file without headers and no labels.\n```shell\njava -jar target/tsne-demos-2.4.0.jar -nohdr -nolbls src/main/resources/datasets/iris_X.txt \n```\nRun TSne on CSV file with headers and label column nr. 5.\n```shell\njava -jar target/tsne-demos-2.4.0.jar --lblcolno 5 src/main/resources/datasets/iris.csv\n```\nRun TSne on file without headers and no labels but supply a separate label file (with the same ordering as the data file).\n```shell\njava -jar target/tsne-demos-2.4.0.jar --nohdr --nolbls --label_file=src/main/resources/datasets/iris_X_labels.txt src/main/resources/datasets/iris_X.txt\n```\n\nSame as above but using parallelization.\n```shell\njava -jar target/tsne-demos-2.4.0.jar --parallel --nohdr --nolbls --label_file=src/main/resources/datasets/iris_X_labels.txt src/main/resources/datasets/iris_X.txt\n```\n\n\nAborting BarnesHutTSneCsv\n-------------------------\nThe BarnesHutTSneCsv program now supports aborting gracefully. \n\nIf the output is monitored and it is concluded that the process has converged, the BarnesHutTSneCsv process can be stopped with a graceful exit by sending the process an interrupt signal.\n\n```shell\nkill -2 \u003cPID\u003e\n```\n\nThe program now exits and produces the same output as usual except for the plot which must be done manually.\n\nExample graph of the MNIST data set (60000 samples) generated with Barnes Hut implementation of t-SNE:\n\n![image of MNIST clusters](https://raw.githubusercontent.com/lejon/T-SNE-Java/master/images/mnist-full.png \"MNIST (60000 samples)\")\n\nFor some tips working with t-sne [Klick here] (http://lejon.github.io) or [here] (https://lvdmaaten.github.io/tsne/#faq) (observe that the last link discusses some implementation details of Laurens implementation of t-SNE and not this Java version, but also some general tips and tricks which applies to t-SNE in general) .\n\nTo use the Barnes Hut version (recommended):\n--------------------------------------------\n\n```java\nimport java.io.File;\n\nimport com.jujutsu.tsne.barneshut.BHTSne;\nimport com.jujutsu.tsne.barneshut.BarnesHutTSne;\nimport com.jujutsu.tsne.barneshut.ParallelBHTsne;\nimport com.jujutsu.utils.MatrixOps;\nimport com.jujutsu.utils.MatrixUtils;\nimport com.jujutsu.utils.TSneUtils;\n\npublic class TSneTest {\n  public static void main(String [] args) {\n    int initial_dims = 55;\n    double perplexity = 20.0;\n    double [][] X = MatrixUtils.simpleRead2DMatrix(new File(\"src/main/resources/datasets/mnist2500_X.txt\"), \"   \");\n    System.out.println(MatrixOps.doubleArrayToPrintString(X, \", \", 50,10));\n    BarnesHutTSne tsne;\n    boolean parallel = false;\n\tif(parallel) {\t\t\t\n\t\ttsne = new ParallelBHTsne();\n\t} else {\n\t\ttsne = new BHTSne();\n\t}\n        TSneConfiguration config = TSneUtils.buildConfig(X, 2, initial_dims, perplexity, 1000);\n\tdouble [][] Y = tsne.tsne(config); \n    \n    // Plot Y or save Y to file and plot with some other tool such as for instance R\n  }\n}\n```\n\nUsage using Jitpack\n-------------------\n\nT-SNE-Java is not on Maven Central, however you can use it through Jitpack by adding the following lines to you POM file.\n\n```xml\n\u003crepositories\u003e\n\u003crepository\u003e\n    \u003cid\u003ejitpack.io\u003c/id\u003e\n    \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n\u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.User\u003c/groupId\u003e\n    \u003cartifactId\u003eRepo\u003c/artifactId\u003e\n    \u003cversion\u003eTag\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nVersion\n-------\nDemo: 2.5.1\nCore: 2.6.2\n\nAcknowledgements\n----------------\nI'm a very satisfied user of the YourKit profiler. A Great product with great support. It has been sucessfully used for profiling in this project.\n\n![YourKit](https://www.yourkit.com/images/yklogo.png)\n\nYourKit supports open source projects with its full-featured Java Profiler.\nYourKit, LLC is the creator of [YourKit Java Profiler](https://www.yourkit.com/java/profiler/)\nand [YourKit .NET Profiler](https://www.yourkit.com/.net/profiler/),\ninnovative and intelligent tools for profiling Java and .NET applications.\n\nEnjoy!\n-Leif\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flejon%2FT-SNE-Java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flejon%2FT-SNE-Java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flejon%2FT-SNE-Java/lists"}