<commit_before>class AddOldRatingsFromArchive < ActiveRecord::Migration
  # You can add new records to this migration and rerun it:
  # RAILS_ENV=production bin/rake db:migrate:redo VERSION=20120604061351
  RECORDS =
  [
    {icu_id:   552, rating: 1692, games: 11, full: true},
    {icu_id:  1074, rating: 1821, games:  7, full: true},
    {icu_id:  1211, rating: 1727, games: 11, full: true},
    {icu_id:  1305, rating: 1190, games: 30, full: true},
    {icu_id:  2404, rating: 1210, games:  6, full: true},
    {icu_id:  3758, rating: 1507, games: 12, full: true},
    {icu_id:  4126, rating:  938, games: 35, full: true},
    {icu_id: 13382, rating: 1196, games: 80, full: true},
  ]

  def up
    RECORDS.each { |hash| OldRating.where(icu_id: hash[:icu_id]).first_or_create(hash, without_protection: true) }
  end

  def down
    RECORDS.each{ |hash| OldRating.find_by_icu_id(hash[:icu_id]).try(:destroy) }
  end<commit_msg>Added a few legacy ratings mostly from old Fred Harte data<commit_after>class AddOldRatingsFromArchive < ActiveRecord::Migration
  # You can add new records to this migration and rerun it:
  # RAILS_ENV=production bin/rake db:migrate:redo VERSION=20120604061351
  RECORDS =
  [
    {icu_id:   552, rating: 1692, games: 11, full: true},
    {icu_id:  1074, rating: 1821, games:  7, full: true},
    {icu_id:  1211, rating: 1727, games: 11, full: true},
    {icu_id:  1305, rating: 1190, games: 30, full: true},
    {icu_id:  2059, rating: 1071, games: 20, full: true},  # old Fred Harte data, number of games guessed
    {icu_id:  2404, rating: 1210, games:  6, full: true},
    {icu_id:  3758, rating: 1507, games: 12, full: true},
    {icu_id:  4126, rating:  938, games: 35, full: true},
    {icu_id: 13382, rating: 1196, games: 80, full: true},
    {icu_id: 13386, rating: 1514, games: 20, full: true},  # old Fred Harte data, number of games guessed
    {icu_id: 13442, rating: 1930, games: 20, full: true},  # old Fred Harte data, number of games guessed
    {icu_id: 13448, rating: 1401, games: 20, full: true},  # old Fred Harte data, number of games guessed
    {icu_id: 13450, rating: 1444, games: 20, full: true},  # old Fred Harte data, number of games guessed
  ]

  def up
    RECORDS.each { |hash| OldRating.where(icu_id: hash[:icu_id]).first_or_create(hash, without_protection: true) }
  end

  def down
    RECORDS.each{ |hash| OldRating.find_by_icu_id(hash[:icu_id]).try(:destroy) }
  end
{'fraction_non_alphanumeric': 0.13059548254620124, 'fraction_numerical': 0.09691991786447639, 'mean_word_length': 3.9714285714285715, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5759288', 'n_tokens_mistral': 1118, 'n_tokens_neox': 937, 'n_words': 285}