<commit_before><h3>Reports by hour</h3>
<br />

<%= line_chart [{name: "All", data: Post.where("created_at >= :date", :date => 1.week.ago).group_by_hour(:created_at).count}, {name: "True positives", data: Post.where("created_at >= :date", :date => 1.week.ago).where(:is_tp => true).group_by_hour(:created_at).count}, {name: "False positives", data: Post.where("created_at >= :date", :date => 1.week.ago).where(:is_fp => true).group_by_hour(:created_at).count}], colors: ["#999", "green", "red"] %>

<h3>Reports by site</h3>
<br />

<% h = HTMLEntities.new %>
<%= pie_chart Post.all.group(:site).count.map{ |k,v| {(k.nil? ? "Unknown" : h.decode(k.site_name))=>v} }.reduce(:merge).select{|k,v| k != "Unknown"}.sort_by {|k,v| v}.reverse %>

<h3>Reports by hour of day</h3>
<br />

<% t = Time.now %>
<% number_of_days = (DateTime.now - Post.minimum(:created_at).to_date).to_i %>

<% all_posts = Post.all.group_by_hour_of_day(:created_at).count.map{ |k,v| [k, v.to_f / 100.0] }.to_h %>
<% tp_posts = Post.where(:is_tp => true).group_by_hour_of_day(:created_at).count.map{ |k,v| [k, v.to_f / 100.0] }.to_h %>
<% fp_posts = Post.where(:is_fp => true).group_by_hour_of_day(:created_at).count.map{ |k,v| [k, v.to_f / 100.0] }.to_h %>

<%= line_chart [{name: "All", data: Post.all.group_by_hour_of_day(:created_at).count.map{ |k,v| [k, v.to_f / 100.0] }.to_h}, {name: "True positives", data: tp_posts}, {name: "False positives", data: fp_posts} ], discrete: true, library: {"xAxis": { "plotLines" => [{"width" => '2', :value => "#{t.hour + t.min.to_f / 60.to_f}", :color => 'grey'}] } }, colors: ["#999", "green", "red"] %><commit_msg>Shared tooltip<commit_after><h3>Reports by hour</h3>
<br />

<%= line_chart [{name: "All", data: Post.where("created_at >= :date", :date => 1.week.ago).group_by_hour(:created_at).count}, {name: "True positives", data: Post.where("created_at >= :date", :date => 1.week.ago).where(:is_tp => true).group_by_hour(:created_at).count}, {name: "False positives", data: Post.where("created_at >= :date", :date => 1.week.ago).where(:is_fp => true).group_by_hour(:created_at).count}], colors: ["#999", "green", "red"], library: {"tooltip" => {'shared' => 'true'} } %>

<h3>Reports by site</h3>
<br />

<% h = HTMLEntities.new %>
<%= pie_chart Post.all.group(:site).count.map{ |k,v| {(k.nil? ? "Unknown" : h.decode(k.site_name))=>v} }.reduce(:merge).select{|k,v| k != "Unknown"}.sort_by {|k,v| v}.reverse %>

<h3>Reports by hour of day</h3>
<br />

<% t = Time.now %>
<% number_of_days = (DateTime.now - Post.minimum(:created_at).to_date).to_i %>

<% all_posts = Post.all.group_by_hour_of_day(:created_at).count.map{ |k,v| [k, v.to_f / 100.0] }.to_h %>
<% tp_posts = Post.where(:is_tp => true).group_by_hour_of_day(:created_at).count.map{ |k,v| [k, v.to_f / 100.0] }.to_h %>
<% fp_posts = Post.where(:is_fp => true).group_by_hour_of_day(:created_at).count.map{ |k,v| [k, v.to_f / 100.0] }.to_h %>

<%= line_chart [{name: "All", data: Post.all.group_by_hour_of_day(:created_at).count.map{ |k,v| [k, v.to_f / 100.0] }.to_h}, {name: "True positives", data: tp_posts}, {name: "False positives", data: fp_posts} ], discrete: true, library: {"xAxis": { "plotLines" => [{"width" => '2', :value => "#{t.hour + t.min.to_f / 60.to_f}", :color => 'grey'}] } }, colors: ["#999", "green", "red"], library: {"tooltip" => {'shared' => 'true'} } %>
{'fraction_non_alphanumeric': 0.25455631909172394, 'fraction_numerical': 0.020316701523752614, 'mean_word_length': 5.223048327137547, 'pattern_counts': {'":': 2, '<': 39, '<?xml version=': 0, '>': 73, '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': '4416525', 'n_tokens_mistral': 1470, 'n_tokens_neox': 1380, 'n_words': 253}