SlideShare a Scribd company logo
1 of 19
Download to read offline
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)
Cubist Model
Cubist Model
Cubist is a prediction-oriented regression model
that combines the ideas in Quinlan (1992) and
Quinlan (1993).
Cubist Model
A tree is grown where the terminal leaves contain
linear regression models. These models are based
on the predictors used in previous splits. Also,
there are intermediate linear models at each step
of the tree. A prediction is made using the linear
regression model at the terminal node of the tree.
https://cran.r-project.org/web/packages/Cubist/vignettes/cubist.pdf
Cubist Model
The Cubist model first partitions the data into
subsets within which their characteristics are
similar with respect to the target variable and the
covariates. A series of rules (a decision tree
structure may also be defined if requested) defines
the partitions, and these rules are arranged in a
hierarchy.
Using R for Digital Soil Mapping - McBratney et al, 2016
Cubist Model
The Cubist model first partitions the data into
subsets within which their characteristics are
similar with respect to the target variable and the
covariates. A series of rules (a decision tree
structure may also be defined if requested) defines
the partitions, and these rules are arranged in a
hierarchy.
Using R for Digital Soil Mapping - McBratney et al, 2016
Each rule takes the form:
if [condition is true]
then [regress]
else
[apply the next rule]
Cubist Model
In R fitting a Cubist model is relatively easy —
although it will be useful to spend some time
playing around with many of the controllable
parameters that the function has
Using R for Digital Soil Mapping - McBratney et al, 2016
Cubist Model
In terms of specifying the target variable and covariates, we
do not define a formula as we did earlier for the MLR
model. Rather we specify the columns explicitly—those that
are the target variable (x), and those that are the covariates
(y).
Using R for Digital Soil Mapping - McBratney et al, 2016
> library(Cubist)
Loading required package: lattice
Cubist Model
In terms of specifying the target variable and covariates, we
do not define a formula as we did earlier for the MLR
model. Rather we specify the columns explicitly—those that
are the target variable (x), and those that are the covariates
(y).
Using R for Digital Soil Mapping - McBratney et al, 2016
library(Cubist)
Loading required package: lattice
trainingset <- sample(nrow(DSM_table2), 0.7 * nrow(DSM_table2))
mdata <-DSM_table2[training, ]
Cubist Model
In the example below we can control the number of
potential rules that could potentially partition the data
Using R for Digital Soil Mapping - McBratney et al, 2016
library(Cubist)
Loading required package: lattice
trainingset <- sample(nrow(DSM_table2), 0.7 * nrow(DSM_table2))
mdata <-DSM_table2[training, ]
Cubist Model
Now we can fit the model!
Using R for Digital Soil Mapping - McBratney et al, 2016
ModelC <- cubist(x = mdata[, c("dem", "twi", "slp", "prec", "tmpn",
"tmpd")], y = mdata$Value, cubistControl(rules = 5, extrapolation =
5),committees = 1)
PredictedC <- predict(ModelC, newdata = DSM_table2[training, ])
Cubist Model
The output from fitting a Cubist model can be retrieved
using the summary function. This provides information
about the conditions for each rule, the regression model for
each rule, and information about the diagnostics of the
model fit, plus the frequency of which the covariates were
used as conditions and/or within a model.
Using R for Digital Soil Mapping - McBratney et al, 2016
ModelC <- cubist(x = mdata[, c("dem", "twi", "slp", "prec", "tmpn",
"tmpd")], y = mdata$Value, cubistControl(rules = 5, extrapolation =
5),committees = 1)
Cubist Model
The output from fitting a Cubist model can be retrieved
using the summary function. This provides information
about the conditions for each rule, the regression model for
each rule, and information about the diagnostics of the
model fit, plus the frequency of which the covariates were
used as conditions and/or within a model.
Using R for Digital Soil Mapping - B P Malone et al, 2016
Cubist Model
Using R for Digital Soil Mapping - McBratney et al, 2016
> summary(ModelC)
Call: cubist.default(x = mdata[, c("dem", "twi", "slp", "prec", "tmpn",
"tmpd")], y = mdata$Value, committees = 1, control
= cubistControl(rules = 5, extrapolation = 5))
Rule 1: [858 cases, mean 1.3514910, range 0.07426247 to 5.765974, est
err 0.5042074]
if
dem > 576
tmpd > 291
then
outcome = 12.3277068 + 0.024 slp - 0.04 tmpn
Cubist Model
Using R for Digital Soil Mapping - McBratney et al, 2016
Rule 2: [767 cases, mean 1.5268759, range 0 to 6.617897, est err
0.5753750]
if
dem <= 576
tmpd > 291
then
outcome = -1.5564033 + 0.00182 dem + 0.0024 prec + 0.011 twi
Rule 3: [437 cases, mean 2.1162884, range 0 to 7.916972, est err
0.7406893]
if
dem > 425
dem <= 1120
tmpd <= 291
then
outcome = 64.0021631 - 0.215 tmpd + 0.02 slp
Cubist Model
Using R for Digital Soil Mapping - McBratney et al, 2016
Rule 4: [228 cases, mean 3.9560454, range 0 to 13.29358, est err
1.3056889]
if
dem > 1120
tmpd <= 291
then
outcome = 24.2396342 + 0.00185 dem - 0.079 tmpd - 0.006 twi
Rule 5: [20 cases, mean 10.2624750, range 0.9238458 to 50.33235, est
err 9.4497499]
if
dem <= 425
tmpd <= 291
then
outcome = 2.414286
Cubist Model
Using R for Digital Soil Mapping - McBratney et al, 2016
> RMSE <- sqrt(mean((mdata$Value - PredictedC)^2))
> RMSE
[1] 1.915229
> bias <- mean(PredictedC) - mean(mdata$Value)
> bias
[1] -0.2119047
Lets see how well it validates.
Cubist Model
Using R for Digital Soil Mapping - McBratney et al, 2016
MapSOCC <- predict(covStack, PredictedC, "carbonMC_Cubist.tif",
format = "GTiff", datatype = "FLT4S", overwrite = TRUE)
Creating the map resulting from the
PredictedC model can be implemented as
before (random forest) using the raster predict
function
Cubist Model
Using R for Digital Soil Mapping - McBratney et al, 2016
MapSOCC <- predict(covStack, PredictedC, "carbonMC_Cubist.tif",
format = "GTiff", datatype = "FLT4S", overwrite = TRUE)
Creating the map resulting from the
edge.cub.Exp model can be implemented as
before (randomfrorest) using the raster predict
function

More Related Content

Similar to Cubist model FAO-Global Soil Partnership training 2018.pdf

A Hybrid Data Clustering Approach using K-Means and Simplex Method-based Bact...
A Hybrid Data Clustering Approach using K-Means and Simplex Method-based Bact...A Hybrid Data Clustering Approach using K-Means and Simplex Method-based Bact...
A Hybrid Data Clustering Approach using K-Means and Simplex Method-based Bact...IRJET Journal
 
Optimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering AlgorithmOptimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering AlgorithmIJERA Editor
 
House Sale Price Prediction
House Sale Price PredictionHouse Sale Price Prediction
House Sale Price Predictionsriram30691
 
Sequential estimation of_discrete_choice_models__copy_-4
Sequential estimation of_discrete_choice_models__copy_-4Sequential estimation of_discrete_choice_models__copy_-4
Sequential estimation of_discrete_choice_models__copy_-4YoussefKitane
 
Off-Policy Deep Reinforcement Learning without Exploration.pdf
Off-Policy Deep Reinforcement Learning without Exploration.pdfOff-Policy Deep Reinforcement Learning without Exploration.pdf
Off-Policy Deep Reinforcement Learning without Exploration.pdfPo-Chuan Chen
 
Anomaly Detection in Temporal data Using Kmeans Clustering with C5.0
Anomaly Detection in Temporal data Using Kmeans Clustering with C5.0Anomaly Detection in Temporal data Using Kmeans Clustering with C5.0
Anomaly Detection in Temporal data Using Kmeans Clustering with C5.0theijes
 
COMPARATIVE PERFORMANCE ANALYSIS OF RNSC AND MCL ALGORITHMS ON POWER-LAW DIST...
COMPARATIVE PERFORMANCE ANALYSIS OF RNSC AND MCL ALGORITHMS ON POWER-LAW DIST...COMPARATIVE PERFORMANCE ANALYSIS OF RNSC AND MCL ALGORITHMS ON POWER-LAW DIST...
COMPARATIVE PERFORMANCE ANALYSIS OF RNSC AND MCL ALGORITHMS ON POWER-LAW DIST...acijjournal
 
Project seminar ppt_steelcasting
Project seminar ppt_steelcastingProject seminar ppt_steelcasting
Project seminar ppt_steelcastingRudra Narayan Paul
 
SupportVectorRegression
SupportVectorRegressionSupportVectorRegression
SupportVectorRegressionDaniel K
 
Exploring Support Vector Regression - Signals and Systems Project
Exploring Support Vector Regression - Signals and Systems ProjectExploring Support Vector Regression - Signals and Systems Project
Exploring Support Vector Regression - Signals and Systems ProjectSurya Chandra
 
FR3.L09 - MULTIBASELINE GRADIENT AMBIGUITY RESOLUTION TO SUPPORT MINIMUM COST...
FR3.L09 - MULTIBASELINE GRADIENT AMBIGUITY RESOLUTION TO SUPPORT MINIMUM COST...FR3.L09 - MULTIBASELINE GRADIENT AMBIGUITY RESOLUTION TO SUPPORT MINIMUM COST...
FR3.L09 - MULTIBASELINE GRADIENT AMBIGUITY RESOLUTION TO SUPPORT MINIMUM COST...grssieee
 
Validation Study of Dimensionality Reduction Impact on Breast Cancer Classifi...
Validation Study of Dimensionality Reduction Impact on Breast Cancer Classifi...Validation Study of Dimensionality Reduction Impact on Breast Cancer Classifi...
Validation Study of Dimensionality Reduction Impact on Breast Cancer Classifi...ijcsit
 
safe and efficient off policy reinforcement learning
safe and efficient off policy reinforcement learningsafe and efficient off policy reinforcement learning
safe and efficient off policy reinforcement learningRyo Iwaki
 
Clustering techniques
Clustering techniquesClustering techniques
Clustering techniquestalktoharry
 
LIDAR- Light Detection and Ranging.
LIDAR- Light Detection and Ranging.LIDAR- Light Detection and Ranging.
LIDAR- Light Detection and Ranging.Gaurav Agarwal
 
IRJET- Customer Segmentation from Massive Customer Transaction Data
IRJET- Customer Segmentation from Massive Customer Transaction DataIRJET- Customer Segmentation from Massive Customer Transaction Data
IRJET- Customer Segmentation from Massive Customer Transaction DataIRJET Journal
 

Similar to Cubist model FAO-Global Soil Partnership training 2018.pdf (20)

A Hybrid Data Clustering Approach using K-Means and Simplex Method-based Bact...
A Hybrid Data Clustering Approach using K-Means and Simplex Method-based Bact...A Hybrid Data Clustering Approach using K-Means and Simplex Method-based Bact...
A Hybrid Data Clustering Approach using K-Means and Simplex Method-based Bact...
 
Dm
DmDm
Dm
 
Optimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering AlgorithmOptimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering Algorithm
 
House Sale Price Prediction
House Sale Price PredictionHouse Sale Price Prediction
House Sale Price Prediction
 
Sequential estimation of_discrete_choice_models__copy_-4
Sequential estimation of_discrete_choice_models__copy_-4Sequential estimation of_discrete_choice_models__copy_-4
Sequential estimation of_discrete_choice_models__copy_-4
 
Off-Policy Deep Reinforcement Learning without Exploration.pdf
Off-Policy Deep Reinforcement Learning without Exploration.pdfOff-Policy Deep Reinforcement Learning without Exploration.pdf
Off-Policy Deep Reinforcement Learning without Exploration.pdf
 
Anomaly Detection in Temporal data Using Kmeans Clustering with C5.0
Anomaly Detection in Temporal data Using Kmeans Clustering with C5.0Anomaly Detection in Temporal data Using Kmeans Clustering with C5.0
Anomaly Detection in Temporal data Using Kmeans Clustering with C5.0
 
COMPARATIVE PERFORMANCE ANALYSIS OF RNSC AND MCL ALGORITHMS ON POWER-LAW DIST...
COMPARATIVE PERFORMANCE ANALYSIS OF RNSC AND MCL ALGORITHMS ON POWER-LAW DIST...COMPARATIVE PERFORMANCE ANALYSIS OF RNSC AND MCL ALGORITHMS ON POWER-LAW DIST...
COMPARATIVE PERFORMANCE ANALYSIS OF RNSC AND MCL ALGORITHMS ON POWER-LAW DIST...
 
Project seminar ppt_steelcasting
Project seminar ppt_steelcastingProject seminar ppt_steelcasting
Project seminar ppt_steelcasting
 
SupportVectorRegression
SupportVectorRegressionSupportVectorRegression
SupportVectorRegression
 
Exploring Support Vector Regression - Signals and Systems Project
Exploring Support Vector Regression - Signals and Systems ProjectExploring Support Vector Regression - Signals and Systems Project
Exploring Support Vector Regression - Signals and Systems Project
 
FR3.L09 - MULTIBASELINE GRADIENT AMBIGUITY RESOLUTION TO SUPPORT MINIMUM COST...
FR3.L09 - MULTIBASELINE GRADIENT AMBIGUITY RESOLUTION TO SUPPORT MINIMUM COST...FR3.L09 - MULTIBASELINE GRADIENT AMBIGUITY RESOLUTION TO SUPPORT MINIMUM COST...
FR3.L09 - MULTIBASELINE GRADIENT AMBIGUITY RESOLUTION TO SUPPORT MINIMUM COST...
 
Validation Study of Dimensionality Reduction Impact on Breast Cancer Classifi...
Validation Study of Dimensionality Reduction Impact on Breast Cancer Classifi...Validation Study of Dimensionality Reduction Impact on Breast Cancer Classifi...
Validation Study of Dimensionality Reduction Impact on Breast Cancer Classifi...
 
M2R Group 26
M2R Group 26M2R Group 26
M2R Group 26
 
PCA and SVD in brief
PCA and SVD in briefPCA and SVD in brief
PCA and SVD in brief
 
safe and efficient off policy reinforcement learning
safe and efficient off policy reinforcement learningsafe and efficient off policy reinforcement learning
safe and efficient off policy reinforcement learning
 
Clustering techniques
Clustering techniquesClustering techniques
Clustering techniques
 
06466595
0646659506466595
06466595
 
LIDAR- Light Detection and Ranging.
LIDAR- Light Detection and Ranging.LIDAR- Light Detection and Ranging.
LIDAR- Light Detection and Ranging.
 
IRJET- Customer Segmentation from Massive Customer Transaction Data
IRJET- Customer Segmentation from Massive Customer Transaction DataIRJET- Customer Segmentation from Massive Customer Transaction Data
IRJET- Customer Segmentation from Massive Customer Transaction Data
 

Recently uploaded

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 

Recently uploaded (20)

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 

Cubist model FAO-Global Soil Partnership training 2018.pdf

  • 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)
  • 3. Cubist Model Cubist is a prediction-oriented regression model that combines the ideas in Quinlan (1992) and Quinlan (1993).
  • 4. Cubist Model A tree is grown where the terminal leaves contain linear regression models. These models are based on the predictors used in previous splits. Also, there are intermediate linear models at each step of the tree. A prediction is made using the linear regression model at the terminal node of the tree. https://cran.r-project.org/web/packages/Cubist/vignettes/cubist.pdf
  • 5. Cubist Model The Cubist model first partitions the data into subsets within which their characteristics are similar with respect to the target variable and the covariates. A series of rules (a decision tree structure may also be defined if requested) defines the partitions, and these rules are arranged in a hierarchy. Using R for Digital Soil Mapping - McBratney et al, 2016
  • 6. Cubist Model The Cubist model first partitions the data into subsets within which their characteristics are similar with respect to the target variable and the covariates. A series of rules (a decision tree structure may also be defined if requested) defines the partitions, and these rules are arranged in a hierarchy. Using R for Digital Soil Mapping - McBratney et al, 2016 Each rule takes the form: if [condition is true] then [regress] else [apply the next rule]
  • 7. Cubist Model In R fitting a Cubist model is relatively easy — although it will be useful to spend some time playing around with many of the controllable parameters that the function has Using R for Digital Soil Mapping - McBratney et al, 2016
  • 8. Cubist Model In terms of specifying the target variable and covariates, we do not define a formula as we did earlier for the MLR model. Rather we specify the columns explicitly—those that are the target variable (x), and those that are the covariates (y). Using R for Digital Soil Mapping - McBratney et al, 2016 > library(Cubist) Loading required package: lattice
  • 9. Cubist Model In terms of specifying the target variable and covariates, we do not define a formula as we did earlier for the MLR model. Rather we specify the columns explicitly—those that are the target variable (x), and those that are the covariates (y). Using R for Digital Soil Mapping - McBratney et al, 2016 library(Cubist) Loading required package: lattice trainingset <- sample(nrow(DSM_table2), 0.7 * nrow(DSM_table2)) mdata <-DSM_table2[training, ]
  • 10. Cubist Model In the example below we can control the number of potential rules that could potentially partition the data Using R for Digital Soil Mapping - McBratney et al, 2016 library(Cubist) Loading required package: lattice trainingset <- sample(nrow(DSM_table2), 0.7 * nrow(DSM_table2)) mdata <-DSM_table2[training, ]
  • 11. Cubist Model Now we can fit the model! Using R for Digital Soil Mapping - McBratney et al, 2016 ModelC <- cubist(x = mdata[, c("dem", "twi", "slp", "prec", "tmpn", "tmpd")], y = mdata$Value, cubistControl(rules = 5, extrapolation = 5),committees = 1) PredictedC <- predict(ModelC, newdata = DSM_table2[training, ])
  • 12. Cubist Model The output from fitting a Cubist model can be retrieved using the summary function. This provides information about the conditions for each rule, the regression model for each rule, and information about the diagnostics of the model fit, plus the frequency of which the covariates were used as conditions and/or within a model. Using R for Digital Soil Mapping - McBratney et al, 2016 ModelC <- cubist(x = mdata[, c("dem", "twi", "slp", "prec", "tmpn", "tmpd")], y = mdata$Value, cubistControl(rules = 5, extrapolation = 5),committees = 1)
  • 13. Cubist Model The output from fitting a Cubist model can be retrieved using the summary function. This provides information about the conditions for each rule, the regression model for each rule, and information about the diagnostics of the model fit, plus the frequency of which the covariates were used as conditions and/or within a model. Using R for Digital Soil Mapping - B P Malone et al, 2016
  • 14. Cubist Model Using R for Digital Soil Mapping - McBratney et al, 2016 > summary(ModelC) Call: cubist.default(x = mdata[, c("dem", "twi", "slp", "prec", "tmpn", "tmpd")], y = mdata$Value, committees = 1, control = cubistControl(rules = 5, extrapolation = 5)) Rule 1: [858 cases, mean 1.3514910, range 0.07426247 to 5.765974, est err 0.5042074] if dem > 576 tmpd > 291 then outcome = 12.3277068 + 0.024 slp - 0.04 tmpn
  • 15. Cubist Model Using R for Digital Soil Mapping - McBratney et al, 2016 Rule 2: [767 cases, mean 1.5268759, range 0 to 6.617897, est err 0.5753750] if dem <= 576 tmpd > 291 then outcome = -1.5564033 + 0.00182 dem + 0.0024 prec + 0.011 twi Rule 3: [437 cases, mean 2.1162884, range 0 to 7.916972, est err 0.7406893] if dem > 425 dem <= 1120 tmpd <= 291 then outcome = 64.0021631 - 0.215 tmpd + 0.02 slp
  • 16. Cubist Model Using R for Digital Soil Mapping - McBratney et al, 2016 Rule 4: [228 cases, mean 3.9560454, range 0 to 13.29358, est err 1.3056889] if dem > 1120 tmpd <= 291 then outcome = 24.2396342 + 0.00185 dem - 0.079 tmpd - 0.006 twi Rule 5: [20 cases, mean 10.2624750, range 0.9238458 to 50.33235, est err 9.4497499] if dem <= 425 tmpd <= 291 then outcome = 2.414286
  • 17. Cubist Model Using R for Digital Soil Mapping - McBratney et al, 2016 > RMSE <- sqrt(mean((mdata$Value - PredictedC)^2)) > RMSE [1] 1.915229 > bias <- mean(PredictedC) - mean(mdata$Value) > bias [1] -0.2119047 Lets see how well it validates.
  • 18. Cubist Model Using R for Digital Soil Mapping - McBratney et al, 2016 MapSOCC <- predict(covStack, PredictedC, "carbonMC_Cubist.tif", format = "GTiff", datatype = "FLT4S", overwrite = TRUE) Creating the map resulting from the PredictedC model can be implemented as before (random forest) using the raster predict function
  • 19. Cubist Model Using R for Digital Soil Mapping - McBratney et al, 2016 MapSOCC <- predict(covStack, PredictedC, "carbonMC_Cubist.tif", format = "GTiff", datatype = "FLT4S", overwrite = TRUE) Creating the map resulting from the edge.cub.Exp model can be implemented as before (randomfrorest) using the raster predict function