SlideShare a Scribd company logo
FAO- Global Soil
Partnership
Training on
Digital Soil Organic Carbon
Mapping
20-24 January 2018
Tehran/Iran
Yusuf YIGINI, PhD - FAO, Land and Water Division (CBL)
Guillermo Federico Olmedo, PhD - FAO, Land and Water Division (CBL)
SVM
Support Vector Machines
SVM apply a simple linear method to the data but
in a high-dimensional feature space non-linearly
related to the input space. It creates a hyperplane
through n-dimensional spectral-space. Then, SVM
separates numerical data based on a kernel
function and parameters (e.g. gamma and cost)
that maximize the margin from the closest point to
the hyperplane that divides data with the largest
possible margin, being the support vectors the
points which fall within. Then, linear models are
fitted to the support vectors.
Support Vector Machines
A major benefit of using SVR is that it is a non-
parametric technique. Unlike SLR, whose results
depend on Gauss-Markov assumptions, the output
model from SVR does not depend on distributions
of the underlying dependent and independent
variables. Instead the SVR technique depends on
kernel functions.
https://www.kdnuggets.com/2017/03/building-regression-models-support-vector-regression.html
Support Vector Machines
Another advantage of SVR is that it permits for
construction of a non-linear model without
changing the explanatory variables, helping in
better interpretation of the resultant model. The
basic idea behind SVR is not to care about the
prediction as long as the error (ϵ) is less than
certain value.
https://www.kdnuggets.com/2017/03/building-regression-models-support-vector-regression.html
Support Vector Machines
https://www.kdnuggets.com/2017/03/building-
regression-models-support-vector-regression.html
https://www.kdnuggets.com/2017/03/building-regression-models-support-vector-regression.html
Support Vector Machines
Using R for Digital Soil Mapping - McBratney et al, 2016
dat <- read.csv("MKD_RegMatrix1.csv")
names(dat)
[1] "X.1" "id" "Y" "X" "SOC" "BLD"
"CRFVOL" "OCSKGM" "meaERROR" "B04CHE3"
[11] "B07CHE3" "B13CHE3" "B14CHE3" "DEMENV5" "LCEE10" "PRSCHE3"
"SLPMRG5" "TMDMOD3" "TMNMOD3" "TWIMRG5"
[21] "VBFMRG5" "VDPMRG5" "soilmap"
Import data > MKD_RegMatrix.csv
Support Vector Machines
names(dat)
COR <- cor(as.matrix(dat[,7]), as.matrix(dat[,-c(1:8)]))
COR
x <- subset(melt(COR), value != 1 | value != NA)
x <- x[with(x, order(-abs(x$value))),]
x[1:25,]
idx <- as.character(x$X2[1:25])
Correlation analysis to select covariates
Support Vector Machines
dat2 <- dat[c('OCSKGM', idx),]
names(dat2)
files <- list.files(path = "covs", pattern = "tif$",
+ full.names = TRUE)
COV <- stack(files)
COV <- COV[[idx]]
plot(COV)
Support Vector Machines
tuneResult <- tune(svm, OCSKGM ~., data = dat[,c("OCSKGM",
names(COV))],
ranges = list(epsilon = seq(0,1,0.1),
cost = c(.5,1,1.5,2,5,10))
)
# Choose the model with the best combination of epsilon and cost
tunedModel <- tuneResult$best.model
Testing the different values for epsilon and cost!
C is a regularization parameter that controls the trade off
between the achieving a low training error and a low testing
error that is the ability to generalize your classifier to unseen
data.
Support Vector Machines
tuneresult
Parameter tuning of ‘svm’:
- sampling method: 10-fold cross validation
- best parameters:
epsilon cost
0.4 5
- best performance: 0.7649055
Plot(tuneResult)
The best model is the one with lowest MSE. The darker the
region the lower the MSE, which means better the model. In our
sample data MSE is lowest at epsilon - 0 and cost – 7.
Support Vector Machines
Plot(tuneResult)
Testing the different values for epsilon and cost!
C is a regularization parameter that controls the trade off
between the achieving a low training error and a low testing
error that is the ability to generalize your classifier to unseen
data.
SVM
# Use the model to predict the SOC in the covariates space
beginCluster()
start <- Sys.time()
pred <- clusterR(COV, predict, args=list(tunedModel))
print(Sys.time() - start)
endCluster()
plot(pred)
SVM
# Use the model to predict the SOC in the covariates space
beginCluster()
start <- Sys.time()
pred <- clusterR(COV, predict, args=list(tunedModel))
print(Sys.time() - start)
endCluster()
plot(pred)

More Related Content

PPTX
Support Vector Machines
PDF
Bias and variance trade off
PPTX
Machine Learning - Accuracy and Confusion Matrix
PDF
Classification Based Machine Learning Algorithms
PDF
linear classification
PDF
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
PPTX
Lecture 6: Ensemble Methods
PDF
Introduction to Machine Learning Classifiers
Support Vector Machines
Bias and variance trade off
Machine Learning - Accuracy and Confusion Matrix
Classification Based Machine Learning Algorithms
linear classification
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
Lecture 6: Ensemble Methods
Introduction to Machine Learning Classifiers

What's hot (20)

PPTX
Machine Learning - Splitting Datasets
PPT
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han &amp; Kamber
PPTX
Deep Learning - CNN and RNN
PPTX
Support Vector Machine ppt presentation
PPTX
Natural language processing: feature extraction
PPTX
Support vector machine
PPTX
Decision tree induction \ Decision Tree Algorithm with Example| Data science
PPTX
Naive Bayes Classifier | Naive Bayes Algorithm | Naive Bayes Classifier With ...
PPTX
Curse of dimensionality
PPTX
Knn 160904075605-converted
PPTX
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
PDF
Principal Component Analysis
PDF
What is the Expectation Maximization (EM) Algorithm?
PDF
Machine Learning: Generative and Discriminative Models
PPTX
K-Folds Cross Validation Method
PPT
PPTX
K-Nearest Neighbor Classifier
PPT
Machine Learning 3 - Decision Tree Learning
PPTX
Naive bayes
PPTX
Feature selection concepts and methods
Machine Learning - Splitting Datasets
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han &amp; Kamber
Deep Learning - CNN and RNN
Support Vector Machine ppt presentation
Natural language processing: feature extraction
Support vector machine
Decision tree induction \ Decision Tree Algorithm with Example| Data science
Naive Bayes Classifier | Naive Bayes Algorithm | Naive Bayes Classifier With ...
Curse of dimensionality
Knn 160904075605-converted
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
Principal Component Analysis
What is the Expectation Maximization (EM) Algorithm?
Machine Learning: Generative and Discriminative Models
K-Folds Cross Validation Method
K-Nearest Neighbor Classifier
Machine Learning 3 - Decision Tree Learning
Naive bayes
Feature selection concepts and methods
Ad

Similar to Support Vector Machines (SVM) (20)

PPTX
Leveraging R in Big Data of Mobile Ads (R在行動廣告大數據的應用)
PDF
PDF
Data preparation covariates
 
PPTX
R Language Introduction
PDF
Two methods for optimising cognitive model parameters
PPTX
description description description description
PDF
Perm winter school 2014.01.31
PDF
Practical data science_public
PPTX
Seminar PSU 10.10.2014 mme
PDF
Building data fusion surrogate models for spacecraft aerodynamic problems wit...
PPTX
Introduction to R
PDF
Area efficient parallel LFSR for cyclic redundancy check
PPT
TH1.L10.5: VALIDATION OF TIE-POINT CONCEPTS BY THE DEM ADJUSTMENT APPROACH OF...
PDF
spatial analysis introduction and vector type of data.pdf
PDF
Discrete wavelet transform-based RI adaptive algorithm for system identification
PDF
EE660_Report_YaxinLiu_8448347171
PDF
Time Series Analysis and Mining with R
PDF
Research on automated guided vehicle (AGV) path tracking control based on la...
PPTX
Seminar psu 20.10.2013
PPTX
Traffic sign detection via graph based ranking and segmentation
Leveraging R in Big Data of Mobile Ads (R在行動廣告大數據的應用)
Data preparation covariates
 
R Language Introduction
Two methods for optimising cognitive model parameters
description description description description
Perm winter school 2014.01.31
Practical data science_public
Seminar PSU 10.10.2014 mme
Building data fusion surrogate models for spacecraft aerodynamic problems wit...
Introduction to R
Area efficient parallel LFSR for cyclic redundancy check
TH1.L10.5: VALIDATION OF TIE-POINT CONCEPTS BY THE DEM ADJUSTMENT APPROACH OF...
spatial analysis introduction and vector type of data.pdf
Discrete wavelet transform-based RI adaptive algorithm for system identification
EE660_Report_YaxinLiu_8448347171
Time Series Analysis and Mining with R
Research on automated guided vehicle (AGV) path tracking control based on la...
Seminar psu 20.10.2013
Traffic sign detection via graph based ranking and segmentation
Ad

More from FAO (20)

PPTX
Nigeria
 
PPT
Niger
 
PPT
Namibia
 
PPT
Mozambique
 
PPT
Zimbabwe takesure
 
PPT
Zimbabwe
 
PPT
Zambia
 
PPT
Togo
 
PPT
Tanzania
 
PPT
Spal presentation
 
PPT
Rwanda
 
PPT
Nigeria uponi
 
PPTX
The multi-faced role of soil in the NENA regions (part 2)
 
PPTX
The multi-faced role of soil in the NENA regions (part 1)
 
PDF
Agenda of the launch of the soil policy brief at the Land&Water Days
 
PDF
Agenda of the 5th NENA Soil Partnership meeting
 
PPTX
The Voluntary Guidelines for Sustainable Soil Management
 
PPTX
GLOSOLAN - Mission, status and way forward
 
PPTX
Towards a Global Soil Information System (GLOSIS)
 
PPTX
GSP developments of regional interest in 2019
 
Nigeria
 
Niger
 
Namibia
 
Mozambique
 
Zimbabwe takesure
 
Zimbabwe
 
Zambia
 
Togo
 
Tanzania
 
Spal presentation
 
Rwanda
 
Nigeria uponi
 
The multi-faced role of soil in the NENA regions (part 2)
 
The multi-faced role of soil in the NENA regions (part 1)
 
Agenda of the launch of the soil policy brief at the Land&Water Days
 
Agenda of the 5th NENA Soil Partnership meeting
 
The Voluntary Guidelines for Sustainable Soil Management
 
GLOSOLAN - Mission, status and way forward
 
Towards a Global Soil Information System (GLOSIS)
 
GSP developments of regional interest in 2019
 

Recently uploaded (20)

PPTX
master seminar digital applications in india
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Pharma ospi slides which help in ospi learning
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Cell Types and Its function , kingdom of life
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Lesson notes of climatology university.
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Classroom Observation Tools for Teachers
PDF
Computing-Curriculum for Schools in Ghana
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
master seminar digital applications in india
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Sports Quiz easy sports quiz sports quiz
Pharma ospi slides which help in ospi learning
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Supply Chain Operations Speaking Notes -ICLT Program
Cell Types and Its function , kingdom of life
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Final Presentation General Medicine 03-08-2024.pptx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Basic Mud Logging Guide for educational purpose
Lesson notes of climatology university.
O7-L3 Supply Chain Operations - ICLT Program
Classroom Observation Tools for Teachers
Computing-Curriculum for Schools in Ghana
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Anesthesia in Laparoscopic Surgery in India
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx

Support Vector Machines (SVM)

  • 1. FAO- Global Soil Partnership Training on Digital Soil Organic Carbon Mapping 20-24 January 2018 Tehran/Iran Yusuf YIGINI, PhD - FAO, Land and Water Division (CBL) Guillermo Federico Olmedo, PhD - FAO, Land and Water Division (CBL)
  • 2. SVM
  • 3. Support Vector Machines SVM apply a simple linear method to the data but in a high-dimensional feature space non-linearly related to the input space. It creates a hyperplane through n-dimensional spectral-space. Then, SVM separates numerical data based on a kernel function and parameters (e.g. gamma and cost) that maximize the margin from the closest point to the hyperplane that divides data with the largest possible margin, being the support vectors the points which fall within. Then, linear models are fitted to the support vectors.
  • 4. Support Vector Machines A major benefit of using SVR is that it is a non- parametric technique. Unlike SLR, whose results depend on Gauss-Markov assumptions, the output model from SVR does not depend on distributions of the underlying dependent and independent variables. Instead the SVR technique depends on kernel functions. https://www.kdnuggets.com/2017/03/building-regression-models-support-vector-regression.html
  • 5. Support Vector Machines Another advantage of SVR is that it permits for construction of a non-linear model without changing the explanatory variables, helping in better interpretation of the resultant model. The basic idea behind SVR is not to care about the prediction as long as the error (ϵ) is less than certain value. https://www.kdnuggets.com/2017/03/building-regression-models-support-vector-regression.html
  • 7. Support Vector Machines Using R for Digital Soil Mapping - McBratney et al, 2016 dat <- read.csv("MKD_RegMatrix1.csv") names(dat) [1] "X.1" "id" "Y" "X" "SOC" "BLD" "CRFVOL" "OCSKGM" "meaERROR" "B04CHE3" [11] "B07CHE3" "B13CHE3" "B14CHE3" "DEMENV5" "LCEE10" "PRSCHE3" "SLPMRG5" "TMDMOD3" "TMNMOD3" "TWIMRG5" [21] "VBFMRG5" "VDPMRG5" "soilmap" Import data > MKD_RegMatrix.csv
  • 8. Support Vector Machines names(dat) COR <- cor(as.matrix(dat[,7]), as.matrix(dat[,-c(1:8)])) COR x <- subset(melt(COR), value != 1 | value != NA) x <- x[with(x, order(-abs(x$value))),] x[1:25,] idx <- as.character(x$X2[1:25]) Correlation analysis to select covariates
  • 9. Support Vector Machines dat2 <- dat[c('OCSKGM', idx),] names(dat2) files <- list.files(path = "covs", pattern = "tif$", + full.names = TRUE) COV <- stack(files) COV <- COV[[idx]] plot(COV)
  • 10. Support Vector Machines tuneResult <- tune(svm, OCSKGM ~., data = dat[,c("OCSKGM", names(COV))], ranges = list(epsilon = seq(0,1,0.1), cost = c(.5,1,1.5,2,5,10)) ) # Choose the model with the best combination of epsilon and cost tunedModel <- tuneResult$best.model Testing the different values for epsilon and cost! C is a regularization parameter that controls the trade off between the achieving a low training error and a low testing error that is the ability to generalize your classifier to unseen data.
  • 11. Support Vector Machines tuneresult Parameter tuning of ‘svm’: - sampling method: 10-fold cross validation - best parameters: epsilon cost 0.4 5 - best performance: 0.7649055 Plot(tuneResult) The best model is the one with lowest MSE. The darker the region the lower the MSE, which means better the model. In our sample data MSE is lowest at epsilon - 0 and cost – 7.
  • 12. Support Vector Machines Plot(tuneResult) Testing the different values for epsilon and cost! C is a regularization parameter that controls the trade off between the achieving a low training error and a low testing error that is the ability to generalize your classifier to unseen data.
  • 13. SVM # Use the model to predict the SOC in the covariates space beginCluster() start <- Sys.time() pred <- clusterR(COV, predict, args=list(tunedModel)) print(Sys.time() - start) endCluster() plot(pred)
  • 14. SVM # Use the model to predict the SOC in the covariates space beginCluster() start <- Sys.time() pred <- clusterR(COV, predict, args=list(tunedModel)) print(Sys.time() - start) endCluster() plot(pred)