Skip to content

Instantly share code, notes, and snippets.

@bfraiche
Created April 2, 2019 17:43
Show Gist options
  • Save bfraiche/be649ae5e9ed10cd96978b14b4c164a8 to your computer and use it in GitHub Desktop.
Save bfraiche/be649ae5e9ed10cd96978b14b4c164a8 to your computer and use it in GitHub Desktop.
This gist contains code snippets for my blogpost: 'Random Forest with Python and Spark ML'
from pyspark.ml.feature import VectorAssembler
feature_list = []
for col in df.columns:
if col == 'label':
continue
else:
feature_list.append(col)
assembler = VectorAssembler(inputCols=feature_list, outputCol="features")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment