You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/03/31 16:12:00 UTC
[jira] [Commented] (SPARK-38588) Validate input dataset of ml.classification
[ https://issues.apache.org/jira/browse/SPARK-38588?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17515418#comment-17515418 ]
Apache Spark commented on SPARK-38588:
--------------------------------------
User 'jackylee-ch' has created a pull request for this issue:
https://github.com/apache/spark/pull/36026
> Validate input dataset of ml.classification
> -------------------------------------------
>
> Key: SPARK-38588
> URL: https://issues.apache.org/jira/browse/SPARK-38588
> Project: Spark
> Issue Type: Sub-task
> Components: ML
> Affects Versions: 3.4.0
> Reporter: zhengruifeng
> Priority: Major
> Fix For: 3.4.0
>
>
> LinearSVC should fail fast if the input dataset contains invalid values.
>
> {code:java}
> import org.apache.spark.ml.feature._
> import org.apache.spark.ml.linalg._
> import org.apache.spark.ml.classification._
> import org.apache.spark.ml.clustering._
> val df = sc.parallelize(Seq(LabeledPoint(1.0, Vectors.dense(1.0, Double.NaN)), LabeledPoint(0.0, Vectors.dense(Double.PositiveInfinity, 2.0)))).toDF()
> val svc = new LinearSVC()
> val model = svc.fit(df)
> scala> model.intercept
> res0: Double = NaN
> scala> model.coefficients
> res1: org.apache.spark.ml.linalg.Vector = [NaN,NaN] {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org