MultiModalPredictor.predict

MultiModalPredictor.predict(data: DataFrame | dict | list | str, candidate_data: DataFrame | dict | list | None = None, id_mappings: Dict[str, Dict] | Dict[str, Series] | None = None, as_pandas: bool | None = None, realtime: bool | None = False, save_results: bool | None = None, **kwargs)[source]

预测新数据的标签列值。

Parameters:
  • data – 用于进行预测的数据。应包含与训练数据相同的列名,并遵循相同的格式(除了label列)。

  • candidate_data – The candidate data from which to search the query data’s matches.

  • id_mappings – Id-to-content mappings. The contents can be text, image, etc. This is used when data contain the query/response identifiers instead of their contents.

  • as_pandas – Whether to return the output as a pandas DataFrame(Series) (True) or numpy array (False).

  • realtime – Whether to do realtime inference, which is efficient for small data (default False). If provided None, we would infer it on based on the data modalities and sample number.

  • save_results – 是否保存预测结果(目前仅适用于检测)

  • **kwargs – 传递给底层学习器的预测方法的额外关键字参数。 例如,as_coco 用于目标检测任务。

Returns:

  • 预测数组,每个数组对应给定数据集中的每一行。

  • 格式取决于特定的学习器和提供的参数。