【问题标题】:How to set the number of iterations in PySpark Word2vec model?如何在 PySpark Word2vec 模型中设置迭代次数?
【发布时间】:2018-08-16 14:58:33
【问题描述】:

我的代码:

 word2Vec = Word2Vec(vectorSize = 100, minCount = 100, inputCol = 'token', 
 outputCol = 'word2vec', seed=123)

我尝试了关键字 numIterations,
但它是无效的

来自 Pyspark 文档:

setNumIterations(int numIterations)

设置迭代次数(默认:1),应该小于或等于分区数。

感谢您的帮助。

【问题讨论】:

  • 你检查过 PySpark 文档吗?
  • 是的。在文档中: setNumIterations(int numIterations) 设置迭代次数(默认:1),应该小于或等于分区数。

标签: python apache-spark word2vec


【解决方案1】:

参数好像是maxIter:试试看。

  final val maxIter: IntParam = new IntParam(this, "maxIter", 
     "maximum number of iterations (>= 0)", ParamValidators.gtEq(0))

【讨论】:

  • @JerryGeorge 感谢您的接受!你把我放在首位! (现在 20002 声望)
猜你喜欢
  • 2019-05-26
  • 1970-01-01
  • 2016-10-01
  • 2018-01-02
  • 1970-01-01
  • 2020-01-06
  • 1970-01-01
  • 2023-03-05
  • 2017-09-01
相关资源
最近更新 更多