Skip to main content

A package for conducting Comparative Judgement

Project description

Comparative Judgement

A package for comparative judgement (CJ).

Importing the BCJ model:

from cj.models import BayesianCJ

BCJ = BayesianCJ(4)

Creating the data:

import numpy as np

data = np.asarray([
    [0, 1, 0],
    [0, 1, 0],
    [0, 3, 0],
    [1, 0, 1],
    [1, 0, 1],
    [1, 0, 1],
    [1, 2, 1],
    [1, 2, 1],
    [1, 2, 1],
    [1, 2, 1],
    [1, 2, 1],
    [2, 1, 2],
    [2, 1, 2],
    [2, 1, 2],
    [2, 3, 2],
    [3, 0, 3],
    [3, 0, 3],
    [3, 0, 3],
    [3, 0, 3],
    [3, 2, 3],
    [3, 2, 3],
    [3, 2, 3],
])

running the model:

BCJ.run(data)

Finding the $\mathbb{E}[\mathbf{r}]$

BCJ.rank_scores
>>> [3.046875, 2.09765625, 3.05859375, 1.796875]

Finding the BCJ rank:

BCJ.res
>>> array([3, 1, 0, 2])

Importing the BTM Model:

from cj.models import BayesianCJ

BTM = BTMCJ(4)

running the model:

BTM.run(data)

Finding the optimised p scores:

BTM.optimal_params
>>> array([-0.44654627,  0.04240265, -0.41580243,  0.81994508])

find BTM rank:

BTM.rank
>>> array([3, 1, 2, 0])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

comparative_judgement-0.0.3.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

comparative_judgement-0.0.3-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page