Sha256: a25e623f01ed8ecd2eb0097b24b288eb17072ad4a8b4f3265725424aa888c0f7

Contents?: true

Size: 670 Bytes

Versions: 3

Compression:

Stored size: 670 Bytes

Contents

module DF #:nodoc:
  # Uses Ilya Grigorik's ID3 decision_tree gem.  Installs it if you don't have it.
  module ID3
    begin
      gem 'decisiontree'
      require 'decisiontree'
    rescue
      `sudo gem install decisiontree`
      gem 'decisiontree'
      require 'decisiontree'
    end

    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

    def id3
    end
  end
end

class DataFrame
  include DF::ID3
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
davidrichards-data_frame-0.0.19 lib/data_frame/id3.rb
davidrichards-data_frame-0.0.20 lib/data_frame/id3.rb
data_frame-0.1.8 lib/data_frame/id3.rb