如何在 Data Science Experience 上实施 TensorFrames Spark 包?

How do I implement the TensorFrames Spark package on Data Science Experience?

我已经能够导入包了:

import pixiedust
pixiedust.installPackage("databricks:tensorframes:0")

但是当我尝试一个简单的例子时:

import tensorflow as tf
import tensorframes as tfs
from pyspark.sql import Row
data = [Row(x=[float(x), float(2 * x)],
            key=str(x % 2),
            z = float(x+1)) for x in range(1, 6)]
df = spark.createDataFrame(data)
tfs.print_schema(df)

我收到以下错误:

...

Py4JJavaError: An error occurred while calling o97.loadClass.
: java.lang.NoClassDefFoundError:com.typesafe.scalalogging.slf4j.LazyLogging

...

I've looked up the issue 并且依赖树中似乎有一个较旧的 scala-logging-slf4j 工件。 如何删除此工件?删除后,我想我可以使用 PixieDust 添加更新的版本:

pixiedust.installPackage("https://mvnrepository.com/artifact/com.typesafe.scala-logging/scala-logging-slf4j_2.10/2.1.2") pixiedust.installPackage("https://mvnrepository.com/artifact/com.typesafe.scala-logging/scala-logging-api_2.10/2.1.2")

来自 IBM 支持的 Charles 帮助我找到了要包含的 jar:

pixiedust.installPackage("http://central.maven.org/maven2/com/typesafe/scala-logging/scala-logging-slf4j_2.10/2.1.2/scala-logging-slf4j_2.10-2.1.2.jar") pixiedust.installPackage("http://central.maven.org/maven2/com/typesafe/scala-logging/scala-logging-api_2.10/2.1.2/scala-logging-api_2.10-2.1.2.jar")

这在技术上解决了第一个错误,但 TesnsorFrames 仍然无法正常工作。我会 post 另一个更具体的问题。