clustertracking.fitfunc.vect_from_params

clustertracking.fitfunc.vect_from_params(params, modes, groups=None, operation=None)[source]

Convert an array of per-feature parameters into a vector for leastsquares optimization

Parameters:

params : 2d ndarray of floats

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)

operation : function

function that converts a 1d array of parameters into a scalar Default None: take the first one (assume they are all equal)