0

我正在尝试从 org 模块导入 FPGrowth,但在安装 org 模块时会引发错误。我还尝试将 org.apache.spark 替换为 pyspark,仍然无法正常工作。

!pip install org
import org.apache.spark.ml.fpm.FPGrowth

以下是错误:

ERROR: Could not find a version that satisfies the requirement org (from versions: none)
ERROR: No matching distribution found for org
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-12-c730562e7076> in <module>
      1 get_ipython().system('pip install org')
----> 2 import org.apache.spark.ml.fpm.FPGrowth

ModuleNotFoundError: No module named 'org'
4

1 回答 1

1

FPGrowth在 PySpark 中导入,您需要编写:

from pyspark.ml.fpm import FPGrowth

FPGrowth您可以在Spark 文档中找到有关如何使用的其他说明。

于 2020-06-02T01:33:02.920 回答