org.apache.spark.SparkException

Currently, LogisticRegression with ElasticNet in ML package only supports binary classification. Found 5 in the input dataset.

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web1597

  • Currently, LogisticRegression with ElasticNet in ML package only supports binary classification. Found 5 in the input dataset.
  • Currently, LogisticRegression with ElasticNet in ML package only supports binary classification. Found 5 in the input dataset.
  • via Stack Overflow by hbabbar
    , 1 year ago
    Currently, LogisticRegression with ElasticNet in ML package only supports binary classification. Found 5 in the input dataset.
  • Stack trace

    • org.apache.spark.SparkException: Currently, LogisticRegression with ElasticNet in ML package only supports binary classification. Found 5 in the input dataset. at org.apache.spark.ml.classification.LogisticRegression.train(LogisticRegression.scala:290) at org.apache.spark.ml.classification.LogisticRegression.train(LogisticRegression.scala:159) at org.apache.spark.ml.Predictor.fit(Predictor.scala:90) at org.apache.spark.ml.Predictor.fit(Predictor.scala:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231) at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:381) at py4j.Gateway.invoke(Gateway.java:259) at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133) at py4j.commands.CallCommand.execute(CallCommand.java:79) at py4j.GatewayConnection.run(GatewayConnection.java:209) at java.lang.Thread.run(Thread.java:745)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Once, 8 months ago