openskill.models.common

Common functions for all models.

Module Contents

Functions

_matrix_transpose(matrix)

Transpose a matrix.

_normalize(vector, target_minimum, target_maximum)

Normalizes a vector to a target range of values.

_unary_minus(number)

Takes value of a number and makes it negative.

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._normalize(vector, target_minimum, target_maximum)[source]

Normalizes a vector to a target range of values.

Parameters:
  • vector (List[float]) – A vector to normalize.

  • target_minimum (float) – Minimum value to scale the values between.

  • target_maximum (float) – Maximum value to scale the values between.

Returns:

Normalized vector.

Return type:

List[float]

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