{"id":27298630,"url":"https://github.com/mir-am/libtwinsvm","last_synced_at":"2025-09-03T03:38:11.573Z","repository":{"id":62575976,"uuid":"176348589","full_name":"mir-am/LIBTwinSVM","owner":"mir-am","description":"A Library for Twin Support Vector Machines","archived":false,"fork":false,"pushed_at":"2023-08-16T09:11:24.000Z","size":6886,"stargazers_count":23,"open_issues_count":5,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-26T05:49:09.160Z","etag":null,"topics":["api","fast","gui","implementation","library","ltsvm","machinelearning","optimizer","tsvm","twinsvm"],"latest_commit_sha":null,"homepage":"https://libtwinsvm.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mir-am.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2019-03-18T18:41:34.000Z","updated_at":"2025-06-11T14:59:22.000Z","dependencies_parsed_at":"2025-04-12T00:37:24.662Z","dependency_job_id":"3ed91f16-6018-4426-9ccc-66a1d50d6b69","html_url":"https://github.com/mir-am/LIBTwinSVM","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mir-am/LIBTwinSVM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mir-am%2FLIBTwinSVM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mir-am%2FLIBTwinSVM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mir-am%2FLIBTwinSVM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mir-am%2FLIBTwinSVM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mir-am","download_url":"https://codeload.github.com/mir-am/LIBTwinSVM/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mir-am%2FLIBTwinSVM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273386479,"owners_count":25096244,"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-09-03T02:00:09.631Z","response_time":76,"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":["api","fast","gui","implementation","library","ltsvm","machinelearning","optimizer","tsvm","twinsvm"],"created_at":"2025-04-12T00:37:19.044Z","updated_at":"2025-09-03T03:38:11.520Z","avatar_url":"https://github.com/mir-am.png","language":"Python","funding_links":["http://paypal.me/mir33'","http://paypal.me/mir33"],"categories":[],"sub_categories":[],"readme":"# LIBTwinSVM\n\u003ca href=\"https://opensource.org/licenses/GPL-3.0\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-GPL%20v3-blue.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003ca href=\"https://travis-ci.org/mir-am/LIBTwinSVM\"\u003e\u003cimg src=\"https://api.travis-ci.org/mir-am/LIBTwinSVM.svg?branch=master\" alt=\"Travis-CI\"\u003e\u003c/a\u003e\n[![Documentation Status](https://readthedocs.org/projects/libtwinsvm/badge/?version=latest)](https://libtwinsvm.readthedocs.io/en/latest/?badge=latest)\n[![PyPI version](https://badge.fury.io/py/LIBTwinSVM.svg)](https://badge.fury.io/py/LIBTwinSVM)\n\u003ca href='http://paypal.me/mir33'\u003e\u003cimg src='https://img.shields.io/badge/Donate-PayPal-green.svg' alt='donation' /\u003e\u003c/a\u003e\n[![Downloads](https://pepy.tech/badge/libtwinsvm)](https://pepy.tech/project/libtwinsvm)\n\n# Contents\n1. [Core Features](#core-features)\n2. [Installation Guide](#installation-guide)\n3. [Quick Start](#quick-start)\n4. [Documentation](#documentation)\n5. [Development](#development) \n6. [Donations](#donations)\n7. [Citing LIBTwinSVM](#citing-libtwinsvm)\n8. [License](#license)\n\n## Core Features\nLIBTwinSVM is an easy-to-use implementation of Twin Support Vector Machine.  It is licensed under the terms of GNU GPL v3. This application comes with a user interface which makes using the algorithm so handy for Data Scientists, Machine Learning Researchers and whoever else that is interested in Machine Learning.\n\u003cbr\u003e\n\n- A **simple** and **user-friendly Graphical User Interface** (GUI).\n- Supports both **standard TwinSVM** and **Least Squares TwinSVM** classifiers.\n- Easy to import data in **CSV** \u0026 **LIBSVM** format.\n- A dataset can be loaded with **shuffling** and **normalization**.\n- A **fast optimizer** (clipDCD) is improved and implemented in C++ to solve optimization problems of TwinSVMs.\n- Supports **Linear**, **RBF** and **Rectangular** kernel.\n- Supports **Binary** and **Multi-class** classification (One-vs-All \u0026 One-vs-One).\n- The OVA and OVO estimators are **compatible with scikit-learn** tools such as GridSearchCV, cross_val_score, etc.\n- A classifier can be evaluated using either **K-fold cross-validation** or **Training/Test split**.\n- Supports **grid search** over estimators' hyper-parameters.\n- The detailed classification results can be saved in an **Excel-format spreadsheet** file.\n- The classification results can be logged during the grid search process to not lose results in case of power failure.\n- A **feature-rich visualization tool** to show decision boundaries and geometrical interpretation of TwinSVMs.\n- The best-fitted classifier can be saved on the disk after the grid search process.\n- The pre-trained models can be loaded and evaluated on the test samples.\n\n\n## Installation Guide\n### Dependencies\n\nLIBTwinSVM depends on the following packages.\n\n|   Package                                      |                      Description                               |       License         |\n| ---------------------------------------------- | -------------------------------------------------------------- | --------------------- |\n| [Cython](https://cython.org/)                  |  To use C++ code in Python.                                    | Apache License 2.0    |\n| [NumPy](https://www.numpy.org/)                |  Fast linear algebra operations.                               | BSD 3-Clause          | \n| [Matplotlib](https://matplotlib.org/)          |  Visualization and geometrical representation of classifiers.  | [Matplotlib License](https://matplotlib.org/users/license.html)                    |\n| [PyQt5](https://www.riverbankcomputing.com/software/pyqt/intro)  | To create a GUI for using the LIBTwinSVM's features.| GPL |\n| [Scikit-learn](https://scikit-learn.org/)      | For TwinSVM-based models evaluation and selection.             | BSD 3-Clause |\n| [Pandas](https://pandas.pydata.org/)           | For reading and processing datasets.                           | BSD 3-Clause |\n| [XlsxWriter](https://xlsxwriter.readthedocs.io/) | For saving classification results in an Excel file.          | BSD 3-Clause |\n| [Joblib](https://joblib.readthedocs.io)   | For saving and loading TwinSVM-based models.                   | BSD 3-Clause |\n| [numpydoc](https://numpydoc.readthedocs.io/en/latest/) | API code documentation.                                | BSD License  |\n\n\n### Quick Installation\n\nFor Installing LIBTwinSVM you can choose one of the following commands based on your Operating System and your Python version. Please note that for installing the latest bugfixes and features, we recommend you to install the library from the source. \n\n* Linux \u0026 Mac OS:\n```\npip3 install libtwinsvm\n```\n\n* Windows:\n```python\npip install libtwinsvm\n```\n\n### Installation from the source\n\n**1.  Downloading LIBTwinSVM**\n\nFirst, make sure that [Git](https://git-scm.com/) is installed as it is required for getting the source code. Then open Git in any arbitrary path and enter the following command:\n\n```\ngit clone --recursive https://github.com/mir-am/LIBTwinSVM\n```\n\n**2. Downloading Requirements**\n\nBefore installing any packages, we recommend you to upgrade pip:\n\n* Linux \u0026 Mac OS:\n```\npip3 install -U pip\n```\n\n* Windows:\n```\npip install -U pip\n```\n\nFor LIBTwinSVM installation, *Numpy* and *Cython* must be installed. You can install them by entering the following commands in your terminal. If you already have *Cython* and *Numpy* installed, you can skip to the next section.\n\n* Linux \u0026 Mac OS: For installing Numpy \u0026 Cython on your computer, you should enter the following command in the terminal.\n```\npip3 install numpy cython\n```\n\n**Note for Linux users:** You should also install the following packages for your distribution:\n\nDebian-based Linux distro:\n```\nsudo apt-get install python3-tk liblapack-dev libblas-dev\n```\n\nRPM-based Linux distro:\n```\nsudo yum install python3-tkinter lapack-devel blas-devel\n```\n\n\n* Windows: for installing the requirements on windows, you should enter the following command in the command prompt. \n```\npip install numpy cython\n```\n\n**3. Installing LIBTwinSVM**\n\nGo to LIBTwinSVM folder where you have downloaded the source code in step 2. Then enter the following command in the terminal:\n\n* Linux \u0026 Mac OS:\n```python\npip3 install .\n```\n* Windows:\n```python\npip install .\n```\n\n### Uninstall LIBTwinSVM\n\nFor uninstalling LIBTwinSVM, enter the following command in the terminal:\n\n* Linux \u0026 Mac OS:\n```python\npip3 uninstall libtsvm\n```\n* Windows:\n```python\npip uninstall libtsvm\n```\n\n## Quick start\n\nAfter LIBTwinSVM was installed, for running the GUI application, open the terminal and enter the following code:\n* Linux \u0026 Mac OS:\n```python\npython3 -m libtsvm\n```\n* Windows:\n```python\npython -m libtsvm\n```\n## Dataset Format \n\nLIBTwinSVM supports data files with the following formats:\n- **CSV** files with '*.csv*' extention.\n- **LIBSVM** files with '*.libsvm*' extention.\n\nNote that for importing data as a CSV file, the dataset has to comply the following terms: \n1. The first column has to be the dataset labels. Moreover, labels of positive and negative samples should be 1 and -1, respectively.\n2. The first row can be dataset's headernames. (Optional)\n3. All the values in dataset except headernames should be numerical. Nominal values are not allowed. \u003cbr/\u003e\n\nTo help you prepare your dataset and test the program, three datasets are included [here](https://github.com/mir-am/LIBTwinSVM/tree/master/dataset).\n\n## Documentation\nUsage examples and API reference can be found on the project's [Read the Docs page](https://libtwinsvm.readthedocs.io/en/latest/). \n\n## Development\n### Tests\nAfter installing the library, you can run unit tests to ensure that your installation is valid. To do so, you need to install pytest package with the following command:\n\n```\npip install pytest\n```\n\nNext, execute the following command in the root of the project directory:\n\n```\npytest tests\n```\n\n## Donations\n\u003ca href=\"http://paypal.me/mir33\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/stefan-niedermann/paypal-donate-button/master/paypal-donate-button.png\" alt=\"Donate with PayPal\" align=\"left\" height=\"80\" width=\"192\" /\u003e\n\u003c/a\u003e\u003cbr /\u003e\n\nIf you have used the LIBTwinSVM project and found it helpful, please consider making a donation via [PayPal](http://paypal.me/mir33) to support this work. It also motivates us to maintain the project and develop new features.\n\n## Citing LIBTwinSVM\nIf you have used the LIBTwinSVM library in your research work, please cite the following paper:\n\n- Mir, A. M., Rahbar, M., \u0026 Nasiri, J. A. (2020). LIBTwinSVM: A Library for Twin Support Vector Machines. arXiv preprint arXiv:2001.10073.\n\nBibTeX entry:\n```\n@article{mir2020libtwinsvm,\n  title={LIBTwinSVM: A Library for Twin Support Vector Machines},\n  author={Mir, Amir M and Rahbar, Mahdi and Nasiri, Jalal A},\n  journal={arXiv preprint arXiv:2001.10073},\n  year={2020}\n}\n```\n\n\n## License\nLIBTwinSVM library is licensed under the terms of GNU General Public License v3. This library can be used for both academic and commercial purposes. For more information, check out the [LICENSE](https://github.com/mir-am/LIBTwinSVM/blob/master/LICENSE.txt) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmir-am%2Flibtwinsvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmir-am%2Flibtwinsvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmir-am%2Flibtwinsvm/lists"}