Skip to content

Instantly share code, notes, and snippets.

View marsnone's full-sized avatar
:electron:

Martin O'Neill marsnone

:electron:
  • Dublin
View GitHub Profile
@marsnone
marsnone / C50TreegraphvizR.R
Last active April 20, 2023 11:37
C50graphvizR
C5.0.graphviz <- function( C5.0.model, filename, fontname ='Arial',
col.draw ='black',col.font ='blue',col.conclusion ='lightpink',
col.question = 'grey78', shape.conclusion ='box3d',shape.question ='diamond',
bool.substitute = 'None', prefix=FALSE, vertical=TRUE ) {
library(cwhmisc)
library(stringr)
treeout <- C5.0.model$output
treeout<- substr(treeout, cpos(treeout, 'Decision tree:', start=1)+14,nchar(treeout))
treeout<- substr(treeout, 1,cpos(treeout, 'Evaluation on training data', start=1)-2)