Module: DF::ID3

Included in:
DataFrame
Defined in:
lib/data_frame/id3.rb

Overview

Uses Ilya Grigorik’s ID3 decision_tree gem. Installs it if you don’t have it.

Instance Method Summary collapse

Instance Method Details

#create_id3(dependent_column, opts = {}) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/data_frame/id3.rb', line 13

def create_id3(dependent_column, opts={})
  # Need to put the dependent column in the last column
  # Probably have other pre processing as well.
  default = opts.fetch(:default, 1)
  @id3 = DecisionTree::ID3Tree.new(self.labels, self.training_data, default, :discrete)
  # ...
end

#id3Object



21
22
# File 'lib/data_frame/id3.rb', line 21

def id3
end