Skip to content

Commit

Permalink
Initialize attributes and typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielius committed Nov 22, 2015
1 parent 2155771 commit 287ff7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/discrete-id3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# Read in the training data
training = []
attributes = nil

File.open('data/discrete-training.txt', 'r').each_line do |line|
data = line.strip.split(',')
attributes ||= data
Expand Down Expand Up @@ -45,7 +47,7 @@
v
end
end
training.push(test_data)
test.push(test_data)
end

# Let the tree predict the output and compare it to the true specified value
Expand Down

0 comments on commit 287ff7a

Please sign in to comment.