This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyspark.sql.types import DoubleType | |
from pyspark.sql.functions import expr | |
from pyspark.sql.functions import * | |
from pyspark.sql.types import * | |
def _p1(v): | |
return float(v.array[1])y | |
take_one = udf(_p1, DoubleType()) | |
df = tested_df.withColumn("p", take_one(tested_df.probability)) | |
wrong_df = df.orderBy(expr("abs(p - label)"), ascending=False) | |
wrong_df.select("image.origin", "p", "label").show(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment