uf3.regression.least_squares.batched_moore_penrose

batched_moore_penrose(x, y, batch_size=2500)[source]

Batched evaluation of gram matrix (x^T x) and ordinate (x^T y).

Parameters
  • x (np.ndarray) – input matrix of shape (n_samples, n_features).

  • y (np.ndarray) – output vector of length n_samples.

  • batch_size – maximum batch size, default 2500 rows. This option should be adjusted based on efficiency/memory tradeoffs.

Returns

Gram matrix (X’X) b: ordinate (X’y)

Return type

a