Hi KuanS, thanks for the solution. Currently I am working on solving the same function. Sadly, the proposal is not working as a simple function. Do you have any idea on how to access the rc=x.indices()[:,mask] when the x features is not a sparse matrix? In the case of transforming it to a sparse matrix then the indices are in 2nd dimension. Moreover, both functionalities x._values() and x._indices() must be deprecated because an error appears.Thank you in advance