Python中的等价R函数h2o.transform

2024-10-01 00:20:12 发布

您现在位置:Python中文网/ 问答频道 /正文

在Python(H2O版本3.20.0.9)中,哪个函数等效于R中的h2o.transform?你知道吗

h2o.transform(modelo_w2v, words_h, aggregate_method = 'AVERAGE') 

Tags: 函数版本transformmethodaggregatewordsaverageh2o
2条回答

正如我在评论中所说的一样:

 h2o.transform(word2vec, words, aggregate_method)

文档:http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/word2vec.html

源代码:https://github.com/h2oai/h2o-3/blob/master/h2o-py/h2o/model/word_embedding.py#L28


enter image description here

根据文档here,它在Python和R中是相同的:

A transform function is available for use with Word2vec. This function transforms words to vectors using an existing Word2Vec model and has the following usage (in both R and Python)

文档中的代码:

h2o.transform(word2vec, words, aggregate_method)

相关问题 更多 >