pipeline.state package
Submodules
pipeline.state.pipeline_state module
- exception pipeline.state.pipeline_state.PipelineStateException(message='')
Bases:
VL3DException- Author:
Alberto M. Esmoris Pena
Class for exceptions related to the pipeline state. See
VL3DException.- __init__(message='')
- class pipeline.state.pipeline_state.PipelineState(**kwargs)
Bases:
object- Author:
Alberto M. Esmoris Pena
- Abstract class providing the interface for any pipeline state and a common
baseline implementation.
- Variables:
step (int) – The step of the pipeline. Typically, it is initialized to zero and updated for each call to the update method.
- __init__(**kwargs)
Handle the root-level (most basic) initialization of any pipeline’s state.
- Parameters:
kwargs – The attributes for the PipelineState.
- update(comp, **kwargs)
Update the pipeline’s state for a given component (e.g,
Miner,ModelOp, andImputer) that has been executed in the pipeline.- Parameters:
comp – The component that has been executed.
- Returns:
The updated pipeline state (also updated in place).
- prepare_iter(**kwargs)
The logic to prepare an iteration. This method must handle any member attribute that needs to be updated at the beginning of each iteration.
An iteration consists of applying the many steps of the pipeline to one case. For instance, the same sequential pipeline can be used to train models using two different datasets. In this case, the first model will be generated during the first iteration, while the second model will be generated during the second iteration.
The prepare_iter method is necessary to have a pipeline state that does not propagate particularities of the first case to the second, e.g., to avoid considering the last state of the feature names in the first iteration as the initial feature names in the second iteration.
- Parameters:
kwargs – The key-word arguments to prepare the iteration.
- Returns:
The pipeline state itself is updated and returned.
- Return type:
pipeline.state.simple_pipeline_state module
- class pipeline.state.simple_pipeline_state.SimplePipelineState(**kwargs)
Bases:
PipelineState- Author:
Alberto M. Esmoris Pena
Simple pipeline state that accounts for current point cloud, feature names, and model.
- Variables:
pcloud (
PointCloud) – The point cloud corresponding to the current pipeline state.base_pcloud (
PointCloud) – The pcloud given during initialization. While pcloud can be updated during iterations, base_pcloud is used as a baseline point cloud defining the initial value of any iteration.model (
Model) – The model corresponding to the current pipeline state.base_model (
Model) – The model given during initialization. While model can be updated during iterations, base_model is used as a baseline model defining the initial value of any iteration.fnames (list) – The list of strings representing the feature names.
base_fnames (list) – The fnames given during initialization. While fnames can be updated during iterations, base_fnames is used as a baseline list of feature names defining the initial value of any iteration.
preds (
np.ndarray) – The predictions corresponding to the current pipeline state.base_preds (
np.ndarray) – The preds given during initialization. While preds can be updated during iterations, base_preds is used as a baseline list of predictions defining the initial value of any iteration.
- __init__(**kwargs)
Handle the initialization of a simple pipeline state.
See :class`.PipelineState` and meth:pipeline_state.PipelineState.__init__.
- prepare_iter(**kwargs)
See
pipeline_state.PipelineState.prepare_iter().
- update_pcloud(comp, new_pcloud)
Handle the update of the point cloud.
- Parameters:
comp – The component that updated the point cloud.
new_pcloud – The new point cloud.
- Returns:
Nothing but the pipeline state itself is updated.
- update_model(comp, new_model)
Handle the update of the model.
- Parameters:
comp – The component that updated the model.
new_model – The new model.
- Returns:
Nothing but the pipeline state itself is updated.
- update_preds(comp, new_preds)
Handle the update of the predictions.
- Parameters:
comp – The component that updated the predictions.
new_preds – The new predictions.
- Returns:
Nothing but the pipeline state itself is updated.
Module contents
- author:
Alberto M. Esmoris Pena
The state package contains the logic and structures to represent and handle the state of pipelines.