1

我正在使用广义低秩估计器来推断数据集中有关传感器读数的缺失值。我正在使用 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 条目有关,但我已经尝试过一个完整的条目,并且出现了同样的问题。我需要这些信息来对一些模型参数执行网格搜索以选择最佳参数。

非常感谢,

路易莎·诺盖拉

4

1 回答 1

0

以下是文档中的示例。预计 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 RMSE:NaN
平方和误差(数字):1.9833472629189004e-13
错误分类误差(分类):0.0

于 2021-04-07T04:45:53.563 回答