Skip to content

Instantly share code, notes, and snippets.

@FavioVazquez
Last active May 2, 2018 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FavioVazquez/271c069453b5917d85aeec0001d54624 to your computer and use it in GitHub Desktop.
Save FavioVazquez/271c069453b5917d85aeec0001d54624 to your computer and use it in GitHub Desktop.
df = p_model.transform(image_df)
# 100930342_92e8746431_n.jpg not a daisy
df.select("image.origin",(1-take_one(df.probability)).alias("p_daisy")).show(truncate=False)
+---------------------------------------------------+--------------------+
|origin |p_daisy |
+---------------------------------------------------+--------------------+
|.../100930342_92e8746431_n.jpg |0.016760347798379538|
|.../10140303196_b88d3d6cec.jpg |0.9704259547739851 |
|.../100080576_f52e8ee070_n.jpg |0.9705190124824862 |
+------------------------------------------------------------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment