def predict(self, X):
    'Predict none zero elements of coo sparse matrix X according to the fitted model.\n\n        Parameters\n        ----------\n            X {array-like, sparse coo matrix} shape (m, n)\n                Data matrix in coo format. Values are ignored.\n\n        Returns\n        -------\n            {array-like, sparse coo matrix} shape (m, n)\n                Predicted values.\n\n        '
    assert ((self.XT is not None) and (self.thetaT is not None)), 'tranform is invoked on an unfitted model'
    assert scipy.sparse.isspmatrix_coo(X), 'convert X to coo sparse matrix'
    assert (X.dtype == self.dtype)
    a = np.take(self.XT, X.row, axis=0)
    b = np.take(self.thetaT, X.col, axis=0)
    val = np.sum((a * b), axis=1)
    return scipy.sparse.coo_matrix((val, (X.row, X.col)), shape=X.shape)
Predict none zero elements of coo sparse matrix X according to the fitted model.

Parameters
----------
    X {array-like, sparse coo matrix} shape (m, n)
        Data matrix in coo format. Values are ignored.

Returns
-------
    {array-like, sparse coo matrix} shape (m, n)
        Predicted values.
def predict(self, X):
    'Predict none zero elements of coo sparse matrix X according to the fitted model.\n\n        Parameters\n        ----------\n            X {array-like, sparse coo matrix} shape (m, n)\n                Data matrix in coo format. Values are ignored.\n\n        Returns\n        -------\n            {array-like, sparse coo matrix} shape (m, n)\n                Predicted values.\n\n        '
    assert ((self.XT is not None) and (self.thetaT is not None)), 'tranform is invoked on an unfitted model'
    assert scipy.sparse.isspmatrix_coo(X), 'convert X to coo sparse matrix'
    assert (X.dtype == self.dtype)
    a = np.take(self.XT, X.row, axis=0)
    b = np.take(self.thetaT, X.col, axis=0)
    val = np.sum((a * b), axis=1)
    return scipy.sparse.coo_matrix((val, (X.row, X.col)), shape=X.shape)