class_docstr: The label model by `FlyingSquid <https://github.com/HazyResearch/flyingsquid>`__.
  
  .. note:: It is not suited for multi-label classification and does not support it!
  
  Args:
      weak_labels: A `WeakLabels` object containing the weak labels and records.
      **kwargs: Passed on to the init of the FlyingSquid's
          `LabelModel <https://github.com/HazyResearch/flyingsquid/blob/master/flyingsquid/label_model.py#L18>`__.
  
  Examples:
      >>> from argilla.labeling.text_classification import WeakLabels
      >>> weak_labels = WeakLabels(dataset="my_dataset")
      >>> label_model = FlyingSquid(weak_labels)
      >>> label_model.fit()
      >>> records = label_model.predict()
class_docstr_tok: ["The","label","model","by","`","FlyingSquid","<","https",":","\/\/github.com\/HazyResearch\/flyingsquid",">","`","__",".","..","note",":",":","It","is","not","suited","for","multi-label","classification","and","does","not","support","it","!","Args",":","weak_labels",":","A","`","WeakLabels","`","object","containing","the","weak","labels","and","records",".","*","*","kwargs",":","Passed","on","to","the","init","of","the","FlyingSquid's","`","LabelModel","<","https",":","\/\/github.com\/HazyResearch\/flyingsquid\/blob\/master\/flyingsquid\/label_model.py","#","L18",">","`","__",".","Examples",":",">",">",">","from","argilla.labeling.text_classification","import","WeakLabels",">",">",">","weak_labels","=","WeakLabels","(","dataset=","''","my_dataset","''",")",">",">",">","label_model","=","FlyingSquid","(","weak_labels",")",">",">",">","label_model.fit","(",")",">",">",">","records","=","label_model.predict","(",")"]
docstr: Helper function to copy and transform the weak label matrix with respect to a target label.
  
   FlyingSquid expects the matrix to contain -1, 0 and 1, which are mapped the following way:
  
  - target label: -1
  - abstain label: 0
  - other label: 1
  
  Args:
      weak_label_matrix: The original weak label matrix
      i: Index of the target label
  
  Returns:
      A copy of the weak label matrix, transformed with respect to the target label.
docstr_tok: ["Helper","function","to","copy","and","transform","the","weak","label","matrix","with","respect","to","a","target","label",".","FlyingSquid","expects","the","matrix","to","contain","-1",",","0","and","1",",","which","are","mapped","the","following","way",":","-","target","label",":","-1","-","abstain","label",":","0","-","other","label",":","1","Args",":","weak_label_matrix",":","The","original","weak","label","matrix","i",":","Index","of","the","target","label","Returns",":","A","copy","of","the","weak","label","matrix",",","transformed","with","respect","to","the","target","label","."]
code: def _copy_and_transform_wl_matrix(
      self, weak_label_matrix: np.ndarray, i: int
  ):
      """Helper function to copy and transform the weak label matrix with respect to a target label.
  
       FlyingSquid expects the matrix to contain -1, 0 and 1, which are mapped the following way:
  
      - target label: -1
      - abstain label: 0
      - other label: 1
  
      Args:
          weak_label_matrix: The original weak label matrix
          i: Index of the target label
  
      Returns:
          A copy of the weak label matrix, transformed with respect to the target label.
      """
      wl_matrix_i = weak_label_matrix.copy()
  
      target_mask = (
          wl_matrix_i
          == self._weak_labels.label2int[self._weak_labels.labels[i]]
      )
      abstain_mask = wl_matrix_i == self._weak_labels.label2int[None]
      other_mask = (~target_mask) & (~abstain_mask)
  
      wl_matrix_i[target_mask] = -1
      wl_matrix_i[abstain_mask] = 0
      wl_matrix_i[other_mask] = 1
  
      return wl_matrix_i
  
imports: import hashlib
  import logging
  from enum import Enum
  from typing import Dict, List, Tuple, Union
  import numpy
  from argilla import DatasetForTextClassification, TextClassificationRecord
  from argilla.labeling.text_classification.weak_labels import WeakLabels, WeakMultiLabels
  from argilla.utils.dependency import requires_dependencies
label_desc: Use image node_id 3 for calling the FlyingSquid obj's underlying member method code with example usage: obj._copy_and_transform_wl_matrix(weak_label_matrix, i) and returns: wl_matrix_i