You don't need `random_state`, do you? In that case you can even declare `factorize_matrix` as a `cpef` function.