docstr: Compute the agreement between a classifier prediction on an instance to be explained
  and the prediction on a set of samples which have a subset of features fixed to a
  given value (aka compute the precision of anchors).
  
  Parameters
  ----------
  samples
      Samples whose labels are to be compared with the instance label.
  
  Returns
  -------
  A `numpy` boolean array indicating whether the prediction was the same as the instance label.
docstr_tok: ["Compute","the","agreement","between","a","classifier","prediction","on","an","instance","to","be","explained","and","the","prediction","on","a","set","of","samples","which","have","a","subset","of","features","fixed","to","a","given","value","(","aka","compute","the","precision","of","anchors",")",".","Parameters","--","--","--","--","--","samples","Samples","whose","labels","are","to","be","compared","with","the","instance","label",".","Returns","--","--","--","-","A","`","numpy","`","boolean","array","indicating","whether","the","prediction","was","the","same","as","the","instance","label","."]
code: def compare_labels(self, samples: np.ndarray) -> np.ndarray:
      """
      Compute the agreement between a classifier prediction on an instance to be explained
      and the prediction on a set of samples which have a subset of features fixed to a
      given value (aka compute the precision of anchors).
  
      Parameters
      ----------
      samples
          Samples whose labels are to be compared with the instance label.
  
      Returns
      -------
      A `numpy` boolean array indicating whether the prediction was the same as the instance label.
      """
      return self.predictor(samples.tolist()) == self.instance_label
  
imports: import copy
  import logging
  import string
  from copy import deepcopy
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import spacy
  from alibi.utils.missing_optional_dependency import import_optional
  from alibi.api.defaults import DEFAULT_DATA_ANCHOR, DEFAULT_META_ANCHOR
  from alibi.api.interfaces import Explainer, Explanation
  from alibi.exceptions import PredictorCallError, PredictorReturnTypeError
  from alibi.utils.wrappers import ArgmaxTransformer
  from .anchor_base import AnchorBaseBeam
  from .anchor_explanation import AnchorExplanation
  from .text_samplers import UnknownSampler, SimilaritySampler, load_spacy_lexeme_prob
label_desc: Use image node_id 4 for calling the AnchorText obj's underlying member method code with example usage: obj.compare_labels(samples) and returns: unknown