Removed graph calls in specs

They're unnecessary and will be substituted by a further spec.
This commit is contained in:
Carlos Agarie
2013-12-19 01:12:36 -02:00
parent c4623d9ce6
commit a8d66d0f4a

View File

@@ -1,9 +1,6 @@
require 'spec_helper' require 'spec_helper'
describe describe DecisionTree::ID3Tree do describe describe DecisionTree::ID3Tree do
after :each do
File.delete("continuous.png") if File.file?("continuous.png")
end
describe "simple discrete case" do describe "simple discrete case" do
Given(:labels) { ["sun", "rain"]} Given(:labels) { ["sun", "rain"]}
@@ -51,7 +48,6 @@ describe describe DecisionTree::ID3Tree do
end end
Given(:tree) { DecisionTree::ID3Tree.new(labels, data, "not angry", :continuous) } Given(:tree) { DecisionTree::ID3Tree.new(labels, data, "not angry", :continuous) }
When { tree.train } When { tree.train }
Then { tree.graph("continuous") }
Then { tree.predict([7, 7]).should == "angry" } Then { tree.predict([7, 7]).should == "angry" }
Then { tree.predict([2, 3]).should == "not angry" } Then { tree.predict([2, 3]).should == "not angry" }
end end
@@ -72,7 +68,6 @@ describe describe DecisionTree::ID3Tree do
end end
Given(:tree) { DecisionTree::ID3Tree.new(labels, data, "not angry", color: :discrete, hunger: :continuous) } Given(:tree) { DecisionTree::ID3Tree.new(labels, data, "not angry", color: :discrete, hunger: :continuous) }
When { tree.train } When { tree.train }
Then { tree.graph("continuous") }
Then { tree.predict([7, "red"]).should == "angry" } Then { tree.predict([7, "red"]).should == "angry" }
Then { tree.predict([2, "blue"]).should == "not angry" } Then { tree.predict([2, "blue"]).should == "not angry" }
end end