rfModel.toDebugString错误

我在Spark 2.2和Python 2.7.11中使用pyspark,我尝试使用.toDebugString方法从随机森林分类器的决策树中提取规则。rfModel.toDebugString错误

我成功吧,但是因为从2.1到2.2的更新,星火崩溃我使用这个命令后,我得到这个错误:

完整的错误:

rfModel.toDebugString 

----------------------------------------u'RandomForestClassificationModel (uid=RandomForestClassifier_4e99b85432585e2e32a2) with 30 trees\n Tr' Exception happened during processing of request from ('127.0.0.1', 42374) Traceback (most recent call last): File "/usr/local/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock self.process_request(request, client_address) File "/usr/local/lib/python2.7/SocketServer.py", line 321, in process_request self.finish_request(request, client_address) File "/usr/local/lib/python2.7/SocketServer.py", line 334, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/local/lib/python2.7/SocketServer.py", line 655, in init self.handle() File "/opt/cloudera/parcels/SPARK2/lib/spark2/python/pyspark/accumulators.py", line 235, in handle num_updates = read_int(self.rfile) File "/opt/cloudera/parcels/SPARK2/lib/spark2/python/pyspark/serializers.py", line 577, in read_int ---------------------------------------- raise EOFError EOFError

如果我在我得到这个错误后再次运行命令:

Py4JError: An error occurred while calling o1129.toString

我的代码相当简单,我非常。

#Get random forest from pipeline 

rfModel = model.stages[1]

rfModel.toDebugString

我知道rfModel是一个randomForestClassifier对象。任何想法,为什么我得到这个错误?

回答:

我的问题的解决方案是python版本。通过使用python3 +与spark 2.2我设法工作.toDebugString方法没有问题。对于任何未来看到此内容的人,我都会更新完整的错误日志。

以上是 rfModel.toDebugString错误 的全部内容, 来源链接: utcz.com/qa/261683.html

回到顶部