spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pengcheng <>
Subject use CrossValidatorModel for prediction
Date Sun, 02 Oct 2016 05:04:00 GMT
Dear Spark Users,

I was wondering.

I have a trained crossvalidator model
*model: CrossValidatorModel*

I wan to predict a score for  *features: RDD[Features]*

Right now I have to convert features to dataframe and then perform
predictions as following:

    val sqlContext = new SQLContext(features.context)
    val input: DataFrame = sqlContext.createDataFrame( =>
(Vectors.dense(x.getArray),1.0) )).toDF("features", "label")

*i wonder If there is any API I can use to performance prediction on each
individual Features*

*For example, x => model.predict(x) ) *

a big thank you!


View raw message