SlideShare a Scribd company logo
1 of 19
Download to read offline
Yusuf YIGINI, PhD - FAO, Land and Water Division (CBL)
GSP - Eurasian Soil
Partnership - Dijital
Toprak Haritalama ve
Modelleme Egitimi
Izmir, Turkiye
21-25 Agustos 2017
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

What's hot

Advanced Stability Analysis of Control Systems with Variable Parameters
Advanced Stability Analysis of Control Systems with Variable ParametersAdvanced Stability Analysis of Control Systems with Variable Parameters
Advanced Stability Analysis of Control Systems with Variable Parametersjournal ijrtem
 
Algebra 6 Point 2
Algebra 6 Point 2Algebra 6 Point 2
Algebra 6 Point 2herbison
 
Ijciras1101
Ijciras1101Ijciras1101
Ijciras1101zhendy94
 
Multidimension Scaling and Isomap
Multidimension Scaling and IsomapMultidimension Scaling and Isomap
Multidimension Scaling and IsomapCheng-Shiang Li
 
Visualization using tSNE
Visualization using tSNEVisualization using tSNE
Visualization using tSNEYan Xu
 
Data scientist training in bangalore
Data scientist training in bangaloreData scientist training in bangalore
Data scientist training in bangaloreprathyusha1234
 

What's hot (9)

Advanced Stability Analysis of Control Systems with Variable Parameters
Advanced Stability Analysis of Control Systems with Variable ParametersAdvanced Stability Analysis of Control Systems with Variable Parameters
Advanced Stability Analysis of Control Systems with Variable Parameters
 
Algebra 6 Point 2
Algebra 6 Point 2Algebra 6 Point 2
Algebra 6 Point 2
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Ijciras1101
Ijciras1101Ijciras1101
Ijciras1101
 
Multidimension Scaling and Isomap
Multidimension Scaling and IsomapMultidimension Scaling and Isomap
Multidimension Scaling and Isomap
 
Principal component analysis
Principal component analysisPrincipal component analysis
Principal component analysis
 
8.1
8.18.1
8.1
 
Visualization using tSNE
Visualization using tSNEVisualization using tSNE
Visualization using tSNE
 
Data scientist training in bangalore
Data scientist training in bangaloreData scientist training in bangalore
Data scientist training in bangalore
 

Similar to 14. Cubist

13. Cubist
13. Cubist13. Cubist
13. CubistFAO
 
Cubist model FAO-Global Soil Partnership training 2018.pdf
Cubist model FAO-Global Soil Partnership training 2018.pdfCubist model FAO-Global Soil Partnership training 2018.pdf
Cubist model FAO-Global Soil Partnership training 2018.pdfirrosennen
 
Cubist
CubistCubist
CubistFAO
 
Different Types of Machine Learning Algorithms
Different Types of Machine Learning AlgorithmsDifferent Types of Machine Learning Algorithms
Different Types of Machine Learning Algorithmsrahmedraj93
 
Matrix Factorization In Recommender Systems
Matrix Factorization In Recommender SystemsMatrix Factorization In Recommender Systems
Matrix Factorization In Recommender SystemsYONG ZHENG
 
Caret Package for R
Caret Package for RCaret Package for R
Caret Package for Rkmettler
 
Caret max kuhn
Caret max kuhnCaret max kuhn
Caret max kuhnkmettler
 
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
 
House Sale Price Prediction
House Sale Price PredictionHouse Sale Price Prediction
House Sale Price Predictionsriram30691
 
Ml srhwt-machine-learning-based-superlative-rapid-haar-wavelet-transformation...
Ml srhwt-machine-learning-based-superlative-rapid-haar-wavelet-transformation...Ml srhwt-machine-learning-based-superlative-rapid-haar-wavelet-transformation...
Ml srhwt-machine-learning-based-superlative-rapid-haar-wavelet-transformation...Jumlesha Shaik
 
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
 
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
 

Similar to 14. Cubist (20)

13. Cubist
13. Cubist13. Cubist
13. Cubist
 
Cubist model FAO-Global Soil Partnership training 2018.pdf
Cubist model FAO-Global Soil Partnership training 2018.pdfCubist model FAO-Global Soil Partnership training 2018.pdf
Cubist model FAO-Global Soil Partnership training 2018.pdf
 
Cubist
CubistCubist
Cubist
 
Different Types of Machine Learning Algorithms
Different Types of Machine Learning AlgorithmsDifferent Types of Machine Learning Algorithms
Different Types of Machine Learning Algorithms
 
Matrix Factorization In Recommender Systems
Matrix Factorization In Recommender SystemsMatrix Factorization In Recommender Systems
Matrix Factorization In Recommender Systems
 
Caret Package for R
Caret Package for RCaret Package for R
Caret Package for R
 
Caret max kuhn
Caret max kuhnCaret max kuhn
Caret max kuhn
 
Lower back pain Regression models
Lower back pain Regression modelsLower back pain Regression models
Lower back pain Regression models
 
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
 
House Sale Price Prediction
House Sale Price PredictionHouse Sale Price Prediction
House Sale Price Prediction
 
Ml srhwt-machine-learning-based-superlative-rapid-haar-wavelet-transformation...
Ml srhwt-machine-learning-based-superlative-rapid-haar-wavelet-transformation...Ml srhwt-machine-learning-based-superlative-rapid-haar-wavelet-transformation...
Ml srhwt-machine-learning-based-superlative-rapid-haar-wavelet-transformation...
 
Dm
DmDm
Dm
 
06466595
0646659506466595
06466595
 
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...
 
lcr
lcrlcr
lcr
 
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
 
M2R Group 26
M2R Group 26M2R Group 26
M2R Group 26
 
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
 
MyStataLab Assignment Help
MyStataLab Assignment HelpMyStataLab Assignment Help
MyStataLab Assignment Help
 
PCA and SVD in brief
PCA and SVD in briefPCA and SVD in brief
PCA and SVD in brief
 

More from ExternalEvents

More from ExternalEvents (20)

Mauritania
Mauritania Mauritania
Mauritania
 
Malawi - M. Munthali
Malawi - M. MunthaliMalawi - M. Munthali
Malawi - M. Munthali
 
Malawi (Mbewe)
Malawi (Mbewe)Malawi (Mbewe)
Malawi (Mbewe)
 
Malawi (Desideri)
Malawi (Desideri)Malawi (Desideri)
Malawi (Desideri)
 
Lesotho
LesothoLesotho
Lesotho
 
Kenya
KenyaKenya
Kenya
 
ICRAF: Soil-plant spectral diagnostics laboratory
ICRAF: Soil-plant spectral diagnostics laboratoryICRAF: Soil-plant spectral diagnostics laboratory
ICRAF: Soil-plant spectral diagnostics laboratory
 
Ghana
GhanaGhana
Ghana
 
Ethiopia
EthiopiaEthiopia
Ethiopia
 
Item 15
Item 15Item 15
Item 15
 
Item 14
Item 14Item 14
Item 14
 
Item 13
Item 13Item 13
Item 13
 
Item 7
Item 7Item 7
Item 7
 
Item 6
Item 6Item 6
Item 6
 
Item 3
Item 3Item 3
Item 3
 
Item 16
Item 16Item 16
Item 16
 
Item 9: Soil mapping to support sustainable agriculture
Item 9: Soil mapping to support sustainable agricultureItem 9: Soil mapping to support sustainable agriculture
Item 9: Soil mapping to support sustainable agriculture
 
Item 8: WRB, World Reference Base for Soil Resouces
Item 8: WRB, World Reference Base for Soil ResoucesItem 8: WRB, World Reference Base for Soil Resouces
Item 8: WRB, World Reference Base for Soil Resouces
 
Item 7: Progress made in Nepal
Item 7: Progress made in NepalItem 7: Progress made in Nepal
Item 7: Progress made in Nepal
 
Item 6: International Center for Biosaline Agriculture
Item 6: International Center for Biosaline AgricultureItem 6: International Center for Biosaline Agriculture
Item 6: International Center for Biosaline Agriculture
 

Recently uploaded

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
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
 
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
 
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
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
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
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 

Recently uploaded (20)

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
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
 
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
 
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
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
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
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

14. Cubist

  • 1. Yusuf YIGINI, PhD - FAO, Land and Water Division (CBL) GSP - Eurasian Soil Partnership - Dijital Toprak Haritalama ve Modelleme Egitimi Izmir, Turkiye 21-25 Agustos 2017
  • 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