parameters: (
          self, prediction_type: Optional[Union[int, PredictionType]] = None
      )
return_statement: return switch_prediction_type[prediction_type]()
docstring: Get prediction object from this example.
  
          Args:
              prediction_type:
                  - If None, the label type of the example's owning Workspace instance will be used.
                  - If int then corresponding :py:obj:`~vowpalwabbit.pyvw.PredictionType` for the prediction type to be retrieved.
                  - Supplying an int is deprecated and will be removed in a future release.
  
          Returns:
              Prediction according to parameter prediction_type
                  - :py:obj:`~vowpalwabbit.PredictionType.SCALAR`: float
                  - :py:obj:`~vowpalwabbit.PredictionType.SCALARS`: List[float]
                  - :py:obj:`~vowpalwabbit.PredictionType.ACTION_SCORES`: List[float]
                  - :py:obj:`~vowpalwabbit.PredictionType.ACTION_PROBS`: List[float]
                  - :py:obj:`~vowpalwabbit.PredictionType.MULTICLASS`: int
                  - :py:obj:`~vowpalwabbit.PredictionType.MULTILABELS`: List[int]
                  - :py:obj:`~vowpalwabbit.PredictionType.PROB`: float
                  - :py:obj:`~vowpalwabbit.PredictionType.MULTICLASSPROBS`: List[float]
                  - :py:obj:`~vowpalwabbit.PredictionType.DECISION_SCORES`: List[List[Tuple[int, float]]]
                  - :py:obj:`~vowpalwabbit.PredictionType.ACTION_PDF_VALUE`: Tuple[int, float]
                  - :py:obj:`~vowpalwabbit.PredictionType.PDF`: List[Tuple[float, float, float]]
                  - :py:obj:`~vowpalwabbit.PredictionType.ACTIVE_MULTICLASS`: Tuple[int, List[int]]
                  - :py:obj:`~vowpalwabbit.PredictionType.NOPRED`: str
  
          Examples:
              >>> from vowpalwabbit import Workspace, PredictionType
              >>> vw = Workspace(quiet=True)
              >>> ex = vw.example('1 |a two features |b more features here')
              >>> ex.get_prediction()
              0.0
  
          See Also:
              :meth:`vowpalwabbit.Workspace.get_prediction_type`
docstring_summary: Get prediction object from this example.
docstring_tokens: Get prediction object from this example .
function: def get_prediction(
          self, prediction_type: Optional[Union[int, PredictionType]] = None
      ) -> Union[
          float,
          List[float],
          int,
          List[int],
          float,
          List[List[Tuple[int, float]]],
          Tuple[int, float],
          List[Tuple[float, float, float]],
          Tuple[int, List[int]],
          str,
      ]:
  
          """Get prediction object from this example.
  
          Args:
              prediction_type:
                  - If None, the label type of the example's owning Workspace instance will be used.
                  - If int then corresponding :py:obj:`~vowpalwabbit.pyvw.PredictionType` for the prediction type to be retrieved.
                  - Supplying an int is deprecated and will be removed in a future release.
  
          Returns:
              Prediction according to parameter prediction_type
                  - :py:obj:`~vowpalwabbit.PredictionType.SCALAR`: float
                  - :py:obj:`~vowpalwabbit.PredictionType.SCALARS`: List[float]
                  - :py:obj:`~vowpalwabbit.PredictionType.ACTION_SCORES`: List[float]
                  - :py:obj:`~vowpalwabbit.PredictionType.ACTION_PROBS`: List[float]
                  - :py:obj:`~vowpalwabbit.PredictionType.MULTICLASS`: int
                  - :py:obj:`~vowpalwabbit.PredictionType.MULTILABELS`: List[int]
                  - :py:obj:`~vowpalwabbit.PredictionType.PROB`: float
                  - :py:obj:`~vowpalwabbit.PredictionType.MULTICLASSPROBS`: List[float]
                  - :py:obj:`~vowpalwabbit.PredictionType.DECISION_SCORES`: List[List[Tuple[int, float]]]
                  - :py:obj:`~vowpalwabbit.PredictionType.ACTION_PDF_VALUE`: Tuple[int, float]
                  - :py:obj:`~vowpalwabbit.PredictionType.PDF`: List[Tuple[float, float, float]]
                  - :py:obj:`~vowpalwabbit.PredictionType.ACTIVE_MULTICLASS`: Tuple[int, List[int]]
                  - :py:obj:`~vowpalwabbit.PredictionType.NOPRED`: str
  
          Examples:
              >>> from vowpalwabbit import Workspace, PredictionType
              >>> vw = Workspace(quiet=True)
              >>> ex = vw.example('1 |a two features |b more features here')
              >>> ex.get_prediction()
              0.0
  
          See Also:
              :meth:`vowpalwabbit.Workspace.get_prediction_type`
          """
  
          if prediction_type is None:
              prediction_type = self.vw.get_prediction_type()
  
          if not isinstance(prediction_type, PredictionType) and isinstance(
              prediction_type, int
          ):
              warnings.warn(
                  "Passing an integer to get_prediction is deprecated and will be removed in a future release. Please pass a PredictionType instead.",
                  DeprecationWarning,
              )
              prediction_type = PredictionType(prediction_type)
  
          switch_prediction_type = {
              PredictionType.SCALAR: self.get_simplelabel_prediction,
              PredictionType.SCALARS: self.get_scalars,
              PredictionType.ACTION_SCORES: self.get_action_scores,
              PredictionType.ACTION_PROBS: self.get_action_scores,
              PredictionType.MULTICLASS: self.get_multiclass_prediction,
              PredictionType.MULTILABELS: self.get_multilabel_predictions,
              PredictionType.PROB: self.get_prob,
              PredictionType.MULTICLASSPROBS: self.get_scalars,
              PredictionType.DECISION_SCORES: self.get_decision_scores,
              PredictionType.ACTION_PDF_VALUE: self.get_action_pdf_value,
              PredictionType.PDF: self.get_pdf,
              PredictionType.ACTIVE_MULTICLASS: self.get_active_multiclass,
              PredictionType.NOPRED: self.get_nopred,
          }
          return switch_prediction_type[prediction_type]()
function_tokens: def get_prediction ( self , prediction_type : Optional [ Union [ int , PredictionType ] ] = None ) -> Union [ float , List [ float ] , int , List [ int ] , float , List [ List [ Tuple [ int , float ] ] ] , Tuple [ int , float ] , List [ Tuple [ float , float , float ] ] , Tuple [ int , List [ int ] ] , str , ] : if prediction_type is None : prediction_type = self . vw . get_prediction_type ( ) if not isinstance ( prediction_type , PredictionType ) and isinstance ( prediction_type , int ) : warnings . warn ( "Passing an integer to get_prediction is deprecated and will be removed in a future release. Please pass a PredictionType instead." , DeprecationWarning , ) prediction_type = PredictionType ( prediction_type ) switch_prediction_type = { PredictionType . SCALAR : self . get_simplelabel_prediction , PredictionType . SCALARS : self . get_scalars , PredictionType . ACTION_SCORES : self . get_action_scores , PredictionType . ACTION_PROBS : self . get_action_scores , PredictionType . MULTICLASS : self . get_multiclass_prediction , PredictionType . MULTILABELS : self . get_multilabel_predictions , PredictionType . PROB : self . get_prob , PredictionType . MULTICLASSPROBS : self . get_scalars , PredictionType . DECISION_SCORES : self . get_decision_scores , PredictionType . ACTION_PDF_VALUE : self . get_action_pdf_value , PredictionType . PDF : self . get_pdf , PredictionType . ACTIVE_MULTICLASS : self . get_active_multiclass , PredictionType . NOPRED : self . get_nopred , } return switch_prediction_type [ prediction_type ] ( )