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: Fits the label model.
  
  Args:
      include_annotated_records: Whether to include annotated records in the fitting.
      **kwargs: Passed on to the FlyingSquid's
          `LabelModel.fit() <https://github.com/HazyResearch/flyingsquid/blob/master/flyingsquid/label_model.py#L320>`__
          method.
docstr_tok: ["Fits","the","label","model",".","Args",":","include_annotated_records",":","Whether","to","include","annotated","records","in","the","fitting",".","*","*","kwargs",":","Passed","on","to","the","FlyingSquid's","`","LabelModel.fit","(",")","<","https",":","\/\/github.com\/HazyResearch\/flyingsquid\/blob\/master\/flyingsquid\/label_model.py","#","L320",">","`","__","method","."]
code: def fit(self, include_annotated_records: bool = False, **kwargs):
      """Fits the label model.
  
      Args:
          include_annotated_records: Whether to include annotated records in the fitting.
          **kwargs: Passed on to the FlyingSquid's
              `LabelModel.fit() <https://github.com/HazyResearch/flyingsquid/blob/master/flyingsquid/label_model.py#L320>`__
              method.
      """
      wl_matrix = self._weak_labels.matrix(
          has_annotation=None if include_annotated_records else False
      )
  
      models = []
      # create a label model for each label (except for binary classification)
      # much of the implementation is taken from wrench:
      # https://github.com/JieyuZ2/wrench/blob/main/wrench/labelmodel/flyingsquid.py
      # If binary, we only need one model
      for i in range(
          1
          if self._weak_labels.cardinality == 2
          else self._weak_labels.cardinality
      ):
          model = self._FlyingSquidLabelModel(
              m=len(self._weak_labels.rules), **self._init_kwargs
          )
          wl_matrix_i = self._copy_and_transform_wl_matrix(wl_matrix, i)
          model.fit(L_train=wl_matrix_i, **kwargs)
          models.append(model)
  
      self._models = models
  
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 2 for calling the FlyingSquid obj's underlying member method code with example usage: obj.fit(include_annotated_records) without return types