require './knn'

collection = [
	{label: 'cat', features: [12, 1, 1] },
	{label: 'cat', features: [13, 3, 1] },
	{label: 'cat', features: [15, 1, 1] },
	{label: 'dog', features: [3, 12, 2] },
	{label: 'dog', features: [4, 11, 2] },
	{label: 'dog', features: [1, 11, 2] },
	{label: 'cat', features: [11, 4, 1] },
	{label: 'cat', features: [13, 2, 1] },
	{label: 'dog', features: [3, 13, 2] },
	{label: 'dog', features: [7, 12, 2] }
]

unknown_data_point = { label: nil, features: [4, 2, 1] }
result = classify_with_knn(collection, 5, unknown_data_point)
puts "Result: #{result[0]} with #{result[1]} neighbors"