I am using the Apache Spark API in python, PySpark (--version 3.0.0), and would ideally like to perform cross-validation of my labelled data in a stratified manner since my data is highly imbalanced! I am currently using the below module.
from pyspark.ml.tuning import CrossValidator
In scikit-learn this is possible by defining a StratifiedKFold and placing it in the cv argument of any of the grid search function. This ensures that every K fold a given estimator is trained on, contains the labelled data in a proportionally representative way.
Is there an equivalent for this in PySpark?
< rant> I would have loved to asked this question from the Spark team or as an improvement suggestion but their GitHub page does not allow for either bug reports or improvement suggestions and their official page requires the accompanying source code suggestions, which is slightly above my skill set! </ rant>