我试图在以下链接https://github.com/parrt/dtreeviz/blob/master/notebooks/dtreeviz_spark_visualisations.ipynb中使用GitHub中的代码可视化我的决策树分类当我实现代码时:
df = spark.read.parquet("../../dtreeviz/testing/testlib/models/fixtures/spark_3_0_decision_tree_classifier.model/training_df")
我得到以下错误:
AnalysisException Traceback (most
recent call last)
~AppDataLocalTemp/ipykernel_12920/640132816.py in <module>
----> 1 df = spark.read.parquet("../../dtreeviz/testing/testlib/models/fixtures/spark_3_0_decision_tree_classifier.model/training_df")
C:sparkspark-3.2.1-bin-hadoop2.7pythonpysparksqlreadwriter.py in parquet(self, *paths,
**options)
299 int96RebaseMode=int96RebaseMode)
300
--> 301 return self._df(self._jreader.parquet(_to_seq(self._spark._sc, paths)))
302
303 def text(self, paths, wholetext=False, lineSep=None, pathGlobFilter=None,
C:sparkspark-3.2.1-bin-hadoop2.7pythonlibpy4j-0.10.9.3-src.zippy4jjava_gateway.py in
__call__(self, *args)
1319
1320 answer = self.gateway_client.send_command(command)
-> 1321 return_value = get_return_value(
1322 answer, self.gateway_client, self.target_id, self.name)
1323
C:sparkspark-3.2.1-bin-hadoop2.7pythonpysparksqlutils.py in deco(*a, **kw)
115 # Hide where the exception came from that shows a non-Pythonic
116 # JVM exception message.
--> 117 raise converted from None
118 else:
119 raise
AnalysisException: Path does not exist: file:/C:/Users/dtreeviz/testing/testlib/models/fixtures/spark_3_0_decision_tree_classifier.model/t
raining_df
我遵循了这个链接中的所有说明https://github.com/parrt/dtreeviz
我无法在我的本地机器中找到路径,我对代码的作用感到困惑,因为我不熟悉Parquet格式,它看起来像一个路径,但是.model指的是?
我看了看笔记本。实际上,它包含了一些用于开发/测试的不必要的代码。
在您的情况下,'df'数据框不需要实际的可视化。你可以对它进行注释,可视化应该可以工作。