---
# System prepended metadata

title: Welcome to the Book Club "Hands-On Machine Learning with R" - Ch. 14. Support Vector Machines

---

# Welcome to the Book Club "Hands-On Machine Learning with R" - Ch. 14. Support Vector Machines

## Some house rules to make the meeting nice for everyone

- Please familiarize with our [code of conduct](https://rladies.org/code-of-conduct/). In summary, please be nice to each other and help us make an **inclusive** meeting! :purple_heart: 
- The meeting will NOT BE RECORDED but the slides will be shared!
- Please list your name in the registry.
    - Make sure you're in the edit mode (ctrl + alt + e) when trying to edit the file! You'll know you're in the edit mode if the background is black :8ball:
- Please keep your mic off during the presentation. It is nice if you have the camera on and participate to make the meeting more interactive. Of course you can have your camera off if you prefer.
- If you have questions, raise your hand or write your question in this document.

### Links :link:

Book/organisation:
- [Book: "Hands-On Machine Learning with R"](https://bradleyboehmke.github.io/HOML/)
- [GitHub Repository](https://github.com/rladiesnl/book_club_handsonML)
- [Meeting Link](https://us02web.zoom.us/j/89588323742#success)
- Meet-up pages:
    - [R-Ladies Utrecht](https://www.meetup.com/rladies-utrecht/)
    - [R-Ladies Den Bosch](https://www.meetup.com/rladies-den-bosch/)
- Twitter
    - [@RLadiesUtrecht](https://twitter.com/RLadiesUtrecht)
    - [@RLadiesDenBosch](https://twitter.com/RLadiesDenBosch)


## Chapter 14: Support Vector Machines

### Registry :clipboard: 
Name / pronouns / R level / place where you join from

- REGISTER HERE! :point_left: 
- Martine / advancedish / 's-Hertogenbosch NL
- Ale / intermediate / Utrecht NL
- Veerle / intermediate / Den Bosch, NL

### Do you have any questions? :question: 
You can write them down here, and if you have answers to posted questions please go ahead, we are all learning together.

- WRITE YOUR QUESTION HERE! :point_left: 


## About today's topic

### Any take-home messages you want to share?

Help others remember the main points you took of these chapters:

- Support Vector Machines is a supervised learning algorithm. For binary classification ( or with a trick multiclass)
- **Hyperplanes** are objects with one dimension less than the dimensions of space. For instance, when the space is tri-dimensional, the hyperplane is a  plane. If the space is bi-dimensional, the hyperplane is a line. 
    - The points on (or in) the margin (the edges of the two groups that are closer to each other) are the **support vectors**. 
    - The hyperplane can serve as a *hard margin classifier* which is the boundary separating *ALL* the elements of the two classes we are classifying. This is to defer from the *soft margin classifiers* where there can be a few points (the noisy ones) on the 'wrong' side of the classification.
- You can make new features that help you increase the *feature space* (the number of dimensions) that will make it possible to separate the two classes. The **kernels** are what you use to make new features. Authors advice to start with **radial kernel** because it is flexible and it often works (and it is faster).
- Library used for calculating SVM: *kernlab*. The *mlbench* is used to simulate spiral datasets. 
- Main function used: *ksvm()*. with the arguments `kernel='rbfdot'` (for radial) and `C = 500` for giving a 'budget' of 500 credits for points to be 'missclassified'. 
- Another interesting function used to plot (adding to `ggplot`) was `stat_contour()`
- SVMs can also be used for more than two classes but with some adaptation. There are two strategies:
    - One vs all: classify one class vs all the others
    - One vs one: fit all pairwise svms and most voted class wins
- You cannot use ordered factors in SVMs.

### Do you have any interesting links regarding the topic? :link: 

If you have suggestions of books/blog posts/articles, etc. that could help people getting further into the topic. Write them here:

- WRITE YOUR LINK HERE! :point_left: 

### Feedback :left_speech_bubble: 

Please help us get better at this by giving us some feedback :sparkles: Things you liked or things that could improve! :smile: 

- WRITE YOUR FIRST COMMENT HERE! :point_left:


## Sign-up for presenting a chapter!

- Chp 14 - Martine Jansen (23 Jan)
- Chp 15 - Ece (20 Feb)
- Chp 16 - Brandon, co-author of the book (6 March?)
- Chp 17 - Shweta (would try to) (20 March)
- Chp 18 - ?
- Chp 19 - ?
- Chp 20 - 21 -(22) - Martine (TBD)