示例#1
0
def _step_id_to_string(
    step_id: int,
    pipeline: TrainablePipeline,
    cls2label: Dict[str, str] = {},
) -> str:
    if step_id == _DUMMY_INPUT_STEP:
        return "INP"
    if step_id == _DUMMY_SCORE_STEP:
        return "SCR"
    step = pipeline.steps_list()[step_id]
    cls = step.class_name()
    return cls2label[cls] if cls in cls2label else step.name()
示例#2
0
 def get_operation(self, pipeline: TrainablePipeline) -> _Operation:
     if self.step_id == _DUMMY_INPUT_STEP:
         return _Operation.SCAN
     step = pipeline.steps_list()[self.step_id]
     return _Operation.TRANSFORM if step.is_transformer(
     ) else _Operation.PREDICT