如何从pyspark模型中的概率列预测中获取元素

时间:2018-05-31 22:23:48

标签: python apache-spark pyspark

如何从概率模型得到第一个元素得到pyspark数据帧?

+------+--------------------+
|labelh|         probability|
+------+--------------------+
|     1|[0.72498853530094...|
|     1|[0.99989771872286...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|
|     1|[0.72498853530094...|    
+------+--------------------+

概率列有两个元素,类型为" vector"变量。我需要此列中的第一个元素并将其粘贴到数据框中。

感谢您的帮助。

0 个答案:

没有答案