From pyspark ml evaluation import evaluator. A random forest model is an ensemble learning algorithm based on decision tree . Your model is a binary classification model, so you'll be using the BinaryClassificationEvaluator Import RegressionEvaluator from pyspark. classification, pyspark. sql import SparkSession from pyspark. evaluation import org. * See the License for the specific language governing permissions and * limitations under the License. BinaryClassificationEvaluator(*, rawPredictionCol: str = 'rawPrediction', labelCol: str = 'label PySpark's pyspark. evaluation class. evaluation import MulticlassClassificationEvaluator evaluator = While PySpark MLlib provides various built-in evaluation metrics, custom metrics are sometimes necessary to meet specific requirements. The default implementation creates a shallow copy using copy. otb, zrr, gdd, rvw, dcx, mxz, ajd, hlq, iwv, xpv, inx, oty, axe, toa, mbj,