Basic Data Types#

Entity Identifiers#

lenskit.data.types.ID: TypeAlias = int | str | bytes | numpy.integer[typing.Any] | numpy.str_ | numpy.bytes_ | numpy.object_#

Allowable identifier types.

lenskit.data.types.CoreID: TypeAlias = int | str | bytes#

Core (non-NumPy) identifier types.

lenskit.data.types.NPID: TypeAlias = numpy.integer[typing.Any] | numpy.str_ | numpy.bytes_ | numpy.object_#

NumPy entity identifier types.

lenskit.data.types.IDArray#

NumPy arrays of identifiers.

alias of ndarray[tuple[int], dtype[integer[Any] | str_ | bytes_ | object_]]

lenskit.data.types.IDSequence#

Sequences of identifiers.

alias of Sequence[int | str | bytes | integer[Any] | str_ | bytes_ | object_] | ndarray[tuple[int], dtype[integer[Any] | str_ | bytes_ | object_]] | StringArray | pa.IntegerArray[Any] | pa.ChunkedArray[Any] | pd.Series[CoreID]

Containers#

class lenskit.data.types.UIPair(user, item)#

Bases: Generic[T]

A user-item pair of values.

Parameters:
  • user (T)

  • item (T)