class_docstr: Log writer to write vdl records to log file.
  
  The class `LogWriter` provides APIs to create record file and add records to
  it. The class updates log file asynchronously without slowing down training.
class_docstr_tok: ["Log","writer","to","write","vdl","records","to","log","file",".","The","class","`","LogWriter","`","provides","APIs","to","create","record","file","and","add","records","to","it",".","The","class","updates","log","file","asynchronously","without","slowing","down","training","."]
docstr: Add an ROC curve to vdl record file.
  Args:
      tag (string): Data identifier
      labels (numpy.ndarray or list): Binary labels for each element.
      predictions (numpy.ndarray or list): The probability that an element
          be classified as true.
      step (int): Step of pr curve.
      weights (float): Multiple of data to display on the curve.
      num_thresholds (int): Number of thresholds used to draw the curve.
      walltime (int): Wall time of pr curve.
  Example:
      with LogWriter(logdir="./log/roc_curve_test/train") as writer:
          for index in range(3):
              labels = np.random.randint(2, size=100)
              predictions = np.random.rand(100)
              writer.add_roc_curve(tag='default',
                                  labels=labels,
                                  predictions=predictions,
                                  step=index)
code: def add_roc_curve(
      self,
      tag,
      labels,
      predictions,
      step,
      num_thresholds=10,
      weights=None,
      walltime=None,
  ):
      """Add an ROC curve to vdl record file.
      Args:
          tag (string): Data identifier
          labels (numpy.ndarray or list): Binary labels for each element.
          predictions (numpy.ndarray or list): The probability that an element
              be classified as true.
          step (int): Step of pr curve.
          weights (float): Multiple of data to display on the curve.
          num_thresholds (int): Number of thresholds used to draw the curve.
          walltime (int): Wall time of pr curve.
      Example:
          with LogWriter(logdir="./log/roc_curve_test/train") as writer:
              for index in range(3):
                  labels = np.random.randint(2, size=100)
                  predictions = np.random.rand(100)
                  writer.add_roc_curve(tag='default',
                                      labels=labels,
                                      predictions=predictions,
                                      step=index)
      """
      if "%" in tag:
          raise RuntimeError("% can't appear in tag!")
      walltime = (
          round(time.time() * 1000) if walltime is None else walltime
      )
      self._get_file_writer().add_record(
          roc_curve(
              tag=tag,
              labels=labels,
              predictions=predictions,
              step=step,
              walltime=walltime,
              num_thresholds=num_thresholds,
              weights=weights,
          )
      )
  
imports: import os
  import time
  import numpy
  from visualdl.component.base_component import audio
  from visualdl.component.base_component import embedding
  from visualdl.component.base_component import histogram
  from visualdl.component.base_component import hparam
  from visualdl.component.base_component import image
  from visualdl.component.base_component import meta_data
  from visualdl.component.base_component import pr_curve
  from visualdl.component.base_component import roc_curve
  from visualdl.component.base_component import scalar
  from visualdl.component.base_component import scalars
  from visualdl.component.base_component import text
  from visualdl.component.graph import translate_graph
  from visualdl.io import bfile
  from visualdl.server.log import logger
  from visualdl.utils.figure_util import figure_to_image
  from visualdl.utils.img_util import merge_images
  from visualdl.utils.md5_util import md5
  from visualdl.writer.record_writer import RecordFileWriter
label_desc: Use image node_id 17 for calling the LogWriter obj's underlying member method code with example usage: obj.add_roc_curve(tag, labels, predictions, step, num_thresholds, weights, walltime) without return types