H2O 相当于 H2O python 中的 allStringVecToCategorical() 和 score() api
H2O equivalent of allStringVecToCategorical() and score() api in H2O python
我在我的 scala 代码中使用 H2O GLRM
模型。
现在将 scala 代码迁移到 python.
但是我无法在 H2O python 模块中找到以下等效方法
1) allStringVecToCategorical()
[属于 H2OFrameSupport 特性]
在代码中使用api:
withLockAndUpdate(h2OFrameForImputation)
{
allStringVecToCategorical(_)
}
2) public帧score(Frame fr)
[属于hex.Model
]
在代码中使用api:
glrmModel.score(h2OFrameForImputation)
请告诉我 H2O
python 模块中的等效方法。
allStringVecToCategorical(_)
没有直接等效的 python api 函数,最接近的是 .asfactor()
(文档 here) which you can use to convert a single column to type enum/categorical. To get the subset of columns with type string you can use the method columns_by_type()
(docs here)。
对于 .score()
,您可以使用 python api 的 .predict()
方法(文档 here)。
我在我的 scala 代码中使用 H2O GLRM
模型。
现在将 scala 代码迁移到 python.
但是我无法在 H2O python 模块中找到以下等效方法
1) allStringVecToCategorical()
[属于 H2OFrameSupport 特性]
在代码中使用api:
withLockAndUpdate(h2OFrameForImputation)
{
allStringVecToCategorical(_)
}
2) public帧score(Frame fr)
[属于hex.Model
]
在代码中使用api:
glrmModel.score(h2OFrameForImputation)
请告诉我 H2O
python 模块中的等效方法。
allStringVecToCategorical(_)
没有直接等效的 python api 函数,最接近的是 .asfactor()
(文档 here) which you can use to convert a single column to type enum/categorical. To get the subset of columns with type string you can use the method columns_by_type()
(docs here)。
对于 .score()
,您可以使用 python api 的 .predict()
方法(文档 here)。