<commit_before>#!/usr/bin/env ruby

require_relative "../lib/wsmodel"

# This a random network (because the first parameter is 1)
# with the characteristics of the neural network of the 
# nematode worm C. elegans (node number = 282 and degree = 14)
# We found similar result than in the paper
# http://tam.cornell.edu/tam/cms/manage/upload/SS_nature_smallworld.pdf
# table 1, Crandom

network = WSModel::Network.new 1, 282, 14
puts "Clustering coefficient 'on random C elegans neural network' = " + network.clustering_coefficient.to_s


# http://tam.cornell.edu/tam/cms/manage/upload/SS_nature_smallworld.pdf
# reproduction of the figure 2 results

l0      = WSModel::Network.new(0, 1000, 10).clustering_coefficient
l0dot01 = WSModel::Network.new(0.01, 1000, 10).clustering_coefficient
l0dot1  = WSModel::Network.new(0.1, 1000, 10).clustering_coefficient

puts "L(0.01) / L(0) = " + (l0dot01 / l0).to_s
puts "L(0.1)  / L(0) = " + (l0dot1 / l0).to_s<commit_msg>In bin/create_network.rb, show more results for the clustering coefficient, and average over 20 random rewirings<commit_after>#!/usr/bin/env ruby

require_relative "../lib/wsmodel"

# This a random network (because the first parameter is 1)
# with the characteristics of the neural network of the 
# nematode worm C. elegans (node number = 282 and degree = 14)
# We found similar result than in the paper
# http://tam.cornell.edu/tam/cms/manage/upload/SS_nature_smallworld.pdf
# table 1, Crandom

network = WSModel::Network.new 1, 282, 14
puts "Clustering coefficient 'on random C elegans neural network' = " + network.clustering_coefficient.to_s


# http://tam.cornell.edu/tam/cms/manage/upload/SS_nature_smallworld.pdf
# reproduction of the figure 2 results

c0 = WSModel::Network.new(0, 1000, 10).clustering_coefficient

beta_values= [0.0001, 0.001, 0.01, 0.1, 0.2, 0.5]
beta_values.each do |beta|
  coeffs = []
  20.times do |i|
    coeffs[i] = WSModel::Network.new(beta, 1000, 10).clustering_coefficient
  end
  clustering_coefficient = coeffs.inject{ |sum, val| sum + val } / coeffs.size
  puts "C(#{beta}) / C(0) = " + (clustering_coefficient / c0).to_s
end
#c0dot01 = WSModel::Network.new(0.01, 1000, 10).clustering_coefficient
#c0dot1  = WSModel::Network.new(0.1, 1000, 10).clustering_coefficient

#puts "C(0.01) / C(0) = " + (c0dot01 / c0).to_s
#puts "C(0.1)  / C(0) = " + (c0dot1 / c0).to_s
{'fraction_non_alphanumeric': 0.13293818797629128, 'fraction_numerical': 0.06181202370872142, 'mean_word_length': 4.35827664399093, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6775167', 'n_tokens_mistral': 997, 'n_tokens_neox': 855, 'n_words': 223}