pipeline.handle package
Submodules
pipeline.handle.pcloud_concat_handler module
- class pipeline.handle.pcloud_concat_handler.PcloudConcatHandler(**kwargs)
Bases:
object- Author:
Alberto M. Esmoris Pena
A handler for the extra logic needed by the
"in_pcloud_concat"input specification of a pipeline.- __init__(**kwargs)
Handles the initilization of an input point cloud concatenation handler for sequential pipelines.
- Parameters:
kwargs – The attributes for the pipeline’s input point cloud concatenation handler.
- handle_input_concats(concats)
Handle the advanced input point cloud specification.
See
SequentialPipeline,SequentialPipeline.run_for_in_pcloud_concat(), andPcloudConcatHandler.handle_input_concat().- Parameters:
concats (dict) – The specification for each input point cloud involved in the concatenation.
- Returns:
The resulting point cloud from th concatenation of many other point clouds.
- Return type:
- handle_input_concat(i, concat, fnames, X, F, y)
Handle a single point cloud.
First, apply the FPS transformation if any (see
PcloudConcatHandler.handle_fps_transformation()), then consider the class-wise sampling if any (seePcloudConcatHandler.handle_classwise_sampling()), afterward handle the transformations of the structure space (seePcloudConcatHandler.handle_structure_transform()), and also apply the specific handling logic for the first iteration (seePcloudConcatHandler.handle_first_conact()).See also
PcloudConcatHandler.handle_input_concats().- Parameters:
i (int) – The index of the current concatenation starting at \(i=0\).
concat (dict) – The concatenation specification.
fnames (list of str) – The list of feature names. It can be None when \(i=0\) as it is derived in the first iteration. It must be None for iterations after the first one.
X (list of
np.ndarray) – The list where the different structure space matrices are appended.F (list of
np.ndarray) – The list where the different feature space matrices are appended.y (list of
np.ndarray) – The list where the different classification vectors are appended.
- Returns:
The feature names and the transformed point cloud.
- Return type:
tuple of (list of str) and (
PointCloud)
- handle_structure_transform(concat, Xi)
Transform the given structure space by applying corresponding translations (either as straightforward translations or as explicit center specifications).
- Parameters:
concat (dict) – The concatenation specification.
Xi (
np.ndarray) – The current structure space matrix.
- Returns:
Nothing at all, but the Xi structure space matrix is updated in place.
- handle_first_concat(concat, pcloud_i)
Handle the first concatenation, i.e., the specification that corresponds to the loop in
PcloudConcatHandler.handle_input_concat()when \(i=0\).- Parameters:
concat (dict) – The concatenation specification.
pcloud_i (
PointCloud) – The point cloud that is being handled.
- Returns:
The list of feature names derived from the first concatenation.
- Return type:
list of str
- handle_mindist_decimation(concat, pcloud_i)
Handle the minimum distance decimation of the given point cloud.
- Parameters:
concat (dict) – The concatenation specification.
pcloud_i (
PointCloud) – The point cloud that is being handled.
- Returns:
The transformed point cloud.
- Return type:
- handle_fps_transformation(concat, pcloud_i)
Handle the FPS transformation of the given point cloud.
- Parameters:
concat (dict) – The concatenation specification.
pcloud_i (
PointCloud) – The point cloud that is being handled.
- Returns:
The transformed point cloud.
- Return type:
- handle_classwise_sampling(concat, pcloud_i)
Sample the point from the given point cloud to match the specified class distribution as close as possible. If there are not enough points of one class to satisfied the required amount, the maximum available amount of points will be considered. In other words, no replacement or bootstrapping will be applied to inflate the point cloud.
- Parameters:
concat (dict) – The concatenation specification.
pcloud_i (
PointCloud) – The point cloud that is being handled.
- Returns:
The transformed point cloud.
- Return type:
pipeline.handle.pipeline_decoration_handler module
- class pipeline.handle.pipeline_decoration_handler.PipelineDecorationHandler(**kwargs)
Bases:
object- Author:
Alberto M. Esmoris Pena
A handler for the extra logic needed by decorated components to work correctly.
See
FPSDecoratorTransformer,FPSDecoratedModel, andFPSDecoratedMiner.- __init__(**kwargs)
Handles the initialization of a pipeline decoration handler for sequential pipelines .
- Parameters:
kwargs – The attributes for the pipeline’s decoration handler.
- handle_preprocess_decoration(state, comp, comp_id, comps)
Handle the decoration of the pipeline at the preprocess stage.
See
PipelineExecutor,PipelineExecutor.__call__(), andPipelineExecutor.pre_process().- Returns:
Nothing, modifications (if needed) will happen in the received input objects directly.
Module contents
- author:
Alberto M. Esmoris Pena
The pipeline.handle package contains the logic to handle general extensions
of pipelines, e.g., to handle any special logic demanded by decorated
components to work correctly (see decorator pattern,
FPSDecoratedMiner, FPSDecoratedModel, and
FPSDecoratorTransformer).