uf3.regression.least_squares.weighted_least_squares

weighted_least_squares(x, y, weights=None, regularizer=None)[source]

Solves the linear least-squares problem with optional Tikhonov regularizer matrix and optional weighting. TODO: Remove (deprecated)

Parameters
  • x (np.ndarray) – input matrix.

  • y (np.ndarray) – output vector.

  • weights (np.ndarray) – sample weights (optional).

  • regularizer (np.ndarray) – Tikhonov regularizer matrix.

Returns

coefficients. predictions (list of np.ndarray): predictions.

Return type

solution (np.ndarray)