Skip to content

Commit

Permalink
new printing method written for generating in markdown syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Shekharrajak committed Jan 23, 2019
1 parent db81d39 commit 7a50c54
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 19 deletions.
77 changes: 75 additions & 2 deletions benchmarks/statistics/benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
puts
end

Benchmarker.result()
Benchmarker.result_with_size()

# Real times for vector size [10**2, 10**3,10**4,10**5,10**6]

Expand All @@ -31,4 +31,77 @@
# median_absolute_deviation => ["0.000228032000", "0.000427085000", "0.000212802001", "0.000227248000", "0.000321677000", "0.000218785000"]
# sum_of_squared_deviation => ["0.000048617000", "0.000063766000", "0.000039721001", "0.000120714000", "0.000052445000", "0.000040694000"]
# average_deviation_populationa => ["0.000117892000", "0.000167791000", "0.000102102000", "0.000105429001", "0.000140446000", "0.000159499999"]
# create df real time => ["0.001020248000", "0.010377509000", "0.120133259000", "0.988936126000", "10.624304956000", "160.231077512000"]
# create df real time => ["0.001020248000", "0.010377509000", "0.120133259000", "0.988936126000", "10.624304956000", "160.231077512000"]

# MEAN
# Number of rows | Real Time
# 10 ** 2 | 0.000054331000
# 10 ** 3 | 0.000009194999
# 10 ** 4 | 0.000018446000
# 10 ** 5 | 0.000020922002
# 10 ** 6 | 0.000021750000
# 10 ** 7 | 0.000025256000
# mode
# Number of rows | Real Time
# 10 ** 2 | 0.000149911999
# 10 ** 3 | 0.000142830000
# 10 ** 4 | 0.000075880000
# 10 ** 5 | 0.000102595999
# 10 ** 6 | 0.000162674000
# 10 ** 7 | 0.000127839001
# median
# Number of rows | Real Time
# 10 ** 2 | 0.000087897999
# 10 ** 3 | 0.000048153001
# 10 ** 4 | 0.000048931000
# 10 ** 5 | 0.000058501999
# 10 ** 6 | 0.000037392001
# 10 ** 7 | 0.000039921000
# sum
# Number of rows | Real Time
# 10 ** 2 | 0.000007932000
# 10 ** 3 | 0.000005886999
# 10 ** 4 | 0.000007730001
# 10 ** 5 | 0.000007742001
# 10 ** 6 | 0.000007914001
# 10 ** 7 | 0.000008490000
# product
# Number of rows | Real Time
# 10 ** 2 | 0.000008676001
# 10 ** 3 | 0.000023701001
# 10 ** 4 | 0.000008835001
# 10 ** 5 | 0.000006949000
# 10 ** 6 | 0.000007162000
# 10 ** 7 | 0.000008034000
# median_absolute_deviation
# Number of rows | Real Time
# 10 ** 2 | 0.000115168001
# 10 ** 3 | 0.000078445999
# 10 ** 4 | 0.000087135000
# 10 ** 5 | 0.000061999001
# 10 ** 6 | 0.000089991001
# 10 ** 7 | 0.000069404001
# sum_of_squared_deviation
# Number of rows | Real Time
# 10 ** 2 | 0.000011927999
# 10 ** 3 | 0.000027659000
# 10 ** 4 | 0.000011986000
# 10 ** 5 | 0.000011858001
# 10 ** 6 | 0.000012952001
# 10 ** 7 | 0.000013014000
# average_deviation_populationa
# Number of rows | Real Time
# 10 ** 2 | 0.000074686001
# 10 ** 3 | 0.000056527000
# 10 ** 4 | 0.000030231000
# 10 ** 5 | 0.000051306999
# 10 ** 6 | 0.000031907000
# 10 ** 7 | 0.000034154000
# create df real time
# Number of rows | Real Time
# 10 ** 2 | 0.000290951000
# 10 ** 3 | 0.002574505999
# 10 ** 4 | 0.032502977001
# 10 ** 5 | 0.247718948001
# 10 ** 6 | 2.816306391998
# 10 ** 7 | 45.877466839000
84 changes: 67 additions & 17 deletions benchmarks/statistics/benchmarker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,73 @@ def self.generate_df(size)

def self.result()
puts 'Real times for vector size [10**2, 10**3,10**4,10**5,10**6] '
print 'Means => ', @result_mean.to_a
puts
print 'mode => ' , @result_mode.to_a
puts
print 'median => ' , @result_median.to_a
puts
print 'sum => ' , @result_sum.to_a
puts
print 'product => ' , @result_product.to_a
puts
print 'median_absolute_deviation => ' , @result_median_absolute_deviation.to_a
puts
print 'sum_of_squared_deviation => ' , @result_sum_of_squared_deviation.to_a
puts
print 'average_deviation_populationa => ' , @result_average_deviation_populationa.to_a
puts
print 'create df real time => ' , @result_create_df.to_a
puts 'Means => ', @result_mean.join(" | ")
puts 'mode => ' , @result_mode.join(" | ")
puts 'median => ' , @result_median.join(" | ")
puts 'sum => ' , @result_sum.join(" | ")
puts 'product => ' , @result_product.join(" | ")
puts 'median_absolute_deviation => ' , @result_median_absolute_deviation.join(" | ")
puts 'sum_of_squared_deviation => ' , @result_sum_of_squared_deviation.join(" | ")
puts 'average_deviation_populationa => ' , @result_average_deviation_populationa.join(" | ")
puts 'create df real time => ' , @result_create_df.join(" | ")
end

def self.result_with_size()
puts 'Real times for vector size [10**2, 10**3,10**4,10**5,10**6] '

puts "MEAN"
puts " | Number of rows | Real Time | "
puts " |------------|------------| "
self.print_array(@result_mean)

puts "Method on DataFrame Vector (Vector access and apply method): **mode**"
puts " | Number of rows | Real Time | "
puts " |------------|------------| "
print_array(@result_mode)

puts "Method on DataFrame Vector (Vector access and apply method): **median**"
puts " | Number of rows | Real Time | "
puts " |------------|------------| "
print_array(@result_median)

puts "Method on DataFrame Vector (Vector access and apply method): **sum**"
puts " | Number of rows | Real Time | "
puts " |------------|------------| "
print_array(@result_sum)

puts "Method on DataFrame Vector (Vector access and apply method): **product**"
puts " | Number of rows | Real Time | "
puts " |------------|------------| "
print_array(@result_product)

puts "Method on DataFrame Vector (Vector access and apply method): **median_absolute_deviation**"
puts " | Number of rows | Real Time | "
puts " |------------|------------| "
print_array(@result_median_absolute_deviation)

puts "Method on DataFrame Vector (Vector access and apply method): **sum_of_squared_deviation**"
puts " | Number of rows | Real Time | "
puts " |------------|------------| "
print_array(@result_sum_of_squared_deviation)

puts "Method on DataFrame Vector (Vector access and apply method): **average_deviation_populationa**"
puts " | Number of rows | Real Time | "
puts " |------------|------------| "
print_array(@result_average_deviation_populationa)

puts "Method on DataFrame Vector (Vector access and apply method): **create df real time**"
puts " | Number of rows | Real Time | "
puts " |------------|------------| "
print_array(@result_create_df)
end

private

def self.print_array(array)
array.each_with_index do |val, index|
puts " | 10 ** #{index + 2} | #{val} | "
end
end

end

0 comments on commit 7a50c54

Please sign in to comment.