Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-12015

Auto convert int to Double when required in pyspark.ml

    XMLWordPrintableJSON

Details

    • Patch, Important

    Description

      I have received the following exception:

      Why we cannot pass an integer when the required parameter is Double?

      I think this should be upcasted silently.

      java.lang.IllegalArgumentException: requirement failed: Column label must be of type DoubleType but was actually IntegerType.
      at scala.Predef$.require(Predef.scala:233)
      at org.apache.spark.ml.util.SchemaUtils$.checkColumnType(SchemaUtils.scala:42)
      at org.apache.spark.ml.PredictorParams$class.validateAndTransformSchema(Predictor.scala:53)
      at org.apache.spark.ml.classification.Classifier.org$apache$spark$ml$classification$ClassifierParams$$super$validateAndTransformSchema(Classifier.scala:56)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jamartinh Jose Antonio
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: