Sha256: 3587e947d06cfbf1fbd5e27f7c7fec1ff2afc2cd65b252fbd10afd8ea8158152

Contents?: true

Size: 849 Bytes

Versions: 1

Compression:

Stored size: 849 Bytes

Contents

require 'aprendizaje_maquina'

my_data = [['slashdot','USA','yes',18,'None'],
					['google','France','yes',23,'Premium'],
					['digg','USA','yes',24,'Basic'],
					['kiwitobes','France','yes',23,'Basic'],
					['google','UK','no',21,'Premium'],
					['(direct)','New Zealand','no',12,'None'],
					['(direct)','UK','no',21,'Basic'],
					['google','USA','no',24,'Premium'],
					['slashdot','France','yes',19,'None'],
					['digg','USA','no',18,'None'],
					['google','UK','no',18,'None'],
					['kiwitobes','UK','no',19,'None'],
					['digg','New Zealand','yes',12,'Basic'],
					['slashdot','UK','no',21,'None'],
					['google','UK','yes',18,'Basic'],
					['kiwitobes','France','yes',19,'Basic']]

tree = AprendizajeMaquina::DecisionTree.new(my_data)

print tree.display_tree

test_data = ['(direct)','USA','yes',5]

p tree.predict(test_data)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aprendizaje_maquina-0.1.4 examples/decision_tree_example.rb