This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Kmeans do | |
def test_points do | |
# This just outputs 100 random points for testing purposes | |
Stream.repeatedly(fn -> :random.uniform(100) end) | |
|> Stream.chunk(3) | |
|> Enum.take(100) | |
|> Enum.map(&List.to_tuple/1) | |
end | |
def point_range(list) when is_list(list) do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
#use criticism 'brutal'; | |
use File::Open qw(fopen); | |
use Data::Munge; | |
my $k = shift; # k-gram length | |
my $n = shift; # number of iterations | |
my $file = shift; |