Skip to main content

A package for conducting Comparative Judgement

Project description

Comparative Judgement

A package for comparative judgement (CJ).

Installation

Dependencies

comparative-judgement requires:

  • Python (>= |PythonMinVersion|)
  • NumPy (>= |NumPyMinVersion|)
  • SciPy (>= |SciPyMinVersion|)
  • Ray

User installation

If you already have a working installation of NumPy and SciPy, the easiest way to install comparative_judgement is using pip::

    pip install comparative-judgement
    conda install -c conda-forge comparative-judgement

Bayesian CJ

Importing the BCJ model:

from cj.models import BTMCJ

BCJ = BTMCJ(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.Er_scores
>>> [3.046875, 2.09765625, 3.05859375, 1.796875]

Finding the BCJ rank:

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

Traditional BTM CJ

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])

Citing this Library:

@misc{comparative_judgement,
    author = {Andy Gray},
    title = {Comparative Judgement},
    year = {2024},
    publisher = {Python Package Index (PyPI)},
    howpublished = {\url{https://pypi.org/project/comparative-judgement/}}
}

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.4.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

comparative_judgement-0.0.4-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file comparative_judgement-0.0.4.tar.gz.

File metadata

  • Download URL: comparative_judgement-0.0.4.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.4

File hashes

Hashes for comparative_judgement-0.0.4.tar.gz
Algorithm Hash digest
SHA256 8ae894e035cb1d59b32566f351c541b3bb52c6927799c184b169f1a22a5f8257
MD5 1ed8ad2fe58fe03e9bc6edbed5a0a2b0
BLAKE2b-256 a8559bf59db8c60c2a3d529d655391b43ff136b3cbd2a71596fa7725ea003faa

See more details on using hashes here.

File details

Details for the file comparative_judgement-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for comparative_judgement-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 649827b988167bd5b3fb124770ab3584da17f8828a6f777a4547624b13b75938
MD5 778ad9d82cf96065e17d22f6dc77812c
BLAKE2b-256 41c40b60c06af30bd2bf12a9c7c0caaa0ce089fb803e772f9b5f776d8a934c79

See more details on using hashes here.

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