ctree: Conditional Inference Trees in party: A Laboratory for Recursive Partytioning (2024)

Conditional Inference TreesR Documentation

Conditional Inference Trees

Description

Recursive partitioning for continuous, censored, ordered, nominal andmultivariate response variables in a conditional inference framework.

Usage

ctree(formula, data, subset = NULL, weights = NULL, controls = ctree_control(), xtrafo = ptrafo, ytrafo = ptrafo, scores = NULL)

Arguments

formula

a symbolic description of the model to be fit. Notethat symbols like : and - will not workand the tree will make use of all variables listed on therhs of formula.

data

a data frame containing the variables in the model.

subset

an optional vector specifying a subset of observations to beused in the fitting process.

weights

an optional vector of weights to be used in the fittingprocess. Only non-negative integer valued weights areallowed.

controls

an object of class TreeControl, which can beobtained using ctree_control.

xtrafo

a function to be applied to all input variables.By default, the ptrafo function is applied.

ytrafo

a function to be applied to all response variables. By default, the ptrafo function is applied.

scores

an optional named list of scores to be attached to orderedfactors.

Details

Conditional inference trees estimate a regression relationship by binary recursivepartitioning in a conditional inference framework. Roughly, the algorithmworks as follows: 1) Test the global null hypothesis of independence betweenany of the input variables and the response (which may be multivariate as well). Stop if this hypothesis cannot be rejected. Otherwise select the inputvariable with strongest association to the resonse. Thisassociation is measured by a p-value corresponding to a test for thepartial null hypothesis of a single input variable and the response.2) Implement a binary split in the selected input variable. 3) Recursively repeate steps 1) and 2).

The implementation utilizes a unified framework for conditional inference,or permutation tests, developed by Strasser and Weber (1999). The stopcriterion in step 1) is either based on multiplicity adjusted p-values (testtype == "Bonferroni"or testtype == "MonteCarlo" in ctree_control),on the univariate p-values (testtype == "Univariate"),or on values of the test statistic(testtype == "Teststatistic"). In both cases, thecriterion is maximized, i.e., 1 - p-value is used. A split is implemented when the criterion exceeds the value given by mincriterion asspecified in ctree_control. For example, when mincriterion = 0.95, the p-value must be smaller than$0.05$ in order to split this node. This statistical approach ensures thatthe right sized tree is grown and no form of pruning or cross-validationor whatsoever is needed. The selection of the input variable to split inis based on the univariate p-values avoiding a variable selection biastowards input variables with many possible cutpoints.

Multiplicity-adjusted Monte-Carlo p-values are computed following a "min-p" approach. The univariate p-values based on the limiting distribution (chi-squareor normal) are computed for each of the random permutations of the data. This means that one shoulduse a quadratic test statistic when factors are inplay (because the evaluation of the correspondingmultivariate normal distribution is time-consuming).

By default, the scores for each ordinal factor x are1:length(x), this may be changed using scores = list(x = c(1,5,6)), for example.

Predictions can be computed using predict ortreeresponse. The first function accepts argumentstype = c("response", "node", "prob") where type = "response"returns predicted means, predicted classes or median predicted survivaltimes, type = "node" returns terminal node IDs (identical towhere) and type = "prob" gives more information aboutthe conditional distribution of the response, i.e., class probabilities orpredicted Kaplan-Meier curves and is identical totreeresponse. For observations with zero weights,predictions are computed from the fitted tree when newdata = NULL.

For a general description of the methodology see Hothorn, Hornik andZeileis (2006) and Hothorn, Hornik, van de Wiel and Zeileis (2006). Introductions for novices can be found in Strobl et al. (2009) andat https://github.com/christophM/overview-ctrees.

Value

An object of class BinaryTree-class.

References

Helmut Strasser and Christian Weber (1999). On the asymptotic theory of permutationstatistics. Mathematical Methods of Statistics, 8, 220–250.

Torsten Hothorn, Kurt Hornik, Mark A. van de Wiel and Achim Zeileis (2006).A Lego System for Conditional Inference. The American Statistician,60(3), 257–263.

Torsten Hothorn, Kurt Hornik and Achim Zeileis (2006). Unbiased RecursivePartitioning: A Conditional Inference Framework. Journal ofComputational and Graphical Statistics, 15(3), 651–674. Preprint availablefrom https://www.zeileis.org/papers/Hothorn+Hornik+Zeileis-2006.pdf

Carolin Strobl, James Malley and Gerhard Tutz (2009).An Introduction to Recursive Partitioning: Rationale, Application, and Characteristics of Classification and Regression Trees, Bagging, and Random forests.Psychological Methods, 14(4), 323–348.

Examples

 set.seed(290875) ### regression airq <- subset(airquality, !is.na(Ozone)) airct <- ctree(Ozone ~ ., data = airq, controls = ctree_control(maxsurrogate = 3)) airct plot(airct) mean((airq$Ozone - predict(airct))^2) ### extract terminal node ID, two ways all.equal(predict(airct, type = "node"), where(airct)) ### classification irisct <- ctree(Species ~ .,data = iris) irisct plot(irisct) table(predict(irisct), iris$Species) ### estimated class probabilities, a list tr <- treeresponse(irisct, newdata = iris[1:10,]) ### ordinal regression data("mammoexp", package = "TH.data") mammoct <- ctree(ME ~ ., data = mammoexp) plot(mammoct) ### estimated class probabilities treeresponse(mammoct, newdata = mammoexp[1:10,]) ### survival analysis if (require("TH.data") && require("survival")) { data("GBSG2", package = "TH.data") GBSG2ct <- ctree(Surv(time, cens) ~ .,data = GBSG2) plot(GBSG2ct) treeresponse(GBSG2ct, newdata = GBSG2[1:2,]) } ### if you are interested in the internals: ### generate doxygen documentation ## Not run: ### download src package into temp dir tmpdir <- tempdir() tgz <- download.packages("party", destdir = tmpdir)[2] ### extract untar(tgz, exdir = tmpdir) wd <- setwd(file.path(tmpdir, "party")) ### run doxygen (assuming it is there) system("doxygen inst/doxygen.cfg") setwd(wd) ### have fun browseURL(file.path(tmpdir, "party", "inst", "documentation", "html", "index.html")) ## End(Not run)
ctree: Conditional Inference Trees in party: A Laboratory for Recursive Partytioning (2024)

FAQs

How to use Ctree? ›

After setting the control, we implement the CIT by using the ctree function from the partykit package. This function requires the formula (the dependent variable ~ and the independent variables) and the specification of the data. Then, we plot the resulting CIT using the plot function.

What are conditional inference trees? ›

Conditional inference trees estimate a regression relationship by binary recursive partitioning in a conditional inference framework. Roughly, the algorithm works as follows: 1) Test the global null hypothesis of independence between any of the input variables and the response (which may be multivariate as well).

What is Ctree classification? ›

CTree is a non-parametric class of regression trees embedding tree-structured regression models into a well defined theory of conditional inference pro- cedures.

What is the ctree function in R? ›

The function ctree() is used to create conditional inference trees. The main components of this function are formula and data. Other components include subset, weights, controls, xtrafo, ytrafo, and scores. arguments. formula: refers to the the decision model we are using to make predicitions.

How do decision trees work with an example? ›

A. A decision tree is a tree-like structure that represents a series of decisions and their possible consequences. It is used in machine learning for classification and regression tasks. An example of a decision tree is a flowchart that helps a person decide what to wear based on the weather conditions.

How do you interpret a decision tree graph? ›

The interpretation is simple: Starting from the root node, you go to the next nodes and the edges tell you which subsets you are looking at. Once you reach the leaf node, the node tells you the predicted outcome.

How does classification decision tree work? ›

Decision trees is a type of supervised machine learning algorithm that is used by the Train Using AutoML tool and classifies or regresses the data using true or false answers to certain questions. The resulting structure, when visualized, is in the form of a tree with different types of nodes—root, internal, and leaf.

How many categories are there in decision tree? ›

Decision trees are typically grouped into two categories: classification trees and regression trees. A specific tree may be built to apply to classification, regression, or both use cases. Most modern decision trees use the CART (Classification and Regression Trees) algorithm, which can perform both types of tasks.

What is decision tree for document classification? ›

Introduction Decision Trees are a type of Supervised Machine Learning (that is you explain what the input is and what the corresponding output is in the training data) where the data is continuously split according to a certain parameter.

What is the first variable in the decision tree? ›

This is usually called the parent node. The Decision Tree then makes a sequence of splits based in hierarchical order of impact on this target variable. From the analysis perspective the first node is the root node, which is the first variable that splits the target variable.

What is the shape of the decision tree? ›

There are three different types of nodes: chance nodes, decision nodes, and end nodes. A chance node, represented by a circle, shows the probabilities of certain results. A decision node, represented by a square, shows a decision to be made, and an end node shows the final outcome of a decision path.

What are decision tree functions in R? ›

R Decision Trees are among the most fundamental algorithms in supervised machine learning, used to handle both regression and classification tasks. In a nutshell, you can think of it as a glorified collection of if-else statements.

How to use tree command prompt? ›

For example, to display the directory tree of the C:\Windows folder with file names and sizes, you would use the following command: tree C:\Windows /F /T This would display a tree structure of the C:\Windows folder with file names and sizes.

How to use code org data? ›

You can find featured datasets by clicking on the Data tab in App Lab:
  1. Click the 'Preview' button to see what data is included in the table you've selected:
  2. Click 'Import' to add this dataset to your app (you need to import in order to use any of the featured datasets in your app!)

How to use C code in R? ›

Using . C()
  1. Write a function in . ...
  2. Compile your function into a shared library accessible to R using this command: R CMD SHLIB my_func. ...
  3. Within an active R session, link to the shared library using dyn. ...
  4. Write an R wrapper to call your C function using .

How to use C with database? ›

Here are the basic steps to connect a C program to a MySQL database:
  1. Install the MySQL Connector/C library on your system.
  2. Include the necessary header files in your C program.
  3. Establish a connection to the MySQL database using the API provided by the MySQL Connector/C library.
  4. Execute SQL statements to interac.
Mar 15, 2021

Top Articles
Oppenheimer - czy "naprawdę" widziałeś ten film? Rozwiązujemy zagadkę formatów taśmy filmowej
‘Oppenheimer’ IMAX 70mm movie review: Nolan’s explosive epic burns through the big screen
Lakers Game Summary
Design215 Word Pattern Finder
Ffxiv Palm Chippings
Ets Lake Fork Fishing Report
A Complete Guide To Major Scales
Rondale Moore Or Gabe Davis
Nesb Routing Number
CA Kapil 🇦🇪 Talreja Dubai on LinkedIn: #businessethics #audit #pwc #evergrande #talrejaandtalreja #businesssetup…
T&G Pallet Liquidation
Zoebaby222
Driving Directions To Atlanta
Lax Arrivals Volaris
Dexter Gomovies
Dc Gas Login
Razor Edge Gotti Pitbull Price
My Homework Lesson 11 Volume Of Composite Figures Answer Key
Morristown Daily Record Obituary
Johnnie Walker Double Black Costco
1973 Coupe Comparo: HQ GTS 350 + XA Falcon GT + VH Charger E55 + Leyland Force 7V
Www.dunkinbaskinrunsonyou.con
12 Facts About John J. McCloy: The 20th Century’s Most Powerful American?
10 Best Places to Go and Things to Know for a Trip to the Hickory M...
Roseann Marie Messina · 15800 Detroit Ave, Suite D, Lakewood, OH 44107-3748 · Lay Midwife
Where to eat: the 50 best restaurants in Freiburg im Breisgau
Osrs Important Letter
Sam's Club Gas Price Hilliard
Eero Optimize For Conferencing And Gaming
How to Use Craigslist (with Pictures) - wikiHow
2015 Chevrolet Silverado 1500 for sale - Houston, TX - craigslist
Breckie Hill Fapello
Quake Awakening Fragments
Magicseaweed Capitola
Felix Mallard Lpsg
Qlima© Petroleumofen Elektronischer Laserofen SRE 9046 TC mit 4,7 KW CO2 Wächter • EUR 425,95
This 85-year-old mom co-signed her daughter's student loan years ago. Now she fears the lender may take her house
Atom Tickets – Buy Movie Tickets, Invite Friends, Skip Lines
How I Passed the AZ-900 Microsoft Azure Fundamentals Exam
Vintage Stock Edmond Ok
8776725837
Citymd West 146Th Urgent Care - Nyc Photos
Unit 11 Homework 3 Area Of Composite Figures
The Blackening Showtimes Near Ncg Cinema - Grand Blanc Trillium
Benjamin Franklin - Printer, Junto, Experiments on Electricity
Guy Ritchie's The Covenant Showtimes Near Look Cinemas Redlands
Heat Wave and Summer Temperature Data for Oklahoma City, Oklahoma
Runescape Death Guard
Adams County 911 Live Incident
Famous Dave's BBQ Catering, BBQ Catering Packages, Handcrafted Catering, Famous Dave's | Famous Dave's BBQ Restaurant
Itsleaa
Latest Posts
Article information

Author: Twana Towne Ret

Last Updated:

Views: 6349

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Twana Towne Ret

Birthday: 1994-03-19

Address: Apt. 990 97439 Corwin Motorway, Port Eliseoburgh, NM 99144-2618

Phone: +5958753152963

Job: National Specialist

Hobby: Kayaking, Photography, Skydiving, Embroidery, Leather crafting, Orienteering, Cooking

Introduction: My name is Twana Towne Ret, I am a famous, talented, joyous, perfect, powerful, inquisitive, lovely person who loves writing and wants to share my knowledge and understanding with you.