Open swaheera opened 3 years ago
@swaheera have you taken a look at the tidyrules package? The vignette contains an example using rpart and seems to give exactly what you are looking for.
Thanks! I'll need to check this out, too!
From: Brandon Greenwell notifications@github.com Sent: Wednesday, January 13, 2021 1:08 PM To: bethatkinson/rpart rpart@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [EXTERNAL] Re: [bethatkinson/rpart] Obtaining "Decision Rules" from rpart trees (#25)
@swaheerahttps://github.com/swaheera have you taken a look at the tidyruleshttps://CRAN.R-project.org/package=tidyrules package? The vignette contains an example using rpart and seems to give exactly what you are looking for.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/bethatkinson/rpart/issues/25#issuecomment-759657056, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACWQG56K44W3GKO6OLNHKZ3SZXVUNANCNFSM4WBBXOZQ.
@swaheera have you taken a look at the tidyrules package? The vignette contains an example using rpart and seems to give exactly what you are looking for.
I dont have access to this package due to admin restrictions on my computer (no usb or internet). Can this be done using only with rpart, party, partykit ot base R?
Thank you for your help!
I may have some code that you can use - I know I've done this before.
From: swaheera notifications@github.com Sent: Wednesday, January 13, 2021 1:13 PM To: bethatkinson/rpart rpart@noreply.github.com Cc: Atkinson, Elizabeth J. (Beth), M.S. atkinson@mayo.edu; Comment comment@noreply.github.com Subject: [EXTERNAL] Re: [bethatkinson/rpart] Obtaining "Decision Rules" from rpart trees (#25)
@swaheerahttps://github.com/swaheera have you taken a look at the tidyruleshttps://CRAN.R-project.org/package=tidyrules package? The vignette contains an example using rpart and seems to give exactly what you are looking for.
I dont have access to this package due to admin restrictions on my computer (no usb or internet). Can this be done using only with rpart, party, partykit ot base R?
Thank you for your help!
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/bethatkinson/rpart/issues/25#issuecomment-759659470, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACWQG52KQPNCRZOLWRIWKXTSZXWGJANCNFSM4WBBXOZQ.
@bethatkinson : thank you so much for your reply! (Here is the corresponding stackoverflow question: https://stackoverflow.com/questions/65679523/r-obtaining-rules-from-a-function) . Your help is greatly Appreciated!
Thank you for your reply!
From: Beth Atkinson notifications@github.com Sent: January 13, 2021 2:16 PM To: bethatkinson/rpart rpart@noreply.github.com Cc: swaheera swaheera92@hotmail.com; Mention mention@noreply.github.com Subject: Re: [bethatkinson/rpart] Obtaining "Decision Rules" from rpart trees (#25)
I may have some code that you can use - I know I've done this before.
From: swaheera notifications@github.com Sent: Wednesday, January 13, 2021 1:13 PM To: bethatkinson/rpart rpart@noreply.github.com Cc: Atkinson, Elizabeth J. (Beth), M.S. atkinson@mayo.edu; Comment comment@noreply.github.com Subject: [EXTERNAL] Re: [bethatkinson/rpart] Obtaining "Decision Rules" from rpart trees (#25)
@swaheerahttps://github.com/swaheera have you taken a look at the tidyruleshttps://CRAN.R-project.org/package=tidyrules package? The vignette contains an example using rpart and seems to give exactly what you are looking for.
I dont have access to this package due to admin restrictions on my computer (no usb or internet). Can this be done using only with rpart, party, partykit ot base R?
Thank you for your help!
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/bethatkinson/rpart/issues/25#issuecomment-759659470, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACWQG52KQPNCRZOLWRIWKXTSZXWGJANCNFSM4WBBXOZQ.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bethatkinson/rpart/issues/25#issuecomment-759660879, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASHV6NHZRGQ2FYB4MNTQP7LSZXWQXANCNFSM4WBBXOZQ.
Hello,
I used the "rpart" library and fit a decision tree using some data:
from a previous question : https://stackoverflow.com/questions/65678552/r-changing-plot-sizes
I am looking for an easier way to summarize the results of this tree in case the tree becomes too big, complicated and cluttered (and impossible to visualize). I found another stackoverflow post (https://stackoverflow.com/questions/36401411/extracting-information-from-the-decision-rules-in-rpart-package/51680932) over here that shows how to obtain a listing of rules:
Country %in% c("NA", "Germany", "Korea", "Mexico", "Sweden", "USA") & Weight < 3167.5 Country %in% c("NA", "Japan", "Japan/USA")>