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: Transforms a starting reduced block matrix by applying a linear model.  The form of the output
  can either be a direct linear transformation (response = "linear") or a linear transformation followed by a
  sigmoid transformation (response = "sigmoid").
  
  Args:
      response : String specifying what transformation to apply ("linear" or "sigmoid")
  
  Returns:
      Spark DataFrame containing the result of the transformation.
docstr_tok: ["Transforms","a","starting","reduced","block","matrix","by","applying","a","linear","model",".","The","form","of","the","output","can","either","be","a","direct","linear","transformation","(","response","=","``","linear","''",")","or","a","linear","transformation","followed","by","a","sigmoid","transformation","(","response","=","``","sigmoid","''",")",".","Args",":","response",":","String","specifying","what","transformation","to","apply","(","``","linear","''","or","``","sigmoid","''",")","Returns",":","Spark","DataFrame","containing","the","result","of","the","transformation","."]
code: def reduce_block_matrix(self, response: str) -> DataFrame:
      """
      Transforms a starting reduced block matrix by applying a linear model.  The form of the output
      can either be a direct linear transformation (response = "linear") or a linear transformation followed by a
      sigmoid transformation (response = "sigmoid").
  
      Args:
          response : String specifying what transformation to apply ("linear" or "sigmoid")
  
      Returns:
          Spark DataFrame containing the result of the transformation.
      """
  
      transform_key_pattern = ["sample_block", "label"]
  
      if response == "linear":
          warnings.warn("Ignoring any covariates for linear response")
          transform_udf = pandas_udf(
              lambda key, pdf: apply_model(
                  key,
                  transform_key_pattern,
                  pdf,
                  self._label_df,
                  self.sample_blocks,
                  self._alphas,
                  pd.DataFrame({}),
              ),
              reduced_matrix_struct,
              PandasUDFType.GROUPED_MAP,
          )
          join_type = "inner"
      elif response == "sigmoid":
          transform_udf = pandas_udf(
              lambda key, pdf: apply_logistic_model(
                  key,
                  transform_key_pattern,
                  pdf,
                  self._label_df,
                  self.sample_blocks,
                  self._alphas,
                  self._std_cov_df,
              ),
              logistic_reduced_matrix_struct,
              PandasUDFType.GROUPED_MAP,
          )
          join_type = "right"
      else:
          raise ValueError(
              f'response must be either "linear" or "sigmoid", received "{response}"'
          )
  
      return apply_model_df(
          self.reduced_block_df,
          self.model_df,
          self.cv_df,
          transform_udf,
          transform_key_pattern,
          join_type,
      )
  
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 13 for calling the LogisticRidgeRegression obj's underlying member method code with example usage: obj.reduce_block_matrix(response) and returns: apply_model_df