{"id":18832093,"url":"https://github.com/davidsoergel/jlibsvm","last_synced_at":"2025-08-20T21:24:43.474Z","repository":{"id":11669138,"uuid":"14178265","full_name":"davidsoergel/jlibsvm","owner":"davidsoergel","description":"Efficient training of Support Vector Machines in Java","archived":false,"fork":false,"pushed_at":"2020-02-11T04:54:24.000Z","size":59098,"stargazers_count":117,"open_issues_count":15,"forks_count":60,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-03-27T18:21:22.232Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidsoergel.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}},"created_at":"2013-11-06T16:30:49.000Z","updated_at":"2024-06-14T21:37:21.000Z","dependencies_parsed_at":"2022-07-14T02:50:31.487Z","dependency_job_id":null,"html_url":"https://github.com/davidsoergel/jlibsvm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidsoergel%2Fjlibsvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidsoergel%2Fjlibsvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidsoergel%2Fjlibsvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidsoergel%2Fjlibsvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidsoergel","download_url":"https://codeload.github.com/davidsoergel/jlibsvm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248820041,"owners_count":21166589,"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-11-08T01:56:51.665Z","updated_at":"2025-04-14T04:23:50.356Z","avatar_url":"https://github.com/davidsoergel.png","language":"Java","funding_links":[],"categories":["人工智能"],"sub_categories":["机器学习"],"readme":"jLibSVM\n=======\n\n_Efficient training of Support Vector Machines in Java_\n\n * Heavily refactored Java port of the venerable [LIBSVM](http://www.csie.ntu.edu.tw/~cjlin/libsvm/) (version 2.88).\n * Provides **idiomatic Java** class structure and APIs (unlike the Java version provided by LIBSVM, which is transliterated C code).\n * Easy to **add new kernels**, in addition to the five standard ones provided by LIBSVM.\n * On the mathematical side, jlibsvm performs **exactly the same computations as LIBSVM**, including shrinking and all the fancy stuff described in the [LIBSVM implementation docs](http://www.csie.ntu.edu.tw/~cjlin/papers/libsvm.pdf).\n * **Optimized kernel implementations** run faster, particularly when input vectors are sparse.  For instance, on the [mushrooms](http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary.html#mushrooms) dataset, jlibsvm trained ~25% faster than LIBSVM (java version) with an RBF kernel and ~40% faster with a linear kernel.  (The C version of LIBSVM is still faster, though).\n * **Multithreaded training** to take advantage of modern multi-core machines (using [Conja](http://github.com/davidsoergel/conja)).\n * **Integrated scaling and normalization** so you don't have to explicitly preprocess your data.\n * **Integrated grid search** for optimal kernel parameters.\n * Drop-in replacement if you use the command-line tools (e.g. svm-train, etc.), but not if you use LIBSVM programmatically.\n * Uses Java **generics** throughout, including for classification labels, so you can specify that the \"label\" of a class be of whatever Java type you like.  In an email-filtering application, for example, you could use objects of type `Mailbox` as the labels.  That would allow you to write something like `mySvmSolutionModel.predict(incomingEmail).addMessage(incomingEmail)`.  The `predict()` method returns a classification label, which in this case is an object of class `Mailbox`, which has an `addMessage()` method.\n \n\nStatus\n------\n\nThis is beta code.  While LIBSVM is stable, it's possible that I broke something in the process of refactoring it.  I've done ad-hoc testing primarily with the C_SVC machine and an RBF kernel, and got results that were identical to LIBSVM as far as I could tell.  There are not (yet?) any unit tests.  I'm running some automated verifications that jlibsvm behaves identically to LIBSVM for a number of input datasets and parameter choices; results will be available here soon.  Please [let me know](mailto:dev@davidsoergel.com) if you find a situation in which the two packages give different results.\n\nDocumentation\n-------------\n\n * [API docs](http://davidsoergel.github.io/jlibsvm/)\n \nSorry, I haven't really had a chance to write any docs.  Have a look at the sources for the command-line programs in the [legacyexec](src/main/java/edu/berkeley/compbio/jlibsvm/legacyexec) package to see how jlibsvm gets called.  Very briefly, you'll need to:\n\n 1. instantiate the [KernelFunction](http://davidsoergel.github.io/jlibsvm/apidocs/edu/berkeley/compbio/jlibsvm/kernel/KernelFunction.html) that you want\n 2. set up some parameters in a new [SvmParameter](http://davidsoergel.github.io/jlibsvm/apidocs/edu/berkeley/compbio/jlibsvm/SvmParameter.html) object\n 3. instantiate a concrete subclass of [SvmProblem](http://davidsoergel.github.io/jlibsvm/apidocs/edu/berkeley/compbio/jlibsvm/SvmProblem.html) (binary, multiclass, or regression), and populate it with training data\n 4. instantiate a concrete subclass of [SVM](http://davidsoergel.github.io/jlibsvm/apidocs/edu/berkeley/compbio/jlibsvm/SVM.html), choosing a type appropriate for your problem\n 5. Call `SVM.train(problem)` to yield a [SolutionModel](http://davidsoergel.github.io/jlibsvm/apidocs/edu/berkeley/compbio/jlibsvm/SolutionModel.html), which can be used to make predictions\n\nDownload\n--------\n\n[Maven](http://maven.apache.org/) is by far the easiest way to make use of jlibsvm.  Just add these to your pom.xml:\n```xml\n\u003crepositories\u003e\n\t\u003crepository\u003e\n\t\t\u003cid\u003edev.davidsoergel.com releases\u003c/id\u003e\n\t\t\u003curl\u003ehttp://dev.davidsoergel.com/nexus/content/repositories/releases\u003c/url\u003e\n\t\t\u003csnapshots\u003e\n\t\t\t\u003cenabled\u003efalse\u003c/enabled\u003e\n\t\t\u003c/snapshots\u003e\n\t\u003c/repository\u003e\n\t\u003crepository\u003e\n\t\t\u003cid\u003edev.davidsoergel.com snapshots\u003c/id\u003e\n\t\t\u003curl\u003ehttp://dev.davidsoergel.com/nexus/content/repositories/snapshots\u003c/url\u003e\n\t\t\u003creleases\u003e\n\t\t\t\u003cenabled\u003efalse\u003c/enabled\u003e\n\t\t\u003c/releases\u003e\n\t\u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependencies\u003e\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003eedu.berkeley.compbio\u003c/groupId\u003e\n\t\t\u003cartifactId\u003ejlibsvm\u003c/artifactId\u003e\n\t\t\u003cversion\u003e0.911\u003c/version\u003e\n\t\u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nIf you really want just the jar, you can get the [latest release](http://dev.davidsoergel.com/nexus/content/repositories/releases/edu/berkeley/compbio/jlibsvm/) from the Maven repo; or get the [latest stable build](http://dev.davidsoergel.com/jenkins/job/jlibsvm/lastStableBuild/edu.berkeley.compbio$jlibsvm/) from the build server.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidsoergel%2Fjlibsvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidsoergel%2Fjlibsvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidsoergel%2Fjlibsvm/lists"}