'Cross validate in Pyspark

I have a need for cross_validate in pyspark. I have unerdstood the code with python but can anyone help me with the pyspark coding of this?

Python code:

from sklearn.model_selection import cross_validate

cv_set = cross_validate(gamma_cdf(), X['input_col'], X['target'], cv = 5, scoring = 'neg_root_mean_squared_error', return_estimator = True)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source