{"id":13484225,"url":"https://github.com/febeling/rb-libsvm","last_synced_at":"2025-05-16T13:02:02.109Z","repository":{"id":56891070,"uuid":"151285","full_name":"febeling/rb-libsvm","owner":"febeling","description":"Ruby language bindings for LIBSVM","archived":false,"fork":false,"pushed_at":"2023-12-07T20:35:24.000Z","size":234,"stargazers_count":278,"open_issues_count":1,"forks_count":33,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-09T10:04:08.475Z","etag":null,"topics":["libsvm","machine-learning","ml","ruby","ruby-bindings","ruby-language-bindings","rubyml","svm","svm-classifier","svm-learning","svm-training"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/febeling.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2009-03-15T11:35:38.000Z","updated_at":"2024-11-24T13:54:20.000Z","dependencies_parsed_at":"2022-08-20T15:20:56.200Z","dependency_job_id":"c675cece-0a6b-4b06-ace2-8b558a89edf1","html_url":"https://github.com/febeling/rb-libsvm","commit_stats":{"total_commits":236,"total_committers":7,"mean_commits":"33.714285714285715","dds":0.1694915254237288,"last_synced_commit":"54e09ab897ba69d8f1dc727031568abb7f92fd2c"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/febeling%2Frb-libsvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/febeling%2Frb-libsvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/febeling%2Frb-libsvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/febeling%2Frb-libsvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/febeling","download_url":"https://codeload.github.com/febeling/rb-libsvm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535787,"owners_count":22087394,"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":["libsvm","machine-learning","ml","ruby","ruby-bindings","ruby-language-bindings","rubyml","svm","svm-classifier","svm-learning","svm-training"],"created_at":"2024-07-31T17:01:20.974Z","updated_at":"2025-05-16T13:02:02.055Z","avatar_url":"https://github.com/febeling.png","language":"C++","readme":"[![Gem Version](https://badge.fury.io/rb/rb-libsvm.svg)](http://badge.fury.io/rb/rb-libsvm)\n\n# rb-libsvm -- Ruby language bindings for LIBSVM\n\nThis package provides Ruby bindings to the [LIBSVM][] library.  SVM\nis a machine learning and classification algorithm, and LIBSVM is a\npopular free implementation of it, written by Chih-Chung Chang and\nChih-Jen Lin, of National Taiwan University, Taipei. See the book [\"Programming\nCollective Intelligence,\"](http://books.google.com/books?id=fEsZ3Ey-Hq4C) among others, for a usage example.\n\nThere is a JRuby implementation of this gem named\n[jrb-libsvm](https://github.com/sch1zo/jrb-libsvm) by\n[Andreas Eger](https://github.com/sch1zo).\n\nNote: There exist some other Ruby bindings for LIBSVM. One is named\n[Ruby SVM][ruby-svm], written by Rudi Cilibrasi. The other, more\nactively developed one is [libsvm-ruby-swig][svmrubyswig] by Tom Zeng,\nwhich is built using SWIG.\n\nLIBSVM includes a number of command line tools for preprocessing\ntraining data and finding parameters. These tools are not included in\nthis gem. You should install the original package if you need them.\n\nIt is helpful to consult the [README of the LIBSVM][README] package for\nreference when configuring the training parameters.\n\nCurrently this package includes libsvm version 3.24.\n\n## Dependencies\n\nNone.  LIBSVM is bundled with the project.  Just install and go!\n\n## Installation\n\nFor building this gem from source on OS X (which is the default\npackaging) you will need to have Xcode installed, and from within Xcode\nyou need to install the command line tools. Those contain the compiler\nwhich is necessary for the native code, and similar tools.\n\nTo install the gem run this command\n\n    gem install rb-libsvm\n\n## Usage\n\nThis is a short example of how to use the gem.\n\n```ruby\nrequire 'libsvm'\n\n# This library is namespaced.\nproblem = Libsvm::Problem.new\nparameter = Libsvm::SvmParameter.new\n\nparameter.cache_size = 1 # in megabytes\n\nparameter.eps = 0.001\nparameter.c = 10\n\nexamples = [ [1,0,1], [-1,0,-1] ].map {|ary| Libsvm::Node.features(ary) }\nlabels = [1, -1]\n\nproblem.set_examples(labels, examples)\n\nmodel = Libsvm::Model.train(problem, parameter)\n\npred = model.predict(Libsvm::Node.features(1, 1, 1))\nputs \"Example [1, 1, 1] - Predicted #{pred}\"\n```\n\nIf you want to rely on Bundler for loading dependencies in a project,\n(i.e. use `Bundler.require` or use an environment that relies on it,\nlike Rails), then you will need to specify rb-libsvm in the Gemfile\nlike this:\n\n```ruby\ngem 'rb-libsvm', require: 'libsvm'\n```\n\nThis is because the loadable name (`libsvm`) is different from the\ngem's name (`rb-libsvm`).\n\n## Release\n\nThe process to make a release of the gem package to rubygems.org has a\nnumber of steps. \n\n* manually change the version in `lib/libsvm/version.rb`\n* clean, build, and run tests successfully\n* update code and documentation\n* push\n* sign into https://rubygems.org/\n* save API token from https://rubygems.org/profile/edit and store in `.gem/credentials` by running `gem signin`\n* perform actual release: `bundle exec rake release`\n\n## Author\n\nWritten by [C. Florian Ebeling](https://github.com/febeling).\n\n## Contributors\n\n* [Rimas Silkaitis](https://github.com/neovintage)\n* [Aleksander Pohl](https://github.com/apohllo)\n* [Andreas Eger](https://github.com/sch1zo)\n\n## License\n\nThis software can be freely used under the terms of the MIT license,\nsee file MIT-LICENSE.\n\nThis package includes the source of LIBSVM, which is free to use under\nthe license in the file LIBSVM-LICENSE.\n\n### Posts about using SVMs with Ruby\n\nhttps://www.practicalai.io/implementing-classification-using-a-svm-in-ruby/\n\nhttp://neovintage.blogspot.com/2011/11/text-classification-using-support.html\n\nhttp://www.igvita.com/2008/01/07/support-vector-machines-svm-in-ruby/\n\n[libsvm]:       http://www.csie.ntu.edu.tw/~cjlin/libsvm/\n\n[svmrubyswig]:  http://github.com/tomz/libsvm-ruby-swig/tree/master\n\n[ruby-svm]:     http://sourceforge.net/projects/rubysvm/\n\n[README]:       https://github.com/cjlin1/libsvm/blob/master/README\n","funding_links":[],"categories":["Machine Learning","Ruby","Machine Learning Libraries"],"sub_categories":["General-Purpose Machine Learning","Text-to-Speech-to-Text","Kernel methods"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffebeling%2Frb-libsvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffebeling%2Frb-libsvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffebeling%2Frb-libsvm/lists"}