NMF counts them as zeros.
I figured it out using this code:
from scipy import sparse
from sklearn.decomposition import NMF
import numpy as np
mat = np.array([[1,1,1],
[1,1,0],
[1,0,0]], 'float32')
ix = np.nonzero(mat)
sparse_mat = sparse.csc_matrix((mat[ix], ix))
print('training matrix:')
print(sparse_mat.toarray())
model = NMF(n_components=1).fit(sparse_mat)
reconstructed = model.inverse_transform(model.transform(sparse_mat))
print('reconstructed:')
print(reconstructed)
The result:
training matrix:
[[1. 1. 1.]
[1. 1. 0.]
[1. 0. 0.]]
reconstructed:
[[1.22 0.98 0.54]
[0.98 0.78 0.44]
[0.54 0.44 0.24]]
Note that all of the none-zero elements are ones, so perfect reconstruction was possible by ignoring other elements, so considering this output, it's not the case.