Sha256: 7d1c9fbc183e9b56adec4facd3505b0945671317786df3dd0b095bd438f6a2e1

Contents?: true

Size: 452 Bytes

Versions: 17

Compression:

Stored size: 452 Bytes

Contents

require 'support/test_model'

class DatasetHelper
  def self.normal_distribution(vector_size: 3, clusters: 8, datapoints: 80)
    dataset = []
    sr = SimpleRandom.new

    (1..datapoints).each do |i|
      mean = -90 + (i % clusters) * (180.0 / clusters)
      standard_deviation = 5

      vector = []
      vector_size.times{ |k| vector << sr.normal(mean, standard_deviation) }
      dataset << TestModel.new(vector)
    end

    dataset
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
db_clustering-0.1.17 spec/support/dataset_helper.rb
db_clustering-0.1.16 spec/support/dataset_helper.rb
db_clustering-0.1.15 spec/support/dataset_helper.rb
db_clustering-0.1.14 spec/support/dataset_helper.rb
db_clustering-0.1.13 spec/support/dataset_helper.rb
db_clustering-0.1.12 spec/support/dataset_helper.rb
db_clustering-0.1.11 spec/support/dataset_helper.rb
db_clustering-0.1.10 spec/support/dataset_helper.rb
db_clustering-0.1.9 spec/support/dataset_helper.rb
db_clustering-0.1.8 spec/support/dataset_helper.rb
db_clustering-0.1.7 spec/support/dataset_helper.rb
db_clustering-0.1.6 spec/support/dataset_helper.rb
db_clustering-0.1.5 spec/support/dataset_helper.rb
db_clustering-0.1.4 spec/support/dataset_helper.rb
db_clustering-0.1.3 spec/support/dataset_helper.rb
db_clustering-0.1.2 spec/support/dataset_helper.rb
db_clustering-0.1.1 spec/support/dataset_helper.rb