Skip to content

Commit

Permalink
Used as an adjective, "pairwise-comparison" takes a hyphen.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmaystre committed Nov 10, 2017
1 parent ac58b45 commit c756a46
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ To install the latest release directly from PyPI, simply type

To get started, you might want to explore one of these notebooks:

- [Introduction using pairwise comparison data](notebooks/intro-pairwise.ipynb)
- [Introduction using pairwise-comparison data](notebooks/intro-pairwise.ipynb)
- [Case study: analyzing the GIFGIF dataset](notebooks/gifgif-dataset.ipynb)
- [Using ChoiceRank to understand traffic on a network](notebooks/choicerank-tutorial.ipynb)
- [Approximate Bayesian inference using EP](notebooks/ep-example.ipynb)
Expand Down
6 changes: 3 additions & 3 deletions choix/ep.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def ep_pairwise(n_items, data, alpha, model="logit", max_iter=100,
"""Compute a distribution of model parameters using the EP algorithm.
This function computes an approximate Bayesian posterior probability
distribution over model parameters, given pairwise comparison data (see
distribution over model parameters, given pairwise-comparison data (see
:ref:`data-pairwise`). It uses the expectation propagation algorithm, as
presented, e.g., in [CG05]_.
Expand All @@ -43,15 +43,15 @@ def ep_pairwise(n_items, data, alpha, model="logit", max_iter=100,
Gaussian distribution, described by a mean vector and a covariance matrix.
Two different observation models are available. ``logit`` (default) assumes
that pairwise comparison outcomes follow from a Bradley-Terry model.
that pairwise-comparison outcomes follow from a Bradley-Terry model.
``probit`` assumes that the outcomes follow from Thurstone's model.
Parameters
----------
n_items : int
Number of distinct items.
data : list of lists
Pairwise comparison data.
Pairwise-comparison data.
alpha : float
Inverse variance of the (isotropic) prior.
model : str, optional
Expand Down
10 changes: 5 additions & 5 deletions choix/lsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def lsr_pairwise(n_items, data, alpha=0.0, initial_params=None):
"""Compute the LSR estimate of model parameters.
This function implements the Luce Spectral Ranking inference algorithm
[MG15]_ for pairwise comparison data (see :ref:`data-pairwise`).
[MG15]_ for pairwise-comparison data (see :ref:`data-pairwise`).
The argument ``initial_params`` can be used to iteratively refine an
existing parameter estimate (see the implementation of
Expand All @@ -53,7 +53,7 @@ def lsr_pairwise(n_items, data, alpha=0.0, initial_params=None):
n_items : int
Number of distinct items.
data : list of lists
Pairwise comparison data.
Pairwise-comparison data.
alpha : float, optional
Regularization parameter.
initial_params : array_like, optional
Expand All @@ -76,7 +76,7 @@ def ilsr_pairwise(
"""Compute the ML estimate of model parameters using I-LSR.
This function computes the maximum-likelihood (ML) estimate of model
parameters given pairwise comparison data (see :ref:`data-pairwise`), using
parameters given pairwise-comparison data (see :ref:`data-pairwise`), using
the iterative Luce Spectral Ranking algorithm [MG15]_.
The transition rates of the LSR Markov chain are initialized with
Expand All @@ -88,7 +88,7 @@ def ilsr_pairwise(
n_items : int
Number of distinct items.
data : list of lists
Pairwise comparison data.
Pairwise-comparison data.
alpha : float, optional
Regularization parameter.
initial_params : array_like, optional
Expand Down Expand Up @@ -213,7 +213,7 @@ def rank_centrality(n_items, data, alpha=0.0):
n_items : int
Number of distinct items.
data : list of lists
Pairwise comparison data.
Pairwise-comparison data.
alpha : float, optional
Regularization parameter.
Expand Down
4 changes: 2 additions & 2 deletions choix/mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def mm_pairwise(
"""Compute the ML estimate of model parameters using the MM algorithm.
This function computes the maximum-likelihood (ML) estimate of model
parameters given pairwise comparison data (see :ref:`data-pairwise`), using
parameters given pairwise-comparison data (see :ref:`data-pairwise`), using
the minorization-maximization (MM) algorithm [Hun04]_, [CD12]_.
If ``alpha > 0``, the function returns the maximum a-posteriori (MAP)
Expand All @@ -60,7 +60,7 @@ def mm_pairwise(
n_items : int
Number of distinct items.
data : list of lists
Pairwise comparison data.
Pairwise-comparison data.
initial_params : array_like, optional
Parameters used to initialize the iterative procedure.
alpha : float, optional
Expand Down
8 changes: 4 additions & 4 deletions choix/opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def _safe_exp(x):

class PairwiseFcts:

"""Optimization-related methods for pairwise comparison data.
"""Optimization-related methods for pairwise-comparison data.
This class provides methods to compute the negative log-likelihood (the
"objective"), its gradient and its Hessian, given model parameters and
pairwise comparison data.
pairwise-comparison data.
"""

def __init__(self, data, penalty):
Expand Down Expand Up @@ -128,15 +128,15 @@ def opt_pairwise(n_items, data, penalty=1e-6, method="Newton-CG",
"""Compute the ML estimate of model parameters using ``scipy.optimize``.
This function computes the (penalized) maximum-likelihood estimate of model
parameters given pairwise comparison data (see :ref:`data-pairwise`), using
parameters given pairwise-comparison data (see :ref:`data-pairwise`), using
optimizers provided by the ``scipy.optimize`` module.
Parameters
----------
n_items : int
Number of distinct items.
data : list of lists
Pairwise comparison data.
Pairwise-comparison data.
penalty : float, optional
Regularization strength.
method : str, optional
Expand Down
2 changes: 1 addition & 1 deletion choix/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def generate_pairwise(params, n_comparisons=10):
Returns
-------
data : list of (int, int)
Pairwise comparison samples (see :ref:`data-pairwise`).
Pairwise-comparison samples (see :ref:`data-pairwise`).
"""
n = len(params)
items = tuple(range(n))
Expand Down
4 changes: 2 additions & 2 deletions notebooks/gifgif-dataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"Therefore, the raw data that is collected consists of outcomes of pairwise comparison between pairs of images.\n",
"*Just the kind of data that `choix` is built for*!\n",
"\n",
"In this notebook, we will **use `choix` to try making sense of the raw pairwise comparison data**.\n",
"In this notebook, we will **use `choix` to try making sense of the raw pairwise-comparison data**.\n",
"In particular, we would like to embed the images on a scale (for a given emotion).\n",
"\n",
"### Dataset\n",
Expand Down Expand Up @@ -95,7 +95,7 @@
"## Processing the raw data\n",
"\n",
"First, we need to transform the raw dataset into a format that `choix` can process.\n",
"Remember that `choix` encodes pairwise comparison outcomes as tuples `(i, j)` (meaning \"$i$ won over $j$\"), and that items are assumed to be numbered by consecutive integers.\n",
"Remember that `choix` encodes pairwise-comparison outcomes as tuples `(i, j)` (meaning \"$i$ won over $j$\"), and that items are assumed to be numbered by consecutive integers.\n",
"\n",
"We begin by mapping all distinct images that appear in the dataset to consecutive integers."
]
Expand Down
4 changes: 2 additions & 2 deletions notebooks/intro-pairwise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Introduction using pairwise comparison data\n",
"# Introduction using pairwise-comparison data\n",
"\n",
"This notebook provides a gentle introduction to the `choix` library.\n",
"We consider the case of pairwise comparison outcomes between items from some set."
"We consider the case of pairwise-comparison outcomes between items from some set."
]
},
{
Expand Down

0 comments on commit c756a46

Please sign in to comment.