Import libraries in spark gbt regressor
import pyspark from pyspark.sql import SparkSession from pyspark.ml.regression import GBTRegressor from pyspark.ml.feature import StringIndexer, VectorAssembler from pyspark.ml.feature import VectorAssembler from pyspark.ml import Pipeline from pyspark.ml.evaluation import BinaryClassificationEvaluator conf = pyspark.SparkConf().setAppName("Gradient Boosted Tree Regressor") sc = SparkContext.getOrCreate(conf=conf)