class_docstr: Evaluate a model based on its accuracy on a labeled dataset
  
  This requires a model with LossFunction.SOFTMAX
  
  The results are written in a CSV. If a CSV already exists, then values are appended.
class_docstr_tok: ["Evaluate","a","model","based","on","its","accuracy","on","a","labeled","dataset","This","requires","a","model","with","LossFunction.SOFTMAX","The","results","are","written","in","a","CSV",".","If","a","CSV","already","exists",",","then","values","are","appended","."]
docstr: Constructs an evaluator for the given dataset
  
  :param dataloader:
      the data for the evaluation
docstr_tok: ["Constructs","an","evaluator","for","the","given","dataset",":","param","dataloader",":","the","data","for","the","evaluation"]
code: def __init__(
      self,
      dataloader: DataLoader,
      name: str = "",
      softmax_model=None,
      write_csv: bool = True,
  ):
      """
      Constructs an evaluator for the given dataset
  
      :param dataloader:
          the data for the evaluation
      """
      self.dataloader = dataloader
      self.name = name
      self.softmax_model = softmax_model
  
      if name:
          name = "_" + name
  
      self.write_csv = write_csv
      self.csv_file = "accuracy_evaluation" + name + "_results.csv"
      self.csv_headers = ["epoch", "steps", "accuracy"]
  
file_path: sentence-transformers/sentence_transformers/evaluation/LabelAccuracyEvaluator.py
imports: from .None import SentenceEvaluator
  import torch
  from torch.utils.data import DataLoader
  import logging
  from ..util import batch_to_device
  import os
  import csv
label_desc: Use image node_id 1 to create a new LabelAccuracyEvaluator object from inherited base classes: SentenceEvaluator with example: obj = LabelAccuracyEvaluator(dataloader, name, softmax_model, write_csv)