openskill.models.common

Common functions for all models.

Module Contents

Functions

_arg_sort(vector)

Returns the indices that would sort a vector.

_matrix_transpose(matrix)

Transpose a matrix.

_rank_data(vector)

Sorting with 'competition ranking'. Pure python equivalent of

_unary_minus(number)

Takes value of a number and makes it negative.

openskill.models.common._arg_sort(vector)[source]

Returns the indices that would sort a vector.

Parameters:

vector (List[Any]) – A list of objects.

Returns:

Rank vector without ties.

Return type:

List[int]

openskill.models.common._matrix_transpose(matrix)[source]

Transpose a matrix.

Parameters:

matrix (List[List[Any]]) – A matrix in the form of a list of lists.

Returns:

A transposed matrix.

Return type:

List[List[Any]]

openskill.models.common._rank_data(vector)[source]

Sorting with ‘competition ranking’. Pure python equivalent of scipy.stats.rankdata function.

Parameters:

vector (List[Any]) – A list of objects.

Returns:

Rank vector with ties.

Return type:

List[int]

openskill.models.common._unary_minus(number)[source]

Takes value of a number and makes it negative.

Parameters:

number (float) – A number to convert.

Returns:

Converted number.

Return type:

float