stem/AI/Classification/Supervised/SVM.md

74 lines
2.1 KiB
Markdown
Raw Normal View History

vault backup: 2023-06-07 09:02:27 Affected files: STEM/AI/Classification/Classification.md STEM/AI/Classification/Decision Trees.md STEM/AI/Classification/Gradient Boosting Machine.md STEM/AI/Classification/Logistic Regression.md STEM/AI/Classification/Random Forest.md STEM/AI/Classification/Supervised.md STEM/AI/Classification/Supervised/README.md STEM/AI/Classification/Supervised/SVM.md STEM/AI/Classification/Supervised/Supervised.md STEM/AI/Learning.md STEM/AI/Neural Networks/Learning/Boltzmann.md STEM/AI/Neural Networks/Learning/Competitive Learning.md STEM/AI/Neural Networks/Learning/Credit-Assignment Problem.md STEM/AI/Neural Networks/Learning/Hebbian.md STEM/AI/Neural Networks/Learning/Learning.md STEM/AI/Neural Networks/Learning/README.md STEM/AI/Neural Networks/RNN/Autoencoder.md STEM/AI/Neural Networks/RNN/Deep Image Prior.md STEM/AI/Neural Networks/RNN/MoCo.md STEM/AI/Neural Networks/RNN/Representation Learning.md STEM/AI/Neural Networks/RNN/SimCLR.md STEM/img/comp-learning.png STEM/img/competitive-geometric.png STEM/img/confusion-matrix.png STEM/img/decision-tree.png STEM/img/deep-image-prior-arch.png STEM/img/deep-image-prior-results.png STEM/img/hebb-learning.png STEM/img/moco.png STEM/img/receiver-operator-curve.png STEM/img/reinforcement-learning.png STEM/img/rnn+autoencoder-variational.png STEM/img/rnn+autoencoder.png STEM/img/simclr.png STEM/img/sup-representation-learning.png STEM/img/svm-c.png STEM/img/svm-non-linear-project.png STEM/img/svm-non-linear-separated.png STEM/img/svm-non-linear.png STEM/img/svm-optimal-plane.png STEM/img/svm.png STEM/img/unsup-representation-learning.png
2023-06-07 09:02:27 +01:00
[Towards Data Science: SVM](https://towardsdatascience.com/support-vector-machines-svm-c9ef22815589)
[Towards Data Science: SVM an overview](https://towardsdatascience.com/https-medium-com-pupalerushikesh-svm-f4b42800e989)
- Dividing line between two classes
- Optimal hyperplane for a space
- Margin maximising hyperplane
- Can be used for
vault backup: 2023-06-08 17:52:08 Affected files: .obsidian/graph.json .obsidian/workspace-mobile.json .obsidian/workspace.json Food/Meal Plan.md Lab/Linux/Alpine.md Lab/Linux/KDE.md Lab/Scratch Domain.md Lab/Windows/Active Directory.md Languages/Spanish/README.md Languages/Spanish/Spanish.md Money/Accounts.md Money/Monthly/23-04.md Money/Monthly/23-05.md Money/Monthly/23-06.md Projects/Mixonomer.md Projects/NoteCrawler.md Projects/Projects.md Projects/README.md Projects/Selector.md Projects/To Do App.md Projects/img/selector-arch.png STEM/AI/Classification/Supervised/SVM.md STEM/AI/Neural Networks/CNN/FCN/Super-Resolution.md STEM/AI/Neural Networks/CNN/GAN/GAN.md STEM/AI/Neural Networks/CNN/GAN/cGAN.md STEM/AI/Neural Networks/CNN/Interpretation.md STEM/AI/Neural Networks/Deep Learning.md STEM/AI/Neural Networks/MLP/MLP.md STEM/AI/Neural Networks/Properties+Capabilities.md STEM/AI/Neural Networks/RNN/Representation Learning.md STEM/AI/Pattern Matching/Markov/Markov.md STEM/AI/Searching/Informed.md STEM/AI/Searching/README.md STEM/AI/Searching/Searching.md STEM/AI/Searching/Uninformed.md STEM/CS/Languages/Javascript.md STEM/CS/Languages/Python.md STEM/CS/Languages/dotNet.md STEM/CS/Resources.md STEM/IOT/Cyber-Physical Systems.md STEM/IOT/Networking/Networking.md STEM/IOT/Networking/README.md STEM/IOT/Software Services.md STEM/img/cyberphysical-social-data.png STEM/img/cyberphysical-system-types.png STEM/img/cyberphysical-systems.png STEM/img/depth-first-cons.png STEM/img/depth-first.png STEM/img/iot-mesh-network.png STEM/img/iot-network-radar.png STEM/img/iot-network-types 1.png STEM/img/iot-network-types.png STEM/img/markov-start-end-matrix.png STEM/img/markov-start-end-probs.png STEM/img/markov-start-end.png STEM/img/markov-state-duration.png STEM/img/markov-state.png STEM/img/markov-weather.png STEM/img/search-bidirectional.png STEM/img/search-breadth-first.png STEM/img/search-lim-goal.png STEM/img/search-lim1.png STEM/img/search-lim2.png STEM/img/search-lim3-2.png STEM/img/search-lim3.png STEM/img/search-lim4.png STEM/img/searching-graph-tree.png STEM/img/searching-graph.png Work/Freelancing.md
2023-06-08 17:52:09 +01:00
- [Classification](../Classification.md)
vault backup: 2023-06-07 09:02:27 Affected files: STEM/AI/Classification/Classification.md STEM/AI/Classification/Decision Trees.md STEM/AI/Classification/Gradient Boosting Machine.md STEM/AI/Classification/Logistic Regression.md STEM/AI/Classification/Random Forest.md STEM/AI/Classification/Supervised.md STEM/AI/Classification/Supervised/README.md STEM/AI/Classification/Supervised/SVM.md STEM/AI/Classification/Supervised/Supervised.md STEM/AI/Learning.md STEM/AI/Neural Networks/Learning/Boltzmann.md STEM/AI/Neural Networks/Learning/Competitive Learning.md STEM/AI/Neural Networks/Learning/Credit-Assignment Problem.md STEM/AI/Neural Networks/Learning/Hebbian.md STEM/AI/Neural Networks/Learning/Learning.md STEM/AI/Neural Networks/Learning/README.md STEM/AI/Neural Networks/RNN/Autoencoder.md STEM/AI/Neural Networks/RNN/Deep Image Prior.md STEM/AI/Neural Networks/RNN/MoCo.md STEM/AI/Neural Networks/RNN/Representation Learning.md STEM/AI/Neural Networks/RNN/SimCLR.md STEM/img/comp-learning.png STEM/img/competitive-geometric.png STEM/img/confusion-matrix.png STEM/img/decision-tree.png STEM/img/deep-image-prior-arch.png STEM/img/deep-image-prior-results.png STEM/img/hebb-learning.png STEM/img/moco.png STEM/img/receiver-operator-curve.png STEM/img/reinforcement-learning.png STEM/img/rnn+autoencoder-variational.png STEM/img/rnn+autoencoder.png STEM/img/simclr.png STEM/img/sup-representation-learning.png STEM/img/svm-c.png STEM/img/svm-non-linear-project.png STEM/img/svm-non-linear-separated.png STEM/img/svm-non-linear.png STEM/img/svm-optimal-plane.png STEM/img/svm.png STEM/img/unsup-representation-learning.png
2023-06-07 09:02:27 +01:00
- SVC
- Regression
- SVR
vault backup: 2023-06-08 17:52:08 Affected files: .obsidian/graph.json .obsidian/workspace-mobile.json .obsidian/workspace.json Food/Meal Plan.md Lab/Linux/Alpine.md Lab/Linux/KDE.md Lab/Scratch Domain.md Lab/Windows/Active Directory.md Languages/Spanish/README.md Languages/Spanish/Spanish.md Money/Accounts.md Money/Monthly/23-04.md Money/Monthly/23-05.md Money/Monthly/23-06.md Projects/Mixonomer.md Projects/NoteCrawler.md Projects/Projects.md Projects/README.md Projects/Selector.md Projects/To Do App.md Projects/img/selector-arch.png STEM/AI/Classification/Supervised/SVM.md STEM/AI/Neural Networks/CNN/FCN/Super-Resolution.md STEM/AI/Neural Networks/CNN/GAN/GAN.md STEM/AI/Neural Networks/CNN/GAN/cGAN.md STEM/AI/Neural Networks/CNN/Interpretation.md STEM/AI/Neural Networks/Deep Learning.md STEM/AI/Neural Networks/MLP/MLP.md STEM/AI/Neural Networks/Properties+Capabilities.md STEM/AI/Neural Networks/RNN/Representation Learning.md STEM/AI/Pattern Matching/Markov/Markov.md STEM/AI/Searching/Informed.md STEM/AI/Searching/README.md STEM/AI/Searching/Searching.md STEM/AI/Searching/Uninformed.md STEM/CS/Languages/Javascript.md STEM/CS/Languages/Python.md STEM/CS/Languages/dotNet.md STEM/CS/Resources.md STEM/IOT/Cyber-Physical Systems.md STEM/IOT/Networking/Networking.md STEM/IOT/Networking/README.md STEM/IOT/Software Services.md STEM/img/cyberphysical-social-data.png STEM/img/cyberphysical-system-types.png STEM/img/cyberphysical-systems.png STEM/img/depth-first-cons.png STEM/img/depth-first.png STEM/img/iot-mesh-network.png STEM/img/iot-network-radar.png STEM/img/iot-network-types 1.png STEM/img/iot-network-types.png STEM/img/markov-start-end-matrix.png STEM/img/markov-start-end-probs.png STEM/img/markov-start-end.png STEM/img/markov-state-duration.png STEM/img/markov-state.png STEM/img/markov-weather.png STEM/img/search-bidirectional.png STEM/img/search-breadth-first.png STEM/img/search-lim-goal.png STEM/img/search-lim1.png STEM/img/search-lim2.png STEM/img/search-lim3-2.png STEM/img/search-lim3.png STEM/img/search-lim4.png STEM/img/searching-graph-tree.png STEM/img/searching-graph.png Work/Freelancing.md
2023-06-08 17:52:09 +01:00
- Alternative to Eigenmodels for [supervised](../../Learning.md#Supervised) classification
vault backup: 2023-06-07 09:02:27 Affected files: STEM/AI/Classification/Classification.md STEM/AI/Classification/Decision Trees.md STEM/AI/Classification/Gradient Boosting Machine.md STEM/AI/Classification/Logistic Regression.md STEM/AI/Classification/Random Forest.md STEM/AI/Classification/Supervised.md STEM/AI/Classification/Supervised/README.md STEM/AI/Classification/Supervised/SVM.md STEM/AI/Classification/Supervised/Supervised.md STEM/AI/Learning.md STEM/AI/Neural Networks/Learning/Boltzmann.md STEM/AI/Neural Networks/Learning/Competitive Learning.md STEM/AI/Neural Networks/Learning/Credit-Assignment Problem.md STEM/AI/Neural Networks/Learning/Hebbian.md STEM/AI/Neural Networks/Learning/Learning.md STEM/AI/Neural Networks/Learning/README.md STEM/AI/Neural Networks/RNN/Autoencoder.md STEM/AI/Neural Networks/RNN/Deep Image Prior.md STEM/AI/Neural Networks/RNN/MoCo.md STEM/AI/Neural Networks/RNN/Representation Learning.md STEM/AI/Neural Networks/RNN/SimCLR.md STEM/img/comp-learning.png STEM/img/competitive-geometric.png STEM/img/confusion-matrix.png STEM/img/decision-tree.png STEM/img/deep-image-prior-arch.png STEM/img/deep-image-prior-results.png STEM/img/hebb-learning.png STEM/img/moco.png STEM/img/receiver-operator-curve.png STEM/img/reinforcement-learning.png STEM/img/rnn+autoencoder-variational.png STEM/img/rnn+autoencoder.png STEM/img/simclr.png STEM/img/sup-representation-learning.png STEM/img/svm-c.png STEM/img/svm-non-linear-project.png STEM/img/svm-non-linear-separated.png STEM/img/svm-non-linear.png STEM/img/svm-optimal-plane.png STEM/img/svm.png STEM/img/unsup-representation-learning.png
2023-06-07 09:02:27 +01:00
- For smaller datasets
- Hard to scale on larger sets
![](../../../img/svm.png)
- Support vector points
- Closest points to the hyperplane
- Lines to hyperplane are support vectors
- Maximise margin between classes
- Take dot product of test point with vector perpendicular to support vector
- Sign determines class
# Pros
- Linear or non-linear discrimination
- Effective in higher dimensions
- Effective when number of features higher than training examples
- Best for when classes are separable
- Outliers have less impact
# Cons
- Long time for larger datasets
- Doesnt do well when overlapping
- Selecting appropriate kernel
# Parameters
- C
- How smooth the decision boundary is
- Larger C makes more curvy
- ![](../../../img/svm-c.png)
- Gamma
- Controls area of influence for data points
- High gamma reduces influence of faraway points
# Hyperplane
$$\beta_0+\beta_1X_1+\beta_2X_2+\cdot\cdot\cdot+\beta_pX_p=0$$
- $p$-dimensional space
- If $X$ satisfies equation
- On plane
- Maximal margin hyperplane
- Perpendicular distance from each observation to given plane
- Best plane has highest distance
- If support vector points shift
- Plane shifts
- Hyperplane only depends on the support vectors
- Rest don't matter
![](../../../img/svm-optimal-plane.png)
# Linearly Separable
- Not linearly separable
![](../../../img/svm-non-linear.png)
- Add another dimension
- $z=x^2+y^2$
- Square of the distance of the point from the origin
![](../../../img/svm-non-linear-project.png)
- Now separable
- Let $z=k$
- $k$ is a constant
- Project linear separator back to 2D
- Get circle
![](../../../img/svm-non-linear-separated.png)