mlr-org / mlr3

mlr3: Machine Learning in R - next generation
https://mlr3.mlr-org.com
GNU Lesser General Public License v3.0
914 stars 84 forks source link

improve error message in as_task_<xx> when target is not given #944

Closed mb706 closed 11 months ago

mb706 commented 1 year ago
as_task_classif(data.frame(x = factor(c("a", "b", "a", "b"), levels = c("a", "b")), y = factor(c("a", "b", "a", "b"), levels = c("a", "b"))))
#> Error in .subset2(x, i, exact = exact) : 
#>  attempt to select less than one element in get1index

should inform the user that the problem is the missing target?