[英]Is there any similar way to replicate “qcut” function of pandas in pyspark?
I wanted to do the KS test in the pyspark for the predicted probability and true labels.我想在 pyspark 中对预测概率和真实标签进行 KS 测试。 The similar work has been done in the pandas in the link: https://www.listendata.com/2019/07/KS-Statistics-Python.html类似的工作已经在链接中的pandas中完成: https://www.listendata.com/2019/07/KS-Statistics-Python.ZFC35FDC70D5FC69D239883A822C7A
No there is no direct way.不,没有直接的方法。 You have to apply window functions etc. I have always convert to pandas when I needed this:-) Or when I am working in a Databricks type environment I leverage spark sql.你必须应用 window 函数等。当我需要这个时,我总是转换为 pandas :-) 或者当我在 Databricks 类型的环境中工作时,我利用 spark sql。 I have found these easier than the windowing methods.我发现这些比窗口方法更容易。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.