Skip to content

Instantly share code, notes, and snippets.

@crawles
Created January 24, 2017 19:03
Show Gist options
  • Save crawles/c57945ec7f2d8456560d4613284e3a8f to your computer and use it in GitHub Desktop.
Save crawles/c57945ec7f2d8456560d4613284e3a8f to your computer and use it in GitHub Desktop.
# train the model
from pyspark.ml.feature import VectorAssembler
t = VectorAssembler(inputCols=['yr'], outputCol = 'features')
training = t.transform(fga_py)\
.withColumn('yr',fga_py.yr)\
.withColumn('label',fga_py.fg3a_p36m)
training.toPandas().head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment