'How to keep row names when running h2o automl?

I'm performing a classification task and in particular my goal is to detect the churn of the customers of a company. I'm currently using the library lares that takes advantage of the h2o.automl() function from h2o library:

aml = h2o_automl(df, y = target,max_models = 100) #run the models
aml$scores_test %>% head() #extract the predictions

The problem is that the dataframe df I passed into the h2o_automl function has as row names the IDs of the customers, but when I extract the predictions from the h2o model thed IDs are lost: I have only numbers (1,2,3,...) as row names and I cannot understand to which customer a certain prediction is linked. Does anybody knows how to solve this problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source