libmultilabel/linear/linear.py
def predict_values(model, x: sparse.csr_matrix) -> np.ndarray:
    """
    Calculates the decision values associated with x.

    Returns a matrix with dimension number of instances * number of classes.

    x is a matrix with dimension number of instances * number of features.
    """
    bias = model['-B']
    bias_col = np.full((x.shape[0], 1 if bias > 0 else 0), bias)
    nr_feature = model['weights'].shape[0]
    nr_feature -= 1 if bias > 0 else 0
    if x.shape[1] < nr_feature:
        x = sparse.hstack([
            x,
            np.zeros((x.shape[0], nr_feature - x.shape[1])),
            bias_col,
        ], 'csr')
    else:
        x = sparse.hstack([
            x[:, :nr_feature],
            bias_col,
        ], 'csr')

    return (x * model['weights']).A

    Calculates the decision values associated with x.

    Returns a matrix with dimension number of instances * number of classes.

    x is a matrix with dimension number of instances * number of features.
    
Calculates the decision values associated with x.
Returns a matrix with dimension number of instances * number of classes.

x is a matrix with dimension number of instances * number of features.
Calculates the decision values associated with x . Returns a matrix with dimension number of instances * number of classes . x is a matrix with dimension number of instances * number of features .
def predict_values(model, x: sparse.csr_matrix) -> np.ndarray:
    bias = model['-B']
    bias_col = np.full((x.shape[0], 1 if bias > 0 else 0), bias)
    nr_feature = model['weights'].shape[0]
    nr_feature -= 1 if bias > 0 else 0
    if x.shape[1] < nr_feature:
        x = sparse.hstack([
            x,
            np.zeros((x.shape[0], nr_feature - x.shape[1])),
            bias_col,
        ], 'csr')
    else:
        x = sparse.hstack([
            x[:, :nr_feature],
            bias_col,
        ], 'csr')
    return (x * model['weights']).A
def predict_values ( model , x : sparse . csr_matrix ) -> np . ndarray : bias = model [ '-B' ] bias_col = np . full ( ( x . shape [ 0 ] , 1 if bias > 0 else 0 ) , bias ) nr_feature = model [ 'weights' ] . shape [ 0 ] nr_feature -= 1 if bias > 0 else 0 if x . shape [ 1 ] < nr_feature : x = sparse . hstack ( [ x , np . zeros ( ( x . shape [ 0 ] , nr_feature - x . shape [ 1 ] ) ) , bias_col , ] , 'csr' ) else : x = sparse . hstack ( [ x [ : , : nr_feature ] , bias_col , ] , 'csr' ) return ( x * model [ 'weights' ] ) . A
Calculates the decision values associated with x.
Calculates the decision values associated with x .
"""
    Calculates the decision values associated with x.

    Returns a matrix with dimension number of instances * number of classes.

    x is a matrix with dimension number of instances * number of features.
    """
model
x
sparse.csr_matrix