lenskit.pipeline#

LensKit pipeline abstraction.

Submodules#

components

Definition of the component interfaces.

config

Pydantic models for pipeline configuration and serialization support.

nodes

Node objects used to represent pipelines internally. It is very rare

Attributes#

Classes#

PipelineBuilder

Builder for LensKit recommendation pipelines. Pipelines

PipelineCache

A cache to share components between pipelines.

RecPipelineBuilder

Builder to help assemble common pipeline patterns.

ComponentInputHook

Inspect or process data as it passes to a component's input.

Pipeline

LensKit recommendation pipeline. This is the core abstraction for using

PipelineProfiler

Collect pipeline run statistics for profiling pipeline executions.

ProfileSink

Interface for creating recording pipeline run profiling information.

PipelineState

Full results of running a pipeline. A pipeline state is a dictionary

Functions#

predict_pipeline(scorer, *[, fallback, name])

Create a pipeline that predicts ratings, but does not include any

topn_pipeline(scorer[, config, predicts_ratings, n, name])

Create a pipeline that produces top-N recommendations using a scoring model.

Package Contents#

class lenskit.pipeline.PipelineBuilder(name=None, version=None)#

Builder for LensKit recommendation pipelines. Pipelines are the core abstraction for using LensKit models and other components to produce recommendations in a useful way. They allow you to wire together components in (mostly) abitrary graphs, train them on data, and serialize the resulting pipelines to disk for use elsewhere.

The builder configures and builds pipelines that can then be run. If you have a scoring model and just want to generate recommenations with a default setup and minimal configuration, see topn_pipeline() or RecPipelineBuilder.

Parameters:
  • name (str | None) – A name for the pipeline.

  • version (str | None) – A numeric version for the pipeline.

Stability:
Caller (see Stability Levels).
name: str | None = None#

The pipeline name.

version: str | None = None#

The pipeline version string.

classmethod from_pipeline(pipeline)#

Create a builder initialized with a pipeline’s internal state. See Pipeline.modify() for details — that is the main entry point, and this method exists to be the implementation of that method.

Parameters:

pipeline (lenskit.pipeline._impl.Pipeline)

Return type:

PipelineBuilder

meta(*, include_hash=True)#

Get the metadata (name, version, hash, etc.) for this pipeline without returning the whole config.

Parameters:

include_hash (bool) – Whether to include a configuration hash in the metadata.

Return type:

lenskit.pipeline.config.PipelineMeta

nodes()#

Get the nodes in the pipeline graph.

Return type:

list[lenskit.pipeline.nodes.Node[object]]

node(node: str, *, missing: Literal['error'] = 'error') lenskit.pipeline.nodes.Node[object]#
node(node: str, *, missing: Literal['none'] | None) lenskit.pipeline.nodes.Node[object] | None
node(node: lenskit.pipeline.nodes.Node[T]) lenskit.pipeline.nodes.Node[T]

Get the pipeline node with the specified name. If passed a node, it returns the node or fails if the node is not a member of the pipeline.

Parameters:

node – The name of the pipeline node to look up, or a node to check for membership.

Returns:

The pipeline node, if it exists.

Raises:

KeyError – The specified node does not exist.

property default_node: lenskit.pipeline.nodes.Node[Any] | None#

Get the default node for this pipeline.

Return type:

lenskit.pipeline.nodes.Node[Any] | None

create_input[T](name, *types)#

Create an input node for the pipeline. Pipelines expect their inputs to be provided when they are run.

Parameters:
  • name (str) – The name of the input. The name must be unique in the pipeline (among both components and inputs).

  • types (type[T] | types.UnionType | None) – The allowable types of the input; input data can be of any specified type. If None is among the allowed types, the input can be omitted.

Returns:

A pipeline node representing this input.

Raises:

ValueError – a node with the specified name already exists.

Return type:

lenskit.pipeline.nodes.Node[T]

literal[T](value, *, name=None)#

Create a literal node (a node with a fixed value).

Note

Literal nodes cannot be serialized witih get_config() or save_config().

Parameters:
  • value (T)

  • name (str | None)

Return type:

lenskit.pipeline.nodes.LiteralNode[T]

default_connection(name, node)#

Set the default wiring for a component input. Components that declare an input parameter with the specified name but no configured input will be wired to this node.

This is intended to be used for things like wiring up user parameters to semi-automatically receive the target user’s identity and history.

Important

Defaults are a feature of the builder only, and are resolved in build(). They are not included in serialized configuration or resulting pipeline.

Parameters:
Return type:

None

default_component(node)#

Set the default node for the pipeline. If Pipeline.run() is called without a node, then it will run this node (and all of its dependencies).

Parameters:

node (str | lenskit.pipeline.nodes.Node[Any])

Return type:

None

remove_alias(alias, *, exist_ok=False)#

Remove an alias from the builder.

Parameters:
alias(alias, node, *, replace=False)#

Create an alias for a node. After aliasing, the node can be retrieved from node() using either its original name or its alias.

Parameters:
  • alias (str) – The alias to add to the node.

  • node (lenskit.pipeline.nodes.Node[Any] | str) – The node (or node name) to alias.

  • replace (bool) – If True, replace the alias if one already exists.

Raises:

ValueError – if the alias is already used as an alias or node name.

Return type:

None

add_component[CFG, T](name: str, cls: lenskit.pipeline.components.ComponentConstructor[CFG, T], config: CFG = None, /, **inputs: lenskit.pipeline.nodes.Node[Any]) lenskit.pipeline.nodes.Node[T]#
add_component(name: str, instance: lenskit.pipeline.components.Component[T] | lenskit.pipeline.components.PipelineFunction[T], /, **inputs: lenskit.pipeline.nodes.Node[Any] | object) lenskit.pipeline.nodes.Node[T]

Add a component and connect it into the graph.

Parameters:
  • name – The name of the component in the pipeline. The name must be unique in the pipeline (among both components and inputs).

  • cls – A component class.

  • config – The configuration object for the component class.

  • instance – A raw function or pre-instantiated component.

  • inputs – The component’s input wiring. See Connections for details.

Returns:

The node representing this component in the pipeline.

replace_component[CFG, T](name: str | lenskit.pipeline.nodes.Node[T], cls: lenskit.pipeline.components.ComponentConstructor[CFG, T], config: CFG = None, /, **inputs: lenskit.pipeline.nodes.Node[Any]) lenskit.pipeline.nodes.Node[T]#
replace_component(name: str | lenskit.pipeline.nodes.Node[T], instance: lenskit.pipeline.components.Component[T] | lenskit.pipeline.components.PipelineFunction[T], /, **inputs: lenskit.pipeline.nodes.Node[Any] | object) lenskit.pipeline.nodes.Node[T]

Replace a component in the graph. The new component must have a type that is compatible with the old component. Both input and output connections are retained, except for those overridden with with keyword arguments.

Parameters:
  • name – The name or node to replace.

  • comp – The component or constructor to use instead of the current node’s component.

  • config – A configuration for the component (if passed as a class or constructor).

  • inputs – New input wiring(s) for the new component.

connect(obj, **inputs)#

Provide additional input connections for a component that has already been added. See Connections for details.

Parameters:
  • obj (str | lenskit.pipeline.nodes.Node[Any]) – The name or node of the component to wire.

  • inputs (lenskit.pipeline.nodes.Node[Any] | str | object) – The component’s input wiring. For each keyword argument in the component’s function signature, that argument can be provided here with an input that the pipeline will provide to that argument of the component when the pipeline is run.

clear_inputs(node)#

Remove input wirings for a node.

Parameters:

node (str | lenskit.pipeline.nodes.Node[Any]) – The node whose input wiring should be removed.

add_run_hook(name, hook, *, priority=1)#

Add a hook to be called when the pipeline is run (see Pipeline Hooks).

Parameters:
  • name (Literal['component-input']) – The name of the hook to add a handler for.

  • hook (lenskit.pipeline._hooks.ComponentInputHook) – The hook function to run.

  • priority (int) – The hook priority. Hooks are run in ascending priority, and hooks with the same priority are run in the order they are added. LensKit’s built-in hooks run at priority 0.

Return type:

None

validate()#

Check the built pipeline for errors.

clone()#

Clone the pipeline builder. The resulting builder starts as a copy of this builder, and any subsequent modifications only the copy to which they are applied.

Return type:

PipelineBuilder

build_config(*, include_hash=True)#

Get this pipeline’s configuration for serialization. The configuration consists of all inputs and components along with their configurations and input connections. It can be serialized to disk (in JSON, YAML, or a similar format) to save a pipeline.

The configuration does not include any trained parameter values, although the configuration may include things such as paths to checkpoints to load such parameters, depending on the design of the components in the pipeline.

Note

Literal nodes (from literal(), or literal values wired to inputs) cannot be serialized, and this method will fail if they are present in the pipeline.

Parameters:

include_hash (bool)

Return type:

lenskit.pipeline.config.PipelineConfig

config_hash()#

Get a hash of the pipeline’s configuration to uniquely identify it for logging, version control, or other purposes.

The hash format and algorithm are not guaranteed, but hashes are stable within a LensKit version. For the same version of LensKit and component code, the same configuration will produce the same hash, so long as there are no literal nodes. Literal nodes will usually hash consistently, but since literals other than basic JSON values are hashed by pickling, hash stability depends on the stability of the pickle bytestream.

In LensKit 2025.1, the configuration hash is computed by computing the JSON serialization of the pipeline configuration without a hash and returning the hex-encoded SHA256 hash of that configuration.

Return type:

str

classmethod load_config(cfg_file)#

Load a pipeline from a saved configuration file.

Parameters:

cfg_file (pathlib.Path | os.PathLike[str]) – The path to a TOML, YAML, or JSON file containing the pipeline configuration.

Returns:

The consructed pipeline.

Return type:

PipelineBuilder

See also

from_config() for the actual pipeline instantiation logic.

classmethod from_config(config, *, file_path=None)#

Reconstruct a pipeline builder from a serialized configuration.

Parameters:
  • config (object) – The configuration object, as loaded from JSON, TOML, YAML, or similar. Will be validated into a PipelineConfig.

  • file_path (pathlib.Path | None)

Returns:

The configured (but not trained) pipeline.

Raises:

PipelineError – If there is a configuration error reconstructing the pipeline.

Warns:

PipelineWarning – If the configuration is funny but usable; for example, the configuration includes a hash but the constructed pipeline does not have a matching hash.

Return type:

PipelineBuilder

apply_config(config, *, extend=False, check_hash=False)#

Apply a configuration to this builder.

Parameters:
  • config (lenskit.pipeline.config.PipelineConfig) – The pipeline configuration to apply.

  • extend (bool) – Whether the configuration should extend the current pipeline, or fail when there are conflicting definitions.

  • check_hash (bool)

use_first_of[T](name, primary, fallback)#

Ergonomic method to create a new node that returns the result of its input if it is provided and not None, and otherwise returns the result of fallback. This method is used for things like filling in optional pipeline inputs. For example, if you want the pipeline to take candidate items through an items input, but look them up from the user’s history and the training data if items is not supplied, you would do:

pipe = Pipeline()
# allow candidate items to be optionally specified
items = pipe.create_input('items', list[EntityId], None)
# find candidates from the training data (optional)
lookup_candidates = pipe.add_component(
    'select-candidates', TrainingItemsCandidateSelector(),
    user=history,
)
# if the client provided items as a pipeline input, use those; otherwise
# use the candidate selector we just configured.
candidates = pipe.use_first_of('candidates', items, lookup_candidates)

Note

This method does not distinguish between an input being unspecified and explicitly specified as None.

Note

This method does not implement item-level fallbacks, only fallbacks at the level of entire results. For item-level score fallbacks, see FallbackScorer.

Note

If one of the fallback elements is a component A that depends on another component or input B, and B is missing or returns None such that A would usually fail, then A will be skipped and the fallback will move on to the next node. This works with arbitrarily-deep transitive chains.

Parameters:
Return type:

lenskit.pipeline.nodes.Node[T]

build(cache=None)#

Build the pipeline.

Parameters:

cache (lenskit.pipeline._cache.PipelineCache | None) – The pipeline cache to use.

Return type:

lenskit.pipeline._impl.Pipeline

class lenskit.pipeline.PipelineCache#

A cache to share components between pipelines.

This cache can be used by PipelineBuilder to cache pipeline component instances between multiple pipelines using the same components with the same configuration.

get_cached(ctor, config)#
Parameters:
cache(ctor, config, instance)#
Parameters:
get_instance(ctor, config)#

Get a component instance from the cache, creating if it necessry.

Parameters:
class lenskit.pipeline.RecPipelineBuilder#

Builder to help assemble common pipeline patterns.

This is a convenience class; you can always directly assemble a Pipeline if this class’s behavior is inadquate.

Stability:
Caller (see Stability Levels).
is_predictor: bool = False#
scorer(score, config=None)#

Specify the scoring model.

Parameters:
ranker(rank=None, config=None, *, n=None)#

Specify the ranker to use. If None, sets up a TopNRanker with n=n.

Parameters:
candidate_selector(sel, config=None)#

Specify the candidate selector component. The component should accept a query as its input and return an item list.

Parameters:
predicts_ratings(*, transform=None, fallback=None)#

Specify that this pipeline will predict ratings, optionally providing a rating transformer and fallback scorer for the rating predictions.

Parameters:
  • transform (lenskit.pipeline.components.Component | None) – A component to transform scores prior to returning them. If supplied, it will be applied to both primary scores and fallback scores.

  • fallback (lenskit.pipeline.components.Component | None) – A fallback scorer to use when the primary scorer cannot score an item. The fallback should accept query and items inputs, and return an item list.

build(name=None)#

Build the specified pipeline.

Parameters:

name (str | None)

Return type:

lenskit.pipeline._impl.Pipeline

reranker(reranker, config=None)#

Specify a reranker to add to the pipeline.

Parameters:
lenskit.pipeline.predict_pipeline(scorer, *, fallback=True, name=None)#

Create a pipeline that predicts ratings, but does not include any ranking capabilities. Mostly userful for testing and historical purposes. The resulting pipeline must be called with an item list.

Stability:
Caller (see Stability Levels).
Parameters:
Return type:

lenskit.pipeline._impl.Pipeline

lenskit.pipeline.topn_pipeline(scorer, config=None, *, predicts_ratings=False, n=None, name=None)#

Create a pipeline that produces top-N recommendations using a scoring model.

Stability:
Caller (see Stability Levels).
Parameters:
Return type:

lenskit.pipeline._impl.Pipeline

class lenskit.pipeline.ComponentInputHook#

Bases: Protocol

Inspect or process data as it passes to a component’s input.

As with all Pipeline Hooks, an input hook is a callable that is run at the appropriate stage of the input.

Component input hooks are installed under the name component-input.

Stability:

Experimental

__call__(node, input, value, **context)#

Inspect or process the component input data.

Parameters:
  • node (lenskit.pipeline.nodes.ComponentInstanceNode[Any]) – The component node being invoked.

  • input_name – The name of the component’s input that will receive the data.

  • input_type – The type of data the component expects for this input, if one was specified in the component definition.

  • value (object) – The data value to be supplied. This is declared object, because its type is not known or guaranteed in the genral case.

  • context (Any) – Additional context variables, mostly for the use of internal hooks.

  • input (lenskit.pipeline.components.ComponentInput)

Returns:

The value to pass to the component. For inspection-only hooks, this will just be value; hooks can also substitute alternative values depending on application needs.

Return type:

Any

type lenskit.pipeline.CloneMethod = Literal['config', 'pipeline-config']#
class lenskit.pipeline.Pipeline(config, nodes, *, run_hooks)#

LensKit recommendation pipeline. This is the core abstraction for using LensKit models and other components to produce recommendations in a useful way. It allows you to wire together components in (mostly) abitrary graphs, train them on data, and serialize pipelines to disk for use elsewhere.

Pipelines should not be directly instantiated; they must be built with a PipelineBuilder class, or loaded from a configuration with from_config(). If you have a scoring model and just want to generate recommenations with a default setup and minimal configuration, see topn_pipeline() or RecPipelineBuilder.

Pipelines are also Trainable, and train all trainable components.

Stability:
Caller (see Stability Levels).
Parameters:
property config: lenskit.pipeline.config.PipelineConfig#

Get the pipline configuration.

Important

Do not modify the configuration returned, or it will become out-of-sync with the pipeline and likely not behave correctly.

Return type:

lenskit.pipeline.config.PipelineConfig

property name: str | None#

Get the pipeline name (if configured).

Return type:

str | None

property version: str | None#

Get the pipeline version (if configured).

Return type:

str | None

meta()#

Get the metadata (name, version, hash, etc.) for this pipeline without returning the whole config.

Return type:

lenskit.pipeline.config.PipelineMeta

nodes()#

Get the nodes in the pipeline graph.

Return type:

list[lenskit.pipeline.nodes.Node[object]]

node(node: str, *, missing: Literal['error'] = 'error') lenskit.pipeline.nodes.Node[object]#
node(node: str, *, missing: Literal['none'] | None) lenskit.pipeline.nodes.Node[object] | None
node(node: lenskit.pipeline.nodes.Node[T]) lenskit.pipeline.nodes.Node[T]

Get the pipeline node with the specified name. If passed a node, it returns the node or fails if the node is not a member of the pipeline.

Parameters:

node – The name of the pipeline node to look up, or a node to check for membership.

Returns:

The pipeline node, if it exists.

Raises:

KeyError – The specified node does not exist.

property default_node: lenskit.pipeline.nodes.Node[Any] | None#

Get the default node for this pipeline.

Return type:

lenskit.pipeline.nodes.Node[Any] | None

component_names()#

Get the component names (in topological order).

Return type:

list[str]

node_input_connections(node)#

Get the input wirings for a node.

Parameters:

node (str | lenskit.pipeline.nodes.Node[Any])

Return type:

Mapping[str, lenskit.pipeline.nodes.Node[Any]]

component(node)#

Get the component at a particular node, if any.

Parameters:

node (str | lenskit.pipeline.nodes.Node[Any])

Return type:

object | None

clone()#

Clone the pipeline, without its trained parameters.

Returns:

A new pipeline with the same components and wiring, but fresh instances created by round-tripping the configuration.

Return type:

Pipeline

property config_hash: str#

Get a hash of the pipeline’s configuration to uniquely identify it for logging, version control, or other purposes.

The hash format and algorithm are not guaranteed, but is stable within a LensKit version. For the same version of LensKit and component code, the same configuration will produce the same hash, so long as there are no literal nodes. Literal nodes will usually hash consistently, but since literals other than basic JSON values are hashed by pickling, hash stability depends on the stability of the pickle bytestream.

In LensKit 2025.1, the configuration hash is computed by computing the JSON serialization of the pipeline configuration without a hash and returning the hex-encoded SHA256 hash of that configuration.

Return type:

str

static from_config(config, file_path=None)#

Reconstruct a pipeline from a serialized configuration.

Parameters:
  • config (object) – The configuration object, as loaded from JSON, TOML, YAML, or similar. Will be validated into a PipelineConfig.

  • file_path (pathlib.Path | None) – The path of the file from which the configuration was read, when available.

Returns:

The configured (but not trained) pipeline.

Raises:

PipelineError – If there is a configuration error reconstructing the pipeline.

Warns:

PipelineWarning – If the configuration is funny but usable; for example, the configuration includes a hash but the constructed pipeline does not have a matching hash.

Return type:

Pipeline

classmethod load_config(cfg_file)#

Load a pipeline from a saved configuration file.

Parameters:

cfg_file (pathlib.Path | os.PathLike[str]) – The path to a TOML, YAML, or JSON file containing the pipeline configuration.

Returns:

The consructed pipeline.

Return type:

Pipeline

See also

from_config() for the actual pipeline instantiation logic.

modify()#

Create a pipeline builder from this pipeline in order to modify it.

Pipelines cannot be modified in-place, but this method sets up a new builder that will create a modified copy of the pipeline. Unmodified component instances are reused as-is.

Note

Since default connections are applied in build(), the modifying builder does not have default connections.

Return type:

lenskit.pipeline._builder.PipelineBuilder

train(data, options=None)#

Trains the pipeline’s trainable components (those implementing the Trainable interface) on some training data.

If the retrain option is False, this method will skip training components that are already trained (as reported by the is_trained() method).

Random Number Generation

If TrainingOptions.rng is set and is not a generator or bit generator (i.e. it is a seed), then this method wraps the seed in a SeedSequence and calls spawn() to generate a distinct seed for each component in the pipeline.

Parameters:
Return type:

None

run(/, **kwargs: object) object#
run(node: str, /, **kwargs: object) object
run(nodes: tuple[str, Ellipsis], /, **kwargs: object) tuple[object, Ellipsis]
run(node: lenskit.pipeline.nodes.Node[T], /, **kwargs: object) T
run(nodes: tuple[lenskit.pipeline.nodes.Node[T1], lenskit.pipeline.nodes.Node[T2]], /, **kwargs: object) tuple[T1, T2]
run(nodes: tuple[lenskit.pipeline.nodes.Node[T1], lenskit.pipeline.nodes.Node[T2], lenskit.pipeline.nodes.Node[T3]], /, **kwargs: object) tuple[T1, T2, T3]
run(nodes: tuple[lenskit.pipeline.nodes.Node[T1], lenskit.pipeline.nodes.Node[T2], lenskit.pipeline.nodes.Node[T3], lenskit.pipeline.nodes.Node[T4]], /, **kwargs: object) tuple[T1, T2, T3, T4]
run(nodes: tuple[lenskit.pipeline.nodes.Node[T1], lenskit.pipeline.nodes.Node[T2], lenskit.pipeline.nodes.Node[T3], lenskit.pipeline.nodes.Node[T4], lenskit.pipeline.nodes.Node[T5]], /, **kwargs: object) tuple[T1, T2, T3, T4, T5]

Run the pipeline and obtain the return value(s) of one or more of its components. See Execution for details of the pipeline execution model.

Parameters:
  • nodes – The component(s) to run.

  • kwargs – The pipeline’s inputs, as defined with create_input(). These are passed as-is to run_all(), so they can also contain auxillary options like _profile.

Returns:

The pipeline result. If no nodes are supplied, this is the result of the default node. If a single node is supplied, it is the result of that node. If a tuple of nodes is supplied, it is a tuple of their results.

Raises:
  • PipelineError – when there is a pipeline configuration error (e.g. a cycle).

  • ValueError – when one or more required inputs are missing.

  • TypeError – when one or more required inputs has an incompatible type.

  • other – exceptions thrown by components are passed through.

run_all(*nodes, _profile=None, **kwargs)#

Run all nodes in the pipeline, or all nodes required to fulfill the requested node, and return a mapping with the full pipeline state (the data attached to each node). This is useful in cases where client code needs to be able to inspect the data at arbitrary steps of the pipeline. It differs from run() in two ways:

  1. It returns the data from all nodes as a mapping (dictionary-like object), not just the specified nodes as a tuple.

  2. If no nodes are specified, it runs all nodes. This has the consequence of running nodes that are not required to fulfill the last node (such scenarios typically result from using use_first_of()).

Parameters:
Returns:

The full pipeline state, with default set to the last node specified.

Return type:

lenskit.pipeline._state.PipelineState

class lenskit.pipeline.PipelineProfiler(pipeline, file)#

Collect pipeline run statistics for profiling pipeline executions.

Parameters:
writer: csv.DictWriter[str]#
output: TextIO#
sink_id: uuid.UUID#
set_stages(stages)#
Parameters:

stages (list[str])

multiprocess()#
Return type:

ProfileSink

close()#
record(record)#
Parameters:

record (dict[str, float])

run_profiler()#
__enter__()#
__exit__(*args)#
class lenskit.pipeline.ProfileSink#

Bases: lenskit.logging.multiprocess.RecordSink[dict[str, float]], Protocol

Interface for creating recording pipeline run profiling information.

multiprocess()#

Obtain a version of this sink that can be shared across processes.

Return type:

ProfileSink

run_profiler()#

Get a profiler for a single run using this sink.

Return type:

RunProfiler

class lenskit.pipeline.PipelineState(state=None, aliases=None, default=None, meta=None)#

Bases: collections.abc.Mapping[str, Any]

Full results of running a pipeline. A pipeline state is a dictionary mapping node names to their results; it is implemented as a separate class instead of directly using a dictionary to allow data to be looked up by node aliases in addition to original node names (and to be read-only).

Client code will generally not construct this class directly.

Stability:

Calller

Parameters:
  • state (dict[str, Any] | None) – The pipeline state to wrap. The state object stores a reference to this dictionary.

  • aliases (dict[str, str] | None) – Dictionary of node aliases.

  • default (str | None) – The name of the default node (whose data should be returned by default ).

  • meta (lenskit.pipeline.config.PipelineMeta | None) – The metadata for the pipeline generating this state.

meta: lenskit.pipeline.config.PipelineMeta | None#

Pipeline metadata.

property default: Any#

Return the data from of the default node (typically the last node run).

Returns:

The data associated with the default node.

Raises:

ValueError – if there is no specified default node.

Return type:

Any

property default_node: str | None#

Return the name of the default node (typically the last node run).

Return type:

str | None

__len__()#
__contains__(key)#
Parameters:

key (object)

Return type:

bool

__getitem__(key)#
Parameters:

key (str)

Return type:

Any

__iter__()#
Return type:

Iterator[str]

__str__()#
Return type:

str

__repr__()#
Return type:

str

Exported Aliases#

exception lenskit.pipeline.PipelineError#

Re-exported alias for lenskit.diagnostics.PipelineError.

exception lenskit.pipeline.PipelineWarning#

Re-exported alias for lenskit.diagnostics.PipelineWarning.

class lenskit.pipeline.Lazy#

Re-exported alias for lenskit.lazy.Lazy.

class lenskit.pipeline.Component#

Re-exported alias for lenskit.pipeline.components.Component.

class lenskit.pipeline.ComponentConstructor#

Re-exported alias for lenskit.pipeline.components.ComponentConstructor.

lenskit.pipeline.PipelineFunction#

Re-exported alias for lenskit.pipeline.components.PipelineFunction.

class lenskit.pipeline.PipelineConfig#

Re-exported alias for lenskit.pipeline.config.PipelineConfig.

class lenskit.pipeline.Node#

Re-exported alias for lenskit.pipeline.nodes.Node.