首页 > 解决方案 > eli5 输出中的 Databricks pyspark IPython.core.display.HTML 错误

问题描述

XGBoost 使用 eli5 以 HTML 格式显示预测打印结果,这在 Databricks 的 pyspark 中不起作用。

displayHTML(file_name)给出错误:

Py4JException:Python 代理引发了异常。返回信息:x

我也安装了 ipython 库。即使对于这个简单的查询,它也会给出错误。

from IPython.display import display, HTML
from IPython.core.display import display, HTML

display(HTML('<h1>Hello, world!</h1>'))
print("Here's a link:")
display(HTML("<a href='http://www.google.com' target='_blank'>www.google.com</a>"))
print("some more printed text ...")
display(HTML('<p>Paragraph text here ...</p>'))

我得到的输出/错误是:

<IPython.core.display.HTML at 0x7f63e0c5d5f8>
Here's a link:
<IPython.core.display.HTML at 0x7f6408fbe358>
some more printed text ...
<IPython.core.display.HTML at 0x7f6408fbe358>

标签: pythonhtmlpysparkxgboostdatabricks

解决方案


推荐阅读