def simple_deterministic(cls, products): lambdas = generate_n_equal_numbers_that_sum_one(len(products)) ros = [] for i in range(len(products)): row = generate_n_equal_numbers_that_sum_one(len(products) - 1) ros.append(row[:i] + [0] + row[i:]) return cls(products, lambdas, ros)
def simple_deterministic(cls, products, amount_classes): gammas = generate_n_equal_numbers_that_sum_one(amount_classes) multi_logit_models = [ MultinomialLogitModel.simple_deterministic(products) for i in range(amount_classes) ] return cls(products, gammas, multi_logit_models)
def simple_deterministic(cls, products): l = generate_n_equal_numbers_that_sum_one(len(products)) u = [1.0 for _ in products] v = generate_n_equal_numbers_that_sum_m(len(products), m=1.0) w = [1.0 for _ in products] z = generate_n_equal_numbers_that_sum_m(len(products), m=0.0) return cls(products, l, u, v, w, z)
def simple_deterministic(cls, products): # Hay que anclar el primer parámetro, sólo importan los valores relativos a este. return cls(products, generate_n_equal_numbers_that_sum_one(len(products) - 1))
def simple_deterministic(cls, products, ranked_lists): betas = generate_n_equal_numbers_that_sum_one(len(ranked_lists))[1:] return cls(products, ranked_lists, betas)
def simple_deterministic(cls, products, ranked_lists): betas = generate_n_equal_numbers_that_sum_one(len(ranked_lists))[1:] choices = [1 for _ in range(len(ranked_lists))] return cls(products, ranked_lists, betas, choices)
def simple_deterministic(cls, products): mus = generate_n_equal_numbers_that_sum_one(len(products)) sigmas = generate_n_equal_numbers_that_sum_one(len(products)) return cls(products, mus, sigmas)
def simple_deterministic(cls, products, nests): for nest in nests: nest['lambda'] = 0.8 etas = generate_n_equal_numbers_that_sum_one(len(products)) return cls(products, nests, etas)\