code: def f1_score_least_frequent(
      y_true: np.ndarray, y_pred: np.ndarray
  ) -> float:
      """
      Calculate F1 score of the least frequent label/class.
  
      Parameters
      ----------
      y_true : numpy.ndarray
          The true/actual/gold labels for the data.
      y_pred : numpy.ndarray
          The predicted/observed labels for the data.
  
      Returns
      -------
      float
          F1 score of the least frequent label.
      """
      least_frequent = np.bincount(y_true).argmin()
      return f1_score(y_true, y_pred, average=None)[least_frequent]
  
file_path: skll/skll/metrics.py
imports: import copy
  import sys
  from importlib import import_module
  from inspect import signature
  from pathlib import Path
  from typing import Optional, Union
  import numpy
  from scipy.stats import kendalltau, pearsonr, spearmanr
  from sklearn.metrics import confusion_matrix, f1_score, fbeta_score, get_scorer, get_scorer_names, make_scorer
  from skll.types import PathOrStr
label_desc: Use image node_id 3 for calling a global function with example usage: f1_score_least_frequent(y_true, y_pred) and returns: f1_score