numpy_ndim_furness#
- caf.distribute.furness.numpy_ndim_furness(seed_mat, targets, targ_len, max_iters=10000, tol=1e-09)#
Furness an n dimensional numpy array.
This process works by iteratively summing the target matrix to match dimensions of a target matrix, then adjusting to match that target. One iteration of the process matches to each target in turn and then measures convergence to all. Once convergence has been met or max_iters have occurred the process will exit and return the matrix as an xarray, the achieved convergence score and the number of iterations it took.
- Parameters:
seed_mat (xr.DataArray) – The seed matrix for the furness. If this is a Series the indices must match the targets, and if an xarray the dimensions must match.
targets (list[xr.DataArray]) – A list of xarray targets for the furness. Every target must have dimensions which are a subset of the seed mat.
targ_len (int) – The length of the targets. This is only used for calculating convergence.
max_iters (int = 10000) – The maximum number of iterations before the process will exit.
tol (float = 1e-9) – Target for convergence. This is roughly an rmse measure from the achieved matrix to the targets.
- Returns:
mat (xr.DataArray) – The furnessed matrix.
rmse (float) – The achieved convergence score.
iter_num (int) – The number of iterations the process took.
- Return type:
tuple[DataArray, float, int]