Ejemplo n.º 1
0
 def __init__(self, predictionAndLabels):
     sc = predictionAndLabels.ctx
     sql_ctx = SQLContext(sc)
     df = sql_ctx.createDataFrame(predictionAndLabels,
                                  schema=sql_ctx._inferSchema(predictionAndLabels))
     java_model = callMLlibFunc("newRankingMetrics", df._jdf)
     super(RankingMetrics, self).__init__(java_model)
Ejemplo n.º 2
0
 def __init__(self, predictionAndLabels):
     sc = predictionAndLabels.ctx
     sql_ctx = SQLContext(sc)
     df = sql_ctx.createDataFrame(predictionAndLabels,
                                  schema=sql_ctx._inferSchema(predictionAndLabels))
     java_model = callMLlibFunc("newRankingMetrics", df._jdf)
     super(RankingMetrics, self).__init__(java_model)
Ejemplo n.º 3
0
 def __init__(self, predictionAndLabels):
     sc = predictionAndLabels.ctx
     sql_ctx = SQLContext(sc)
     df = sql_ctx.createDataFrame(predictionAndLabels,
                                  schema=sql_ctx._inferSchema(predictionAndLabels))
     java_class = sc._jvm.org.apache.spark.mllib.evaluation.MultilabelMetrics
     java_model = java_class(df._jdf)
     super(MultilabelMetrics, self).__init__(java_model)
Ejemplo n.º 4
0
 def __init__(self, predictionAndLabels):
     sc = predictionAndLabels.ctx
     sql_ctx = SQLContext(sc)
     df = sql_ctx.createDataFrame(predictionAndLabels,
                                  schema=sql_ctx._inferSchema(predictionAndLabels))
     java_class = sc._jvm.org.apache.spark.mllib.evaluation.MultilabelMetrics
     java_model = java_class(df._jdf)
     super(MultilabelMetrics, self).__init__(java_model)
Ejemplo n.º 5
0
 def __init__(self, predictionAndLabels):
     """
     :param predictionAndLabels: an RDD of (predicted ranking, ground truth set) pairs.
     """
     sc = predictionAndLabels.ctx
     sql_ctx = SQLContext(sc)
     df = sql_ctx.createDataFrame(predictionAndLabels,
                                  schema=sql_ctx._inferSchema(predictionAndLabels))
     java_model = callMLlibFunc("newRankingMetrics", df._jdf)
     super(RankingMetrics, self).__init__(java_model)
Ejemplo n.º 6
0
 def __init__(self, predictionAndLabels):
     """
     :param predictionAndLabels: an RDD of (predicted ranking, ground truth set) pairs.
     """
     sc = predictionAndLabels.ctx
     sql_ctx = SQLContext(sc)
     df = sql_ctx.createDataFrame(
         predictionAndLabels,
         schema=sql_ctx._inferSchema(predictionAndLabels))
     java_model = callMLlibFunc("newRankingMetrics", df._jdf)
     super(RankingMetrics, self).__init__(java_model)