<commit_before># -*- coding: utf-8 -*-
import libs.bts as bts
import libs.lm as lm
import numpy as np

BTS = bts.BTS(self.get_theta(), lm.LM, m = 100, default_params = \
        {'b': [0,0,0,0,0,0], 'A' : [[1,0,0,0,0,0],[0,1,0,0,0,0], \
                                    [0,0,1,0,0,0],[0,0,0,1,0,0], \
                                    [0,0,0,0,1,0],[0,0,0,0,0,1]], 'n' : 0})

# Return one of the m samples
model = lm.LM(default = BTS.sample())
betas = model.get_coefs()

if betas[2,0] == 0:
    x = 0
else:
    x = - (betas[1,0] / 2*betas[2,0])
    x = np.asscalar(x)

self.action["Price"] = x<commit_msg>Updated BTS getAction Code<commit_after># -*- coding: utf-8 -*-
import libs.bts as bts
import libs.lm as lm
import numpy as np

customer = int(self.context["Type"])

BTS = bts.BTS(self.get_theta(), lm.LM, m = 100, default_params = \
        {'b': [0,0,0,0,0,0], 'A' : [[1,0,0,0,0,0],[0,1,0,0,0,0], \
                                    [0,0,1,0,0,0],[0,0,0,1,0,0], \
                                    [0,0,0,0,1,0],[0,0,0,0,0,1]], 'n' : 0})

# Return one of the m samples
model = lm.LM(default = BTS.sample())
betas = model.get_coefs()

if (betas[2,0] + betas[5,0] * customer) == 0:
    x = 0
else:
    x = - ((betas[1,0] + betas[4,0] * customer) / 2*(betas[2,0] + betas[5,0] * customer))
    x = np.asscalar(x)

self.action["Price"] = x
{'fraction_non_alphanumeric': 0.23202372127501852, 'fraction_numerical': 0.08747220163083766, 'mean_word_length': 2.3834586466165413, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3811043', 'n_tokens_mistral': 644, 'n_tokens_neox': 617, 'n_words': 116}