class_docstr: The RidgeRegression class is used to fit ridge models against one or more labels optimized over a provided list of
  ridge alpha parameters.  It is similar in function to RidgeReduction except that whereas RidgeReduction attempts to
  reduce a starting matrix X to a block matrix of smaller dimension, RidgeRegression is intended to find an optimal
  model of the form Y_hat ~ XB, where Y_hat is a matrix of one or more predicted labels and B is a matrix of
  coefficients.  The optimal ridge alpha value is chosen for each label by maximizing the average out of fold r2
  score.
class_docstr_tok: ["The","RidgeRegression","class","is","used","to","fit","ridge","models","against","one","or","more","labels","optimized","over","a","provided","list","of","ridge","alpha","parameters",".","It","is","similar","in","function","to","RidgeReduction","except","that","whereas","RidgeReduction","attempts","to","reduce","a","starting","matrix","X","to","a","block","matrix","of","smaller","dimension",",","RidgeRegression","is","intended","to","find","an","optimal","model","of","the","form","Y_hat","~","XB",",","where","Y_hat","is","a","matrix","of","one","or","more","predicted","labels","and","B","is","a","matrix","of","coefficients",".","The","optimal","ridge","alpha","value","is","chosen","for","each","label","by","maximizing","the","average","out","of","fold","r2","score","."]
docstr: Initializes an instance of RidgeRegression using a RidgeReduction object
  
  Args:
      ridge_reduced : A RidgeReduction instance based on which the RidgeRegression instance must be made
      alphas : array_like of alpha values used in the ridge regression (optional).
docstr_tok: ["Initializes","an","instance","of","RidgeRegression","using","a","RidgeReduction","object","Args",":","ridge_reduced",":","A","RidgeReduction","instance","based","on","which","the","RidgeRegression","instance","must","be","made","alphas",":","array_like","of","alpha","values","used","in","the","ridge","regression","(","optional",")","."]
code: def from_ridge_reduction(
      cls, ridge_reduced: RidgeReduction, alphas: List[float] = []
  ):
      """
      Initializes an instance of RidgeRegression using a RidgeReduction object
  
      Args:
          ridge_reduced : A RidgeReduction instance based on which the RidgeRegression instance must be made
          alphas : array_like of alpha values used in the ridge regression (optional).
      """
      obj = cls.__new__(cls)
      obj.reduced_block_df = ridge_reduced.reduced_block_df
      obj.sample_blocks = ridge_reduced.sample_blocks
      obj._label_df = ridge_reduced.get_label_df()
      obj._std_label_df = ridge_reduced._std_label_df
      obj._cov_df = ridge_reduced.get_cov_df()
      obj._std_cov_df = ridge_reduced._std_cov_df
      obj.set_alphas(alphas)
      obj.model_df = None
      obj.cv_df = None
      obj.y_hat_df = None
      return obj
  
imports: from .ridge_udfs import *
  from .ridge_reduction import RidgeReduction
  from .model_functions import _prepare_labels_and_warn, _prepare_covariates, _check_model, _check_cv
  from nptyping import Float, NDArray
  import pandas
  from pyspark.sql import DataFrame, Row
  from pyspark.sql.functions import pandas_udf, PandasUDFType
  import pyspark.sql.functions
  from typeguard import typechecked
  from typing import Any, Dict, List, Union
  from glow.logging import record_hls_event
  import warnings
label_desc: Use image node_id 2 for calling the RidgeRegression obj's underlying member method code with example usage: obj.from_ridge_reduction(cls, ridge_reduced, alphas) and returns: obj