<commit_before>require 'spec_helper'

describe MultiArmedBandit::MultiplePlayTS do

  k = 5
  l = 2

  it "Returned number of arms is correct" do
    mpts = MultiArmedBandit::MultiplePlayTS.new(k, l)
    arms = mpts.get_selected_arms
    expect(arms.count).to eq(l)
  end	

  it 'Alpha update correctly works' do
    mpts = MultiArmedBandit::MultiplePlayTS.new(k, l)
    mpts.last_selected_arms = [1,3]
    mpts.update_params(1)
    expect(mpts.alpha).to eq([1,2,1,1,1])
  end

  it 'Beta update correctly works' do
    mpts = MultiArmedBandit::MultiplePlayTS.new(k, l)
    mpts.last_selected_arms = [1,3]
    mpts.update_params(1)
    expect(mpts.beta).to eq([1,1,1,2,1])
  end

end <commit_msg>modify spec file<commit_after>require 'spec_helper'

describe MultiArmedBandit::MultiplePlayTS do

  k = 5
  l = 2

  it "Returned number of arms is correct" do
    mpts = MultiArmedBandit::MultiplePlayTS.new(k, l)
    arms = mpts.get_selected_arms
    expect(arms.count).to eq(l)
  end	

  it 'Beat update correctly works when arms draw' do
    mpts = MultiArmedBandit::MultiplePlayTS.new(k, l)
    mpts.update_params_draw([1,3])
    expect(mpts.beta).to eq([1,2,1,2,1])
  end

  it 'Alpha update correctly works when rewarded' do
    mpts = MultiArmedBandit::MultiplePlayTS.new(k, l)
    mpts.update_params_draw([1,3])
    mpts.update_params_reward(1)
    expect(mpts.beta).to eq([1,1,1,2,1])
  end

  it 'Alpha update correctly works when rewarded' do
    mpts = MultiArmedBandit::MultiplePlayTS.new(k, l)
    mpts.update_params_draw([1,3])
    mpts.update_params_reward(1)
    expect(mpts.alpha).to eq([1,2,1,1,1])
  end

end 
{'fraction_non_alphanumeric': 0.12115621156211562, 'fraction_numerical': 0.026445264452644526, 'mean_word_length': 3.915407854984894, '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': '174489', 'n_tokens_mistral': 644, 'n_tokens_neox': 625, 'n_words': 132}