class_docstr: The LogisticRidgeRegression class is used to fit logistic ridge regression models against one or more labels optimized over a
  provided list of ridge alpha parameters. The optimal ridge alpha value is chosen for each label by minimizing the
  average out of fold log_loss scores.
docstr: Generates predictions for the target labels in the provided label DataFrame by applying the model resulting from
  the LogisticRidgeRegression fit method to the starting reduced block matrix using
  a leave-one-chromosome-out (LOCO) approach (this method caches the model and cross-validation DataFrames in the
  process for better performance).
  
  Args:
      response : String specifying the desired output.  Can be 'linear' to specify the direct output of the linear
          WGR model (default) or 'sigmoid' to specify predicted label probabilities.
      chromosomes : List of chromosomes for which to generate a prediction (optional). If not provided, the
          chromosomes will be inferred from the block matrix.
  
  Returns:
      Pandas DataFrame containing prediction y_hat values per chromosome. The rows are indexed by sample ID and
      chromosome; the columns are indexed by label. The column types are float64. The DataFrame is sorted using
      chromosome as the primary sort key, and sample ID as the secondary sort key.
docstr_tok: ["Generates","predictions","for","the","target","labels","in","the","provided","label","DataFrame","by","applying","the","model","resulting","from","the","LogisticRidgeRegression","fit","method","to","the","starting","reduced","block","matrix","using","a","leave-one-chromosome-out","(","LOCO",")","approach","(","this","method","caches","the","model","and","cross-validation","DataFrames","in","the","process","for","better","performance",")",".","Args",":","response",":","String","specifying","the","desired","output",".","Can","be","'linear","'","to","specify","the","direct","output","of","the","linear","WGR","model","(","default",")","or","'sigmoid","'","to","specify","predicted","label","probabilities",".","chromosomes",":","List","of","chromosomes","for","which","to","generate","a","prediction","(","optional",")",".","If","not","provided",",","the","chromosomes","will","be","inferred","from","the","block","matrix",".","Returns",":","Pandas","DataFrame","containing","prediction","y_hat","values","per","chromosome",".","The","rows","are","indexed","by","sample","ID","and","chromosome",";","the","columns","are","indexed","by","label",".","The","column","types","are","float64",".","The","DataFrame","is","sorted","using","chromosome","as","the","primary","sort","key",",","and","sample","ID","as","the","secondary","sort","key","."]
code: def transform_loco(
      self, response: str = "linear", chromosomes: List[str] = []
  ) -> pd.DataFrame:
      """
      Generates predictions for the target labels in the provided label DataFrame by applying the model resulting from
      the LogisticRidgeRegression fit method to the starting reduced block matrix using
      a leave-one-chromosome-out (LOCO) approach (this method caches the model and cross-validation DataFrames in the
      process for better performance).
  
      Args:
          response : String specifying the desired output.  Can be 'linear' to specify the direct output of the linear
              WGR model (default) or 'sigmoid' to specify predicted label probabilities.
          chromosomes : List of chromosomes for which to generate a prediction (optional). If not provided, the
              chromosomes will be inferred from the block matrix.
  
      Returns:
          Pandas DataFrame containing prediction y_hat values per chromosome. The rows are indexed by sample ID and
          chromosome; the columns are indexed by label. The column types are float64. The DataFrame is sorted using
          chromosome as the primary sort key, and sample ID as the secondary sort key.
      """
      loco_chromosomes = (
          chromosomes
          if chromosomes
          else infer_chromosomes(self.reduced_block_df)
      )
      loco_chromosomes.sort()
  
      # Cache model and CV DataFrames to avoid re-computing for each chromosome
      self._cache_model_cv_df()
  
      y_hat_df = pd.DataFrame({})
      orig_model_df = self.model_df
      for chromosome in loco_chromosomes:
          print(f"Generating predictions for chromosome {chromosome}.")
          loco_model_df = self.model_df.filter(
              ~f.col("header").rlike(f"^chr_{chromosome}_(alpha|block)")
          )
          self.model_df = loco_model_df
          loco_y_hat_df = self.transform(response)
          loco_y_hat_df["contigName"] = chromosome
          y_hat_df = y_hat_df.append(loco_y_hat_df)
          self.model_df = orig_model_df
  
      self.y_hat_df = y_hat_df.set_index("contigName", append=True)
      self._unpersist_model_cv_df()
      return self.y_hat_df
  
imports: from .logistic_udfs import *
  from .ridge_reduction import RidgeReduction
  from .model_functions import _prepare_labels_and_warn, _prepare_covariates, _check_model, _check_cv, _is_binary
  from nptyping import Float, NDArray
  import pandas
  from pyspark.sql import DataFrame
  from pyspark.sql.functions import pandas_udf, PandasUDFType
  import pyspark.sql.functions
  from typeguard import typechecked
  from typing import Any, Dict, List
  import warnings
  from glow.logging import record_hls_event
label_desc: Use image node_id 15 for calling the LogisticRidgeRegression obj's underlying member method code with example usage: obj.transform_loco(response, chromosomes) and returns: self