mirror of
https://github.com/dkam/decisiontree.git
synced 2025-12-28 07:04:53 +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)
|
descend(@tree, test)
|
||||||
end
|
end
|
||||||
|
|
||||||
def graph(filename)
|
def graph(filename, file_type = "png")
|
||||||
require 'graphr'
|
require 'graphr'
|
||||||
dgp = DotGraphPrinter.new(build_tree)
|
dgp = DotGraphPrinter.new(build_tree)
|
||||||
dgp.write_to_file("#{filename}.png", "png")
|
dgp.write_to_file("#{filename}.#{file_type}", file_type)
|
||||||
end
|
end
|
||||||
|
|
||||||
def ruleset
|
def ruleset
|
||||||
|
|||||||
Reference in New Issue
Block a user