H2O 中的 GLRM - 性能指标返回 NaN

问题描述

我正在使用通用的低秩估计器来推断数据集中有关传感器读数的缺失值。我正在使用 H2O 创建和训练模型:

glrm = H2OGeneralizedLowRankEstimator(k=10,loss="quadratic",gamma_x=0.5,gamma_y=0.5,max_iterations=2000,recover_svd=True,init="SVD",transform="standardize")
glrm.train(training_frame=train)

在训练模型后,提供的有关性能指标(MSE 和 RMSE)的信息都返回 NaN。有人知道为什么吗?首先我认为它可能与数据集中的 NaN 条目有关,但我已经尝试过一个完整的,并且出现了同样的问题。 我需要这些信息来对一些模型参数执行网格搜索以选择最佳参数。

非常感谢,

路易莎·诺盖拉

解决方法

以下是 docs 中的示例。预计将获得 MSE 作为 NaN。最好将其从输出中排除。检查您是否得到 Sum of Squared Error (Numeric) 或使用您定义为 "quadratic" 的损失函数(目标)。

import h2o
from h2o.estimators import H2OGeneralizedLowRankEstimator
h2o.init()

# Import the USArrests dataset into H2O:
arrestsH2O = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/pca_test/USArrests.csv")

# Split the dataset into a train and valid set:
train,valid = arrestsH2O.split_frame(ratios=[.8],seed=1234)

# Build and train the model:
glrm_model = H2OGeneralizedLowRankEstimator(k=4,loss="quadratic",gamma_x=0.5,gamma_y=0.5,max_iterations=700,recover_svd=True,init="SVD",transform="standardize")
glrm_model.train(training_frame=train)

返回 MSE、RMSE 和 NaN:

型号详情 ============ H2OGeneralizedLowRankEstimator:广义低秩建模模型密钥:GLRM_model_python_1617769810268_1

模型总结: number_of_iterations final_step_size final_objective_value 0 58.0 0.00005 8.250804e-31

ModelMetricsGLRM: glrm ** 报告列车数据。 **

MSE:NaN 均方根误差:NaN
平方误差总和(数字): 1.9833472629189004e-13
错误分类错误(分类):0.0