class_docstr: A collection of parameters, metrics, and artifacts to create a ML model.
class_docstr_tok: ["A","collection","of","parameters",",","metrics",",","and","artifacts","to","create","a","ML","model","."]
docstr: Create and log a precision recall graph artifact for Studio UI to render.
  
  The artifact is stored in S3 and represented as a lineage artifact
  with an association with the run.
  
  You can view the artifact in the UI.
  If your job is created by a pipeline execution you can view the artifact
  by selecting the corresponding step in the pipelines UI.
  See also `SageMaker Pipelines <https://aws.amazon.com/sagemaker/pipelines/>`_
  
  This method requires sklearn library.
  
  Args:
      y_true (list or array): True labels. If labels are not binary
          then positive_label should be given.
      predicted_probabilities (list or array): Estimated/predicted probabilities.
      positive_label (str or int): Label of the positive class (default: None).
      title (str): Title of the graph (default: None).
      is_output (bool): Determines direction of association to the
          run. Defaults to True (output artifact).
          If set to False then represented as input association.
      no_skill (int): The precision threshold under which the classifier cannot discriminate
          between the classes and would predict a random class or a constant class in
          all cases (default: None).
docstr_tok: ["Create","and","log","a","precision","recall","graph","artifact","for","Studio","UI","to","render",".","The","artifact","is","stored","in","S3","and","represented","as","a","lineage","artifact","with","an","association","with","the","run",".","You","can","view","the","artifact","in","the","UI",".","If","your","job","is","created","by","a","pipeline","execution","you","can","view","the","artifact","by","selecting","the","corresponding","step","in","the","pipelines","UI",".","See","also","`","SageMaker","Pipelines","<","https",":","\/\/aws.amazon.com\/sagemaker\/pipelines\/",">","`","_","This","method","requires","sklearn","library",".","Args",":","y_true","(","list","or","array",")",":","True","labels",".","If","labels","are","not","binary","then","positive_label","should","be","given",".","predicted_probabilities","(","list","or","array",")",":","Estimated\/predicted","probabilities",".","positive_label","(","str","or","int",")",":","Label","of","the","positive","class","(","default",":","None",")",".","title","(","str",")",":","Title","of","the","graph","(","default",":","None",")",".","is_output","(","bool",")",":","Determines","direction","of","association","to","the","run",".","Defaults","to","True","(","output","artifact",")",".","If","set","to","False","then","represented","as","input","association",".","no_skill","(","int",")",":","The","precision","threshold","under","which","the","classifier","can","not","discriminate","between","the","classes","and","would","predict","a","random","class","or","a","constant","class","in","all","cases","(","default",":","None",")","."]
code: def log_precision_recall(
      self,
      y_true: Union[list, array],
      predicted_probabilities: Union[list, array],
      positive_label: Optional[Union[str, int]] = None,
      title: Optional[str] = None,
      is_output: bool = True,
      no_skill: Optional[int] = None,
  ):
      """Create and log a precision recall graph artifact for Studio UI to render.
  
      The artifact is stored in S3 and represented as a lineage artifact
      with an association with the run.
  
      You can view the artifact in the UI.
      If your job is created by a pipeline execution you can view the artifact
      by selecting the corresponding step in the pipelines UI.
      See also `SageMaker Pipelines <https://aws.amazon.com/sagemaker/pipelines/>`_
  
      This method requires sklearn library.
  
      Args:
          y_true (list or array): True labels. If labels are not binary
              then positive_label should be given.
          predicted_probabilities (list or array): Estimated/predicted probabilities.
          positive_label (str or int): Label of the positive class (default: None).
          title (str): Title of the graph (default: None).
          is_output (bool): Determines direction of association to the
              run. Defaults to True (output artifact).
              If set to False then represented as input association.
          no_skill (int): The precision threshold under which the classifier cannot discriminate
              between the classes and would predict a random class or a constant class in
              all cases (default: None).
      """
  
      verify_length_of_true_and_predicted(
          true_labels=y_true,
          predicted_attrs=predicted_probabilities,
          predicted_attrs_name="predicted probabilities",
      )
  
      get_module("sklearn")
      from sklearn.metrics import (
          precision_recall_curve,
          average_precision_score,
      )
  
      kwargs = {}
      if positive_label is not None:
          kwargs["pos_label"] = positive_label
  
      precision, recall, _ = precision_recall_curve(
          y_true, predicted_probabilities, **kwargs
      )
  
      kwargs["average"] = "micro"
      ap = average_precision_score(
          y_true, predicted_probabilities, **kwargs
      )
  
      data = {
          "type": "PrecisionRecallCurve",
          "version": 0,
          "title": title,
          "precision": precision.tolist(),
          "recall": recall.tolist(),
          "averagePrecisionScore": ap,
          "noSkill": no_skill,
      }
      self._log_graph_artifact(
          artifact_name=title,
          data=data,
          graph_type="PrecisionRecallCurve",
          is_output=is_output,
      )
  
imports: from __future__ import absolute_import
  import datetime
  import logging
  from enum import Enum
  from math import isnan, isinf
  from numbers import Number
  from typing import Optional, List, Dict, TYPE_CHECKING, Union
  import dateutil
  from numpy import array
  from sagemaker.apiutils import _utils
  from sagemaker.experiments import _api_types
  from sagemaker.experiments._api_types import TrialComponentArtifact, _TrialComponentStatusType
  from sagemaker.experiments._helper import _ArtifactUploader, _LineageArtifactTracker, _DEFAULT_ARTIFACT_PREFIX
  from sagemaker.experiments._environment import _RunEnvironment
  from sagemaker.experiments._run_context import _RunContext
  from sagemaker.experiments.experiment import Experiment
  from sagemaker.experiments._metrics import _MetricsManager
  from sagemaker.experiments.trial import _Trial
  from sagemaker.experiments.trial_component import _TrialComponent
  from sagemaker.utils import get_module, unique_name_from_base, format_tags, Tags, TagsDict
  from sagemaker.experiments._utils import guess_media_type, resolve_artifact_name, verify_length_of_true_and_predicted, validate_invoked_inside_run_context, get_tc_and_exp_config_from_job_env, verify_load_input_names, is_run_trial_component
label_desc: Use image node_id 6 for calling the Run obj's underlying member method code with example usage: obj.log_precision_recall(y_true, predicted_probabilities, positive_label, title, is_output, no_skill) without return types