{"id":16391414,"url":"https://github.com/gjjvdburg/gensvm","last_synced_at":"2025-10-04T18:27:34.078Z","repository":{"id":17026789,"uuid":"19790881","full_name":"GjjvdBurg/GenSVM","owner":"GjjvdBurg","description":"A Generalized Multiclass Support Vector Machine available in Python, R, and C","archived":false,"fork":false,"pushed_at":"2023-01-28T10:32:36.000Z","size":32644,"stargazers_count":16,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T12:51:12.888Z","etag":null,"topics":["c","classification","machine-learning","multiclass-classification","support-vector-machines"],"latest_commit_sha":null,"homepage":"http://jmlr.org/papers/v17/14-526.html","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"armcha/AutoLinkTextView","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GjjvdBurg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2014-05-14T18:20:44.000Z","updated_at":"2025-03-26T12:06:51.000Z","dependencies_parsed_at":"2023-02-10T06:45:39.273Z","dependency_job_id":null,"html_url":"https://github.com/GjjvdBurg/GenSVM","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/GjjvdBurg/GenSVM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GjjvdBurg%2FGenSVM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GjjvdBurg%2FGenSVM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GjjvdBurg%2FGenSVM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GjjvdBurg%2FGenSVM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GjjvdBurg","download_url":"https://codeload.github.com/GjjvdBurg/GenSVM/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GjjvdBurg%2FGenSVM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278354846,"owners_count":25973432,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"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":["c","classification","machine-learning","multiclass-classification","support-vector-machines"],"created_at":"2024-10-11T04:46:03.031Z","updated_at":"2025-10-04T18:27:34.013Z","avatar_url":"https://github.com/GjjvdBurg.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"GenSVM\n======\n\nThis is the repository for the C implementation of *GenSVM*, a generalized \nmulticlass support vector machine proposed in:\n\n\u003e [GenSVM: A Generalized Multiclass Support Vector \n\u003e Machine](http://jmlr.org/papers/v17/14-526.html)\u003cbr\u003e\n\u003e G.J.J. van den Burg and P.J.F. Groenen\u003cbr\u003e\n\u003e *Journal of Machine Learning Research*, 2016.\n\nGenSVM is available in these languages:\n\nLanguage | URL\n:-------:|:-------:\n\u003ca href=\"https://github.com/GjjvdBurg/PyGenSVM\"\u003e\u003cimg src=\"https://www.python.org/static/community_logos/python-logo-master-v3-TM.png\" height=\"75\"/\u003e\u003c/a\u003e | [https://github.com/GjjvdBurg/PyGenSVM](https://github.com/GjjvdBurg/PyGenSVM)\n\u003ca href=\"https://github.com/GjjvdBurg/RGenSVM\"\u003e\u003cimg src=\"https://www.r-project.org/Rlogo.png\" height=\"75\"/\u003e\u003c/a\u003e | [https://github.com/GjjvdBurg/RGenSVM](https://github.com/GjjvdBurg/RGenSVM)\n\u003ca href=\"https://github.com/GjjvdBurg/GenSVM\"\u003e\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/3/35/The_C_Programming_Language_logo.svg\" height=\"75\"/\u003e\u003c/a\u003e | [https://github.com/GjjvdBurg/GenSVM](https://github.com/GjjvdBurg/GenSVM)\n\n\nIntroduction\n------------\n\nGenSVM is a general multiclass support vector machine, which you can use for \nclassification problems with multiple classes. Training GenSVM in \ncross-validation or grid search setups can be done efficiently due to the \nability to use warm starts.  See the \n[paper](http://jmlr.org/papers/v17/14-526.html) for more information, and \nUsage below for how to use GenSVM.\n\nThe library has support for datasets in \n[MSVMpack](https://members.loria.fr/FLauer/files/MSVMpack/MSVMpack.html) and \n[LibSVM/SVMlight](https://www.csie.ntu.edu.tw/~cjlin/libsvm/) format, and can \ntake advantage of sparse datasets. There is also preliminary support for \nnonlinear GenSVM through kernels.\n\nFor documentation on how the library is implemented, see the [Doxygen \ndocumentation available here](https://gjjvdburg.github.io/GenSVM/). There are \nalso many unit tests, which you can use to further understand how the library \nworks. For the latest version of the library you can view the [test coverage \nreport](https://gjjvdburg.github.io/GenSVM/cover) online.\n\nThis is the C library for GenSVM that contains two executables for using the \nmethod. A Python package for GenSVM is available \n[here](https://github.com/GjjvdBurg/PyGenSVM). An R package for GenSVM is \nplanned.  If you are interested in this, please express your interest for the \nR package [here](https://github.com/GjjvdBurg/GenSVM/issues/2).\n\nUsage\n-----\n\nFirst, download and compile the library. Minimal requirements for compilation \nare a working BLAS and LAPACK installation, which you can likely obtain from \nyour package manager. It is however recommended to use ATLAS versions of these \nlibraries, since this will give a significant increase in speed. If you choose \nnot to use ATLAS, remove linking with ``-latlas`` in the ``LDFLAGS`` variable \nin the Makefile.\n\nThen, compile the library with a simple:\n\n```\n$ make\n```\n\nIf you like to run the tests, use ``make test`` on the command line. \n\nAfter successful compilation, you will have two executables ``gensvm`` and \n``gensvm_grid``. Type:\n\n```\n$ ./gensvm\n```\n\nTo get an overview of the command line options to the executable (similar for \n``gensvm_grid``).\n\nThe ``gensvm`` executable can be used to train a GenSVM model on a dataset \nwith a single hyperparameter configuration, whereas the ``gensvm_grid`` \nexecutable can be used to run a grid search on a dataset.\n\nHere's an example of using the ``gensvm`` executable on a single dataset, with \nsome custom parameters:\n\n```\n$ ./gensvm -l 1e-5 -k 1.0 -p 1.5 data/iris.train\n```\n\nThis fits the model with regularization parameter ``1e-5``, Huber hinge \nparameter ``1.0`` and lp norm parameter ``1.5``, and default settings \notherwise. On my computer this yields a model with 18 support vectors in about \n0.1 seconds. The ``gensvm`` executable can also be used to get predictions for \na test dataset, if it is supplied as final argument to the command. In this \ncase, predictions will be printed to stdout, unless an output file is \nspecified with the ``-o`` option.\n\nThe ``gensvm_grid`` executable can be used to run a grid search on a dataset.\nThe input to this executable is a file (called a grid file), which specifies \nthe values of the parameters. See the ``training`` directory for examples and \nthe documentation [here](https://gjjvdburg.github.io/GenSVM/) for more info on \nthe file format.  One important thing to note is that when the ``repeats`` \nfield has a positive value, a so-called \"consistency check\" will be performed \nafter the grid search has finished. This is a robustness check on the best \nperforming configurations, to find the best overall hyperparameter \nconfiguration with the best performance and smallest training time. In this \nrobustness check warm-starts are not used, to ensure the observations are \nindependent measurements of training time.\n\nHere's an example of running ``gensvm_grid`` without repeats on the iris \ndataset:\n\n```\n$ ./gensvm_grid training/iris_norepeats.training\n```\n\nOn my computer this runs in about 8 seconds with 342 hyperparameter \nconfigurations. Alternatively, if consistency checks are desired we can run:\n\n```\n$ ./gensvm_grid training/iris.training\n```\n\nwhich runs the same grid search but also does 5 consistency repeats for each \nof the configurations with the 5% best performance. Note that the performance \nis measured by cross-validated accuracy scores. This example runs in about 13 \nseconds on my computer.\n\nReference\n---------\n\nIf you use GenSVM in any of your projects, please cite the GenSVM paper \navailable at \n[http://jmlr.org/papers/v17/14-526.html](http://jmlr.org/papers/v17/14-526.html). \nYou can use the following BibTeX code:\n\n```bib\n@article{JMLR:v17:14-526,\n        author  = {Gerrit J.J. van den Burg and Patrick J.F. Groenen},\n        title   = {{GenSVM}: A Generalized Multiclass Support Vector Machine},\n        journal = {Journal of Machine Learning Research},\n        year    = {2016},\n        volume  = {17},\n        number  = {225},\n        pages   = {1-42},\n        url     = {http://jmlr.org/papers/v17/14-526.html}\n}\n```\n\nLicense\n-------\n\n    Copyright 2016, G.J.J. van den Burg.\n\n    GenSVM is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    GenSVM is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with GenSVM. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n    For more information please contact:\n\n    G.J.J. van den Burg\n    email: gertjanvandenburg@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjjvdburg%2Fgensvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgjjvdburg%2Fgensvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjjvdburg%2Fgensvm/lists"}