Support vectors output in SVM widget

Did you know that the widget for support vector machines (SVM) classifier can output support vectors? And that you can visualise these in any other Orange widget? In the context of all other data sets, this could provide some extra insight into how this popular classification algorithm works and what it actually does.

Ideally, that is, in the case of linear seperability, support vector machines (SVM) find a hyperplane with the largest margin to any data instance. This margin touches a small number of data instances that are called support vectors.

In Orange 3.0 you can set the SVM classification widget to output also the support vectors and visualize them. We used Iris data set in the File widget and classified data instances with SVM classifier. Then we connected both widgets with Scatterplot and selected Support Vectors in the SVM output channel. This allows us to see support vectors in the Scatterplot widget – they are represented by the bold dots in the graph.

Now feel free to try it with your own data set!

 

svm-with-support-vectors
Support vectors output of SVM widget with Iris data set.
  • icebreaker

    How do I export a table of support vectors so that I know what variables are responsible for the classification?

    • Ajda Pretnar

      SVM offers Support Vectors output. Connect Data Table to SVM to observe it. However, it is important to note that support vectors are not variables, but instances that define the hyperplane (training points in the decision function).

      • icebreaker

        Thanks! In that case what would be the best way to identify variables something akin to SVM-RFE in order to rank the variables by their role in my SVM model?

        • Ajda Pretnar

          Unfortunately, not yet. But we are working on a widget that would enable generic attribute scoring (meaning it would work for any model).

  • Yaseen Afzal

    how to use text file in SVM because it ask for target variable when i am use import document.

    • Ajda Pretnar

      This is because you haven’t set any target variable. Please see our YT channel (https://youtu.be/D6zd7m2aYqU) to learn more about classification and about importing texts (https://youtu.be/faIqvWxFGRc). There’s also documentation available.

      • Yaseen Afzal

        404 not found error on these links

        • Ajda Pretnar

          It should work now. I fixed the links.