Support Vector Machine(SVM) is a machine learning algorithm used for classification and regression. It is one of the most basic ML algorithms which can be used to classify points in high dimensional space and to predict real numbers from a set of given features. If you want to know more in-depth about SVM, feel free to read the following:

SVM in Classification

SVM in Regression

In this article, we will get to see how to install and run ThunderSVM in Google Colab. Let’s see what thundersvm is first…

ThunderSVM

ThunderSVM is an open-source library which leverages GPUs and multi-core CPUs in applying SVM to solve problems in a much faster way with high efficiency. The speedup increase using thundersvm compared to _scikit-learn svm _in classificationincreases proportionally with the amount of data. By changing just one line of code, you can speed up your algorithm by about 70 times!

In using thundersvm, first you have to install it following the steps below.

Installation

To fully utilize both cpu and gpu, use the gpu runtime in google colab. First, open colab and click Runtime >> _Change runtime type from the MenubarNext, click GPU in the Hardware Accelerator _dropdown menu. This will activate a gpu backend for your google colab script.

CUDA Toolkit 9.0 is required to run thundersvm. We’ll install this first.

Now, execute the following lines of code one after another in the order shown below:

1\. !wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1704-9-0-local_9.0.176-1_amd64-deb

2\. !ls  ## Check if required cuda 9.0 amd64-deb file is downloaded
3\. !dpkg -i cuda-repo-ubuntu1704-9-0-local_9.0.176-1_amd64-deb
4\. !ls /var/cuda-repo-9-0-local | grep .pub
5\. !apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub
6\. !apt-get update
7\. !sudo apt-get install cuda-9.0

Next, run the following command to check if CUDA 9.0 is successfully installed:

!nvcc --version

After running this, if you get to see _Cuda compilation tools, release 9.0 _followed by specific version number in the last line of output, then installation is done. If you want to install it in your local computer, just run the above commands sequentially in terminal by removing the “!” for each of them. If you want to check the output results, the code for installation is available here.

Next, we’ll install thundersvm.

#support-vector-machine #svm #data-science #machine-learning #python

How to Install and Run ThunderSVM in Google Colab
15.85 GEEK