spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yanbo Liang (JIRA)" <>
Subject [jira] [Commented] (SPARK-16993) model.transform without label column in random forest regression
Date Tue, 16 Aug 2016 08:07:20 GMT


Yanbo Liang commented on SPARK-16993:

[~dulajrajitha] I can not reproduce your reported issue, the following code works well.
    val data ="libsvm").load("/Users/yliang/data/trunk0/spark/data/mllib/sample_libsvm_data.txt")

    val featureIndexer = new VectorIndexer()

    val trainingData = data
    val testData = data.drop("label")

    val rf = new RandomForestRegressor()

    val pipeline = new Pipeline()
      .setStages(Array(featureIndexer, rf))

    val model =

    val predictions = model.transform(testData)"prediction", "features").show(5)
Could you tell me whether this code snippet coincide with your issues? If yes, I think it's
not a bug. Thanks!

> model.transform without label column in random forest regression
> ----------------------------------------------------------------
>                 Key: SPARK-16993
>                 URL:
>             Project: Spark
>          Issue Type: Question
>          Components: Java API, ML
>            Reporter: Dulaj Rajitha
> I need to use a separate data set to prediction (Not as show in example's training data
> But those data do not have the label column. (Since these data are the data that needs
to be predict the label).
> but model.transform is informing label column is missing.
> org.apache.spark.sql.AnalysisException: cannot resolve 'label' given input columns: [id,features,prediction]

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message