Skip to content

argument "x" is missing, with no default for decision_tree() using a Spark engine #1309

@edgararuiz

Description

@edgararuiz

Decision tree predictions fail when using the Spark engine. Reprex:

suppressPackageStartupMessages(library(sparklyr))
library(parsnip)
sc <- spark_connect("local", version = "4.0.1")

iris_2 <- iris[iris$Species %in% c("setosa", "virginica"), ]
tbl_iris <- copy_to(sc, iris_2, name = "iris")

decision_tree_spec <- decision_tree() |>
  set_mode("classification") |> 
  set_engine("spark")

decision_tree_fit <- decision_tree_spec |> 
  fit(Species ~ ., data = tbl_iris)

predict(decision_tree_fit, type = "class", new_data = tbl_iris)
#> Error in ml_predict.ml_model_classification(object = object$fit, dataset = new_data): argument "x" is missing, with no default

spark_disconnect(sc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions