tfp.glm.fit_one_step
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
Runs one step of Fisher scoring.
tfp.glm.fit_one_step(
    model_matrix,
    response,
    model,
    model_coefficients_start=None,
    predicted_linear_response_start=None,
    l2_regularizer=None,
    dispersion=None,
    offset=None,
    learning_rate=None,
    fast_unsafe_numerics=True,
    l2_regularization_penalty_factor=None,
    name=None
)
| Args | 
|---|
| model_matrix | (Batch of) float-like, matrix-shapedTensorwhere each row
represents a sample's features. | 
| response | (Batch of) vector-shaped Tensorwhere each element represents a
sample's observed response (to the corresponding row of features). Must
have samedtypeasmodel_matrix. | 
| model | tfp.glm.ExponentialFamily-like instance used to construct the
negative log-likelihood loss, gradient, and expected Hessian (i.e., the
Fisher information matrix). | 
| model_coefficients_start | Optional (batch of) vector-shaped Tensorrepresenting the initial model coefficients, one for each column inmodel_matrix. Must have samedtypeasmodel_matrix.
Default value: Zeros. | 
| predicted_linear_response_start | Optional Tensorwithshape,dtypematchingresponse; representsoffsetshifted initial linear
predictions based onmodel_coefficients_start.
Default value:offsetifmodel_coefficients is None, andtf.linalg.matvec(model_matrix, model_coefficients_start) + offsetotherwise. | 
| l2_regularizer | Optional scalar Tensorrepresenting L2 regularization
penalty, i.e.,loss(w) = sum{-log p(y[i]|x[i],w) : i=1..n} + l2_regularizer ||w||_2^2.
Default value:None(i.e., no L2 regularization). | 
| dispersion | Optional (batch of) Tensorrepresentingresponsedispersion,
i.e., as in,p(y|theta) := exp((y theta - A(theta)) / dispersion).
Must broadcast with rows ofmodel_matrix.
Default value:None(i.e., "no dispersion"). | 
| offset | Optional Tensorrepresenting constant shift applied topredicted_linear_response.  Must broadcast toresponse.
Default value:None(i.e.,tf.zeros_like(response)). | 
| learning_rate | Optional (batch of) scalar Tensorused to dampen iterative
progress. Typically only needed if optimization diverges, should be no
larger than1and typically very close to1.
Default value:None(i.e.,1). | 
| fast_unsafe_numerics | Optional Python boolindicating if solve should be
based on Cholesky or QR decomposition.
Default value:True(i.e., "prefer speed via Cholesky decomposition"). | 
| l2_regularization_penalty_factor | Optional (batch of) vector-shaped Tensor, representing a separate penalty factor to apply to each model
coefficient, length equal to columns inmodel_matrix. Each penalty
factor multiplies l2_regularizer to allow differential regularization. Can
be 0 for some coefficients, which implies no regularization. Default is 1
for all coefficients.loss(w) = sum{-log p(y[i]|x[i],w) : i=1..n} + l2_regularizer ||w *
  l2_regularization_penalty_factor||_2^2 | 
| name | Python strused as name prefix to ops created by this function.
Default value:"fit_one_step". | 
| Returns | 
|---|
| model_coefficients | (Batch of) vector-shaped Tensor; represents the
next estimate of the model coefficients, one for each column inmodel_matrix. | 
| predicted_linear_response | response-shapedTensorrepresenting linear
predictions based on newmodel_coefficients, i.e.,tf.linalg.matvec(model_matrix, model_coefficients_next) + offset. | 
  
  
 
  
    
    
      
       
    
    
  
  
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2023-11-21 UTC.
  
  
  
    
      [null,null,["Last updated 2023-11-21 UTC."],[],[]]