¿Para qué sirven los modelos?
Published:
Se han hablado mucho de los modelos matemáticos, pero poco se ha dicho de ellos. ¿Para qué sirven? ¿Cuáles son sus limitaciones? Son algunas de las preguntas que nos hacemos en este post.
Some measure useful for cooperative games. In this first version it contains:
The easy way to use this functions are:
from Cooperativegames import shapley_value
entities = np.array(range(3))
funct = lambda x: 1 if list(x) in [[0, 2], [1, 2], [0, 1, 2]] else 0
sh_v1 = shapley_value(entities, funct)
from Cooperativegames import shapley_index
distrib_repr = np.array([3, 2, 1, 1])
win_thr = 0.5
sh_sh_ind = shapley_index(distrib_repr, win_thr)
from Cooperativegames import banzhaf_index
distrib_repr = np.array([4, 3, 2, 1])
win_thr = 0.5
bzf_ind = banzhaf_index(distrib_repr, win_thr)
It is provide a testing module called test.py. It runs only with the importation.
import CooperativeGames
CooperativeGames.test()
or it could be done also with nosetests of nose,
nosetests
Leave a Comment