mirror of
https://github.com/dkam/decisiontree.git
synced 2025-12-27 22:54:52 +00:00
Allow passing through file extensions to graph
Still defaults to png.
This commit is contained in:
@@ -131,10 +131,10 @@ module DecisionTree
|
||||
descend(@tree, test)
|
||||
end
|
||||
|
||||
def graph(filename)
|
||||
def graph(filename, file_type = "png")
|
||||
require 'graphr'
|
||||
dgp = DotGraphPrinter.new(build_tree)
|
||||
dgp.write_to_file("#{filename}.png", "png")
|
||||
dgp.write_to_file("#{filename}.#{file_type}", file_type)
|
||||
end
|
||||
|
||||
def ruleset
|
||||
|
||||
Reference in New Issue
Block a user