original_docstring: Computes leverage.
  
      Leverage is a measure of how far away an independent variable values of an 
      observation are from those of other observations.
      
docstring: Computes leverage.
  Leverage is a measure of how far away an independent variable values of an
  observation are from those of other observations.
docstring_tokens: Computes leverage . Leverage is a measure of how far away an independent variable values of an observation are from those of other observations .
code: def leverage(X):
      """Computes leverage.
  
      Leverage is a measure of how far away an independent variable values of an 
      observation are from those of other observations.
      """
      hat = X.dot(np.linalg.inv(X.T.dot(X)).dot(X.T)) 
      hii = np.diagonal(hat)
      return hii
code_tokens: def leverage ( X ) : hat = X . dot ( np . linalg . inv ( X . T . dot ( X ) ) . dot ( X . T ) ) hii = np . diagonal ( hat ) return hii
short_docstring: Computes leverage.
short_docstring_tokens: Computes leverage .
comment: """Computes leverage.
  
      Leverage is a measure of how far away an independent variable values of an 
      observation are from those of other observations.
      """