doubly_constrained_furness#
- caf.distribute.furness.doubly_constrained_furness(seed_vals, row_targets, col_targets, tol=1e-09, max_iters=5000, warning=True)#
Perform a doubly constrained furness for max_iters or until tol is met.
Controls numpy warnings to warn of any overflow errors encountered
- Parameters:
seed_vals (ndarray) – Initial values for the furness. Must be of shape (len(n_rows), len(n_cols)).
row_targets (ndarray) – The target values for the sum of each row. i.e np.sum(matrix, axis=1)
col_targets (ndarray) – The target values for the sum of each column i.e np.sum(matrix, axis=0)
tol (float) – The maximum difference between the achieved and the target values to tolerate before exiting early. R^2 is used to calculate the difference.
max_iters (int) – The maximum number of iterations to complete before exiting.
warning (bool) – Whether to print a warning or not when the tol cannot be met before max_iters.
- Returns:
furnessed_matrix – The final furnessed matrix
completed_iters – The number of completed iterations before exiting
achieved_rmse – The Root Mean Squared Error difference achieved before exiting
- Return type:
tuple[ndarray, int, float]