clustertracking.fitfunc.vect_to_params

clustertracking.fitfunc.vect_to_params(vect, params, modes, groups=None)[source]

Convert a vector from leastsquares optimization to an array of per-feature parameters.

Parameters:

vect : 1d ndarray of floats

the vector from leastsquares optimization

params : 2d ndarray of floats

the array of per-feature parameters, to be able to know the constants

modes : 1d ndarray of integers

modes of every variable along the first axis of var_array 0 corresponds to constant 1 corresponds to varying 2 corresponds to varying, but equal for each feature 3 corresponds to varying, but equal within cluster others are custom (e.g. per particle, per frame)

groups : iterable of lists

each dictionary contains the grouped indices indices correspond to n_mode - 3. (e.g. column 0 has cluster indices)