{"id":120,"date":"2018-12-14T20:54:47","date_gmt":"2018-12-14T17:24:47","guid":{"rendered":"https:\/\/mirblog.me\/?p=120"},"modified":"2018-12-28T21:34:52","modified_gmt":"2018-12-28T18:04:52","slug":"lighttwinsvm-a-fast-light-weight-and-simple-implementation-of-twinsvm-classifier","status":"publish","type":"post","link":"https:\/\/mirblog.net\/index.php\/2018\/12\/14\/lighttwinsvm-a-fast-light-weight-and-simple-implementation-of-twinsvm-classifier\/","title":{"rendered":"LightTwinSVM: A Fast, Light-weight and Simple Implementation of TwinSVM Classifier"},"content":{"rendered":"<p>Support Vector Machine (SVM) is a popular and state-of-the-art classification algorithm.\u00a0 Hence many packages and implementations of standard SVM can be found on the internet. However, there are some interesting extensions of SVM that has a slightly better prediction accuracy. Of these extensions, Twin Support Vector Machine (TSVM) has received\u00a0more attention from scholars in the field of SVM research. Even I myself have published a classifier based on TSVM and KNN.<\/p>\n<p>TSVM does classification using two non-parallel hyperplanes as opposed to a single hyperplane in standard SVM (To know more about TSVM, you can read <a href=\"https:\/\/mirblog.net\/index.php\/2018\/12\/07\/a-brief-intro-to-twin-support-vector-machine-classifier\/\" target=\"_blank\" rel=\"noopener\">this blog post<\/a>.).\u00a0\u00a0Unlike SVM, TSVM had almost no fast and simple implementation\u00a0on the internet prior to 2018. So I decided to develop the <a href=\"https:\/\/github.com\/mir-am\/LightTwinSVM\" target=\"_blank\" rel=\"noopener\">LightTwinSVM program<\/a> and share it with others for free.<\/p>\n<p><!--more--><\/p>\n<p>This program was designed to help researchers, students, and practitioners do classification easily using TwinSVM classifier without worrying about details of implementation.<\/p>\n<figure style=\"width: 905px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/raw.githubusercontent.com\/mir-am\/LightTwinSVM\/misc\/img\/LightTwinSVM-v0.3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium\" src=\"https:\/\/raw.githubusercontent.com\/mir-am\/LightTwinSVM\/misc\/img\/LightTwinSVM-v0.3.png\" alt=\"LightTwinSVM's UI\" width=\"905\" height=\"515\" \/><\/a><figcaption class=\"wp-caption-text\">LightTwinSVM&#8217;s command line interface<\/figcaption><\/figure>\n<p>The LightTwinSVM program is mostly written in <strong>Python<\/strong> and has the following features:<\/p>\n<ul>\n<li>A <strong>simple console program<\/strong> for using TwinSVM classifier on your dataset of interest.<\/li>\n<li><strong>Fast optimization algorithm<\/strong>: The clipDCD algorithm was improved and implemented in C++ for solving optimization problems of TwinSVM.<\/li>\n<li>Linear, RBF,\u00a0and Rectangular kernel are supported.<\/li>\n<li>Binary and <strong>Multi-class classification (One-vs-All &amp; One-vs-One)<\/strong> are supported.<\/li>\n<li>Its estimator is <strong>scikit-learn compatible<\/strong> so that sklearn&#8217;s methods such as GridSearchCV and cross_val_score can be used.<\/li>\n<li>K-fold <strong>cross-validation<\/strong> is supported.<\/li>\n<li>Training\/Test split is supported.<\/li>\n<li>It supports <strong>grid search<\/strong> over C and gamma parameters.<\/li>\n<li><strong>CSV<\/strong> and <strong>LIBSVM<\/strong> data files are supported.<\/li>\n<li><strong>Detailed classification result<\/strong> can be saved in a spreadsheet file.<\/li>\n<\/ul>\n<p>With the above features, the LightTwinSVM covers most of the use cases and can be used for research, education or even commercial projects. You also might be interested in using this program for your own work. If so, you can get <a href=\"https:\/\/github.com\/mir-am\/LightTwinSVM\" target=\"_blank\" rel=\"noopener\">LightTwinSVM on GitHub<\/a>. A readme file was created to help users install and use the program.<\/p>\n<p>If you&#8217;ve used LightTwinSVM and like it, please give star its repository on GitHub.<\/p>\n<p>Let me know your feedback and thoughts regarding the improvement of LightTwinSVM in the comments section below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Support Vector Machine (SVM) is a popular and state-of-the-art classification algorithm.\u00a0 Hence many packages and implementations of standard SVM can be found on the internet. However, there are some interesting extensions of SVM that has a slightly better prediction accuracy. Of these extensions, Twin Support Vector Machine (TSVM) has received\u00a0more attention from scholars in the &hellip; <a href=\"https:\/\/mirblog.net\/index.php\/2018\/12\/14\/lighttwinsvm-a-fast-light-weight-and-simple-implementation-of-twinsvm-classifier\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;LightTwinSVM: A Fast, Light-weight and Simple Implementation of TwinSVM Classifier&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[25,26,7,18,20,22,19,8,23,24,21,5,6],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-software","tag-c","tag-classification","tag-classifier","tag-code","tag-fast","tag-github","tag-implementation","tag-lighttwinsvm","tag-program","tag-python","tag-simple","tag-svm","tag-twinsvm"],"_links":{"self":[{"href":"https:\/\/mirblog.net\/index.php\/wp-json\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mirblog.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mirblog.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mirblog.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mirblog.net\/index.php\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":14,"href":"https:\/\/mirblog.net\/index.php\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/mirblog.net\/index.php\/wp-json\/wp\/v2\/posts\/120\/revisions\/136"}],"wp:attachment":[{"href":"https:\/\/mirblog.net\/index.php\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mirblog.net\/index.php\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mirblog.net\/index.php\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}