Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8992833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:02:59+00:00 2026-06-15T23:02:59+00:00

How to find a split and root node in a regression tree, I made

  • 0

How to find a split and root node in a regression tree, I made a regression tree from multiple vectors now I have to extract root node of rpart of multiple vectors.file contains numeric value of multiple vectors A,B,C,D,E,F,G,H ex. A vector contains 4,3,6,7,2,4,5,…and so on similarly others B,C,D,E,F,G,H .so want to extract F (which is a root node in my case) as an output from this input an after creating a tree .thank you.sorry unable to put any image 🙁

Here’s what I’ve done so far

log_data <- read.csv(file="C:\\Users\\AASHU\\Desktop\\CART\\syn.csv",
                      header=T, as.is=T)
library(rpart)

fit <- rpart(A ~ B+C+D+E+F+G+H, log_data)
# plot(fit)
plot(fit, compress=TRUE, branch=0)
text(fit, xpd = NA, cex = 0.7)

summary(fit)
Call:
rpart(formula = A ~ B + C + D + E + F + G + H, data = log_data)
n=52 (1 observation deleted due to missingness)

          CP nsplit rel error   xerror      xstd
1 0.09798662      0 1.0000000 1.065250 0.1888568

2 0.09347624      1 0.9020134 1.198999 0.1842667

3 0.03632980      2 0.8085371 1.154558 0.1859743

4 0.02297130      3 0.7722073 1.254874 0.2029423

5 0.01000000      4 0.7492360 1.274024 0.2118272

Node number 1: 52 observations,    complexity param=0.09798662

 mean=4.403846, MSE=1.509985 

 left son=2 (7 obs) right son=3 (45 obs)

 Primary splits:

F < 5.5 to the right, improve=0.09798662, (0 missing)

………..
Now I have to extract root node F(F>=5.5) from fit (regression tree) and its split,can anyone help me?.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:03:00+00:00Added an answer on June 15, 2026 at 11:03 pm

    find the lables of that tree so that we can extract any of the vector

    when the root node is character(ex.-A)

    nodes<-labels(fit, digits=4, minlength=1L, pretty, collapse=TRUE)
    root<-substr(nodes[2], 1, 1)
    

    from the path we can extract the root node of a tree,below one is best to extract root node name by going through its second split which is nothing but an root node.

    nodes<-labels(fit, digits=4, minlength=1L, pretty, collapse=TRUE)
    path<-path.rpart(fit, node_no, pretty=0, print.it=FALSE) 
    path[[2]][1]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read files from disc in my Java project. I find my hohoho.java file
I have a working snippet to use for a regular tree comprising nodes. Now
i have a extremely large xml-file - which is derived from the field of
I have a large html file that I want to split apart. I have
I have a table that stores a tree like structure of file names. There
I am trying to find a way to disable Design / Split views from
I'm trying to find a Delphi function that will split an input string into
My initial task was to find a segmenter for Windows that will split a
i want to split the searchrequest into parts, if there's nothing to find. example:
My PHP code is split between many files, and often I find myself using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.