tffm/utils.py
def initial_coefficient(decomposition):
    """Compute initial coefficient of the decomposition."""
    order = np.sum(decomposition)
    coef = math.factorial(order)
    coef /= np.prod([math.factorial(x) for x in decomposition])
    _, counts = np.unique(decomposition, return_counts=True)
    coef /= np.prod([math.factorial(c) for c in counts])
    return coef
Compute initial coefficient of the decomposition.
Compute initial coefficient of the decomposition.
Compute initial coefficient of the decomposition .
def initial_coefficient(decomposition):
    order = np.sum(decomposition)
    coef = math.factorial(order)
    coef /= np.prod([math.factorial(x) for x in decomposition])
    _, counts = np.unique(decomposition, return_counts=True)
    coef /= np.prod([math.factorial(c) for c in counts])
    return coef
def initial_coefficient ( decomposition ) : order = np . sum ( decomposition ) coef = math . factorial ( order ) coef /= np . prod ( [ math . factorial ( x ) for x in decomposition ] ) _ , counts = np . unique ( decomposition , return_counts = True ) coef /= np . prod ( [ math . factorial ( c ) for c in counts ] ) return coef
Compute initial coefficient of the decomposition.
Compute initial coefficient of the decomposition .
"""Compute initial coefficient of the decomposition."""
decomposition